Documentation
How Toolgraph works
What the Model Context Protocol is
MCP is an open protocol for exposing tools to language models. A server advertises a list of tools, and each tool comes with a JSON Schema describing exactly what it takes and — when the server bothers — what it returns. Those schemas are the whole reason Toolgraph exists: they are machine-readable contracts published by the tool itself, so two tools can be checked against each other without anyone writing an integration first.
You do not need to know anything else about the protocol to use Toolgraph. If you have a URL for an MCP server, that is enough.
Connections
A connection is a server you have told Toolgraph about, saved once and usable from every graph. Three transports are supported: streamable HTTP and server-sent events, which a hosted engine can reach, and stdio, which spawns a local process and is therefore refused by the hosted engine and available only when you run the engine yourself.
Testing a connection reads the server's tools and their schemas and caches them, so opening a graph does not have to wake the engine to draw a palette. The cache is never trusted for execution — every run re-reads the server for real.
Credentials
If a server needs an Authorization header, you can save it with the connection. It is encrypted with AES-256-GCM before it reaches the database, under a key held in the server environment rather than in Postgres, and the table it lives in is granted to the server role alone — no browser session can read it by any query. It is decrypted only to make an outbound request to the server you pointed it at, and it is never returned to a browser, written to a log, or included in an export.
On a deployment with no encryption key configured, Toolgraph refuses to store credentials at all rather than storing them in some weaker form. You type the header when you test the connection and it is dropped afterwards.
Type checking, at design time
This is the part that is different. When you draw an edge from one tool's output field to another tool's input field, Toolgraph resolves both sides to a concrete JSON Schema and checks whether the source can satisfy the target — before the edge exists, not when the graph runs.
What that check covers:
- Primitive types, including the integer-versus-number distinction.
- Object shapes, required versus optional properties, and additional properties.
- Arrays and tuples, element by element.
enumandconst, as a subset test — a source that may produce a value the target does not accept is refused.anyOfandoneOf, by finding a branch that satisfies the target, and refusing when none does.$ref, resolved within the document, with a depth limit so a recursive schema cannot hang the checker.- Numeric and string constraints, where the target's cannot be guaranteed.
An incompatible connection is not merely rejected. You are told the field, the type the target needs and the type the source supplies, in a sentence — because “invalid connection” tells you nothing you can act on.
A tool whose server declares no output schema is handled honestly: nothing can be proven about it, so its outgoing connections are warnings rather than errors, and they say so.
Running a graph
A test-run sends the graph and any per-call credentials to the execution engine in one request, and results stream back over server-sent events on that same request. Each step appears as it finishes.
The engine is a separate service because a serverless function cannot hold a multi-minute streaming session or a stdio subprocess. It is stateless: nothing is kept between requests, so it can sleep and wake without losing anything. It does sleep — it runs on a free plan — and the first request after a quiet period takes about a minute. The UI says so rather than looking broken.
Per-step inputs and outputs are streamed to your browser and are never written down. What is stored is the summary: that a run happened, how long it took, how many steps, and where it stopped. You can see those under Runs.
Exporting
A valid graph exports to standalone TypeScript — real interfaces generated from the schemas, plus zod validators — or Python, with Pydantic models and typed functions. The generated code has zero Toolgraph runtime dependency. You can delete your account and it keeps working.
Exports never contain credentials. What they contain is an .env.example naming what the code will need.
Workspaces
A workspace is a shared container. Graphs and connections in one are visible to every member, and a shared connection stores its credential once — members use it without ever seeing it. Roles are owner, admin and member: admins invite and remove people, the owner can additionally transfer or delete the workspace.
An invitation is addressed to an email address and has no token in the link, on purpose. Accepting requires being signed in as that address, so forwarding the mail does not pass the invitation on.
Self-hosting
Toolgraph is MIT licensed and the whole stack is in the repository: the Next.js app, the Fastify engine, the shared packages and every database migration. The README covers running it locally and deploying it, and .env.example documents every variable, where to get it, and whether it is a secret.