MimirDocumentationSign in
Documentation

9 agents · all agents

Connect Claude Code

Claude Code talks to Mimir over the Model Context Protocol at https://mimir.johansen.foo/mcp. The token is an API key from Settings → API keys in the Mimir app; export it as MIMIR_TOKEN before starting the agent.

1. Add the server

File: .mcp.json at the repository root

json
{
"mcpServers": {
"mimir": {
"type": "http",
"url": "https://mimir.johansen.foo/mcp",
"headers": {
"Authorization": "Bearer ${MIMIR_TOKEN}"
}
}
}
}

2. Verify

Ask the agent to run memory_tree. It should list the projects your token can see, or nothing at all on a fresh install — either answer proves the connection works.

3. Tell it how to behave

Paste this into the agent's rules or instructions file, once per machine.

text
You have a long-term memory store called Mimir.
At the start of a session, call memory_digest with the current repository to load what is already known.
Before answering a question about this project's conventions, call memory_search with a path_prefix (for example "conventions").
When you learn something durable — a decision, a convention, a gotcha — call memory_write with a path that says where it belongs.
Do not store secrets, tokens or customer data.

Notes

  • Or add it from the CLI: claude mcp add --transport http mimir <your-url>/mcp --header "Authorization: Bearer $MIMIR_TOKEN"
  • Add the session-start hook to inject the project digest when a session begins: point SessionStart at hooks/mimir-session-start.sh (see hooks/README.md).
Claude Code — Mimir