MimirDocumentationSign in
Documentation

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.com
MIMIR_TOKEN=mimir_... # mint one under Settings → API keys

Repository 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
}
}
  • initialize answers with protocol version 2025-06-18 and tools.listChanged: false; ping answers with an empty result.
  • tools/list returns 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 result for a script, and as content[0].text for 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 with Retry-After.

Tools

ToolPurpose
memory_treeList a project’s paths with their one-line titles.
memory_readRead one memory at L0, L1 or L2.
memory_searchHybrid search, optionally scoped to a path prefix.
memory_digestA budgeted session-start digest of the project.
memory_writeCreate or replace a memory.
memory_ingestImport a batch of files as memories.
memory_deleteSoft-delete a memory.
project_listList the projects you can reach.

What to tell the agent

  • Call memory_digest once at the start of a session, then memory_search before re-deriving something the project already knows.
  • Call memory_write when 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.

MCP endpoint