MCP endpoint
Mimir speaks MCP over HTTP at /mcp. It is stateless: every request carries its own token, so a stock reverse proxy works without SSE configuration.
Two values
bash
MIMIR_URL=https://mimir.example.comMIMIR_TOKEN=mimir_... # mint one under Settings → API keysRepository header
Send X-Mimir-Repo: github.com/owner/repo so the agent lands in the same project another agent created yesterday. Without it, pass repo or project as a tool argument. A server never sees a working directory, so the client is the only thing that can compute this.
Raw HTTP
MCP here is JSON-RPC 2.0 over a plain POST. A client library hides this, but seeing it once makes debugging a token or a header much quicker.
bash
curl -s "$MIMIR_URL/mcp" \ -H "Authorization: Bearer $MIMIR_TOKEN" \ -H "Content-Type: application/json" \ -H "X-Mimir-Repo: github.com/owner/repo" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "memory_search", "arguments": { "query": "token rotation", "path_prefix": "auth" } } }'json
{ "jsonrpc": "2.0", "id": 1, "result": { "results": [ { "path": "auth/token-rotation", "title": "Rotating the API token", "summary": "Rotate in the admin panel, then redeploy.", "score": 0.0328 } ], "content": [{ "type": "text", "text": "[{\"path\":\"auth/token-rotation\",…}]" }], "isError": false }}initializeanswers with protocol version2025-06-18andtools.listChanged: false;pinganswers with an empty result.tools/listreturns each tool’s name, description and JSON schema. No token scope narrows the list; a grant narrows what a call may touch.- A tool result carries the payload twice: as fields on
resultfor a script, and ascontent[0].textfor a standard MCP client. - A failed call is a JSON-RPC error with a service code in
error.data.code, and still writes one audit row. An expired token is HTTP 401 with{"jsonrpc":"2.0","id":null,"error":{…}}; a rate limit is 429 withRetry-After.
Tools
| Tool | Purpose |
|---|---|
| memory_tree | List a project’s paths with their one-line titles. |
| memory_read | Read one memory at L0, L1 or L2. |
| memory_search | Hybrid search, optionally scoped to a path prefix. |
| memory_digest | A budgeted session-start digest of the project. |
| memory_write | Create or replace a memory. |
| memory_ingest | Import a batch of files as memories. |
| memory_delete | Soft-delete a memory. |
| project_list | List the projects you can reach. |
What to tell the agent
- Call
memory_digestonce at the start of a session, thenmemory_searchbefore re-deriving something the project already knows. - Call
memory_writewhen you learn something durable: a convention, a gotcha, a decision and its reason. Not a log of what you just did. - Keep paths stable. One path is one memory; writing it again replaces the body.
Per-agent configuration lives under Agents in the sidebar.