Developers
Mentat for developers and their agents.
One origin serves everything: a REST API described by OpenAPI, a stateless MCP server over Streamable HTTP, a CLI on npm, and a sandbox graph you can call right now without a key. There is no signup. A key is one request away.
Quickstart
Three steps, each one optional. The first works before you have decided anything.
1. ASK THE SANDBOX WHAT GOVERNS A FILE
curl -s https://trymentat.pages.dev/api/demo/resolve \
-H 'content-type: application/json' \
-d '{"file_path":"src/routes/orders.ts"}'No key. The sandbox graph already holds a real contradiction, so this returns a block naming both authors.
2. CREATE A WORKSPACE AND GET ITS KEY
curl -s -X POST https://trymentat.pages.dev/api/workspaces \
-H 'content-type: application/json' \
-d '{"name":"my-team"}'The response carries a token starting mtk_. It is shown once and never again.
3. CALL YOUR OWN GRAPH
curl -s https://trymentat.pages.dev/api/graph/resolve \
-H "Authorization: Bearer $MENTAT_TOKEN" \
-H 'content-type: application/json' \
-d '{"file_path":"src/routes/orders.ts"}'OR CONNECT AN AGENT INSTEAD
claude mcp add --transport http mentat https://trymentat.pages.dev/mcp \
--header "Authorization: Bearer $MENTAT_TOKEN"API keys
A workspace key is the only credential. Send it as Authorization: Bearer mtk_... on every request to /api/graph, /api/workspaces/me, and /mcp. Only its SHA-256 hash is stored, so a lost key cannot be recovered and the graph it opened is gone with it. That is the price of having no account system.
| Endpoint | Limit | Counted |
|---|---|---|
| POST /api/workspaces | 10 per hour | per IP address |
| /api/demo/* | 120 per minute | per IP address |
| /mcp | 600 per minute | per workspace key, or per IP without one |
A limited request gets HTTP 429 with a JSON body saying which limit it hit. Errors are always { error, message }, and the message is written to be shown to a person.
REST API
Base URL https://trymentat.pages.dev. The OpenAPI document is the reference: every operation has an operationId, typed parameters, and response schemas, so it loads directly into a function-calling agent or a client generator.
PUBLIC, NO KEY
GET /api/health, GET /api/demo/graph, POST /api/demo/resolve, POST /api/demo/derive, GET /api/precedent/ledger, and the anonymised precedent reads. The demo routes run the real pipeline against a fresh copy of the sandbox graph on every call.
YOUR WORKSPACE, WITH A KEY
Read and replace the graph, resolve a path, record and promote decisions, break and monitor assumptions, read the contradiction queue, compile AGENTS.md, and generate CI rules. Extracted decisions always land as proposed: nothing governs a file until a human promotes it.
MCP server
https://trymentat.pages.dev/mcp speaks the Model Context Protocol over Streamable HTTP and is stateless: no session id, every POST answered with one JSON body. Without a key it serves the read-only sandbox graph. The full tool reference is in the docs.
CLI and SDK
The CLI is published on npm as @mentatlabs/cli and runs the same engine offline against a graph committed in your repository. The SDK wraps a hosted workspace in a typed client, or runs the engine in your own process.
CLI
npx -y @mentatlabs/cli initCLI AS A LOCAL MCP SERVER
npx -y @mentatlabs/cli mcpFor agents
Every page on this site answers Accept: text/markdown with Markdown instead of HTML. These are the files an agent should read first.