Skip to main content

Use cases

Long-term memory for a coding agent

Connect the coding agent to Mirabase over MCP with one command. It then reads what is already known before a task, and saves documents as files and lasting statements as memories, so the next session starts from them.

Last updated Markdown

Set it up

  1. Sign in to the console and create an API key. Give the agent a key of its own, not your root key: see Set up an Agent.
  2. Add the MCP server.
export MIRABASE_API_KEY="mb_live_..."

# Claude Code
claude mcp add --transport http mirabase https://api.mirabase.io/mcp \
  --header "Authorization: Bearer $MIRABASE_API_KEY"

# Codex
codex mcp add mirabase --url https://api.mirabase.io/mcp \
  --bearer-token-env-var MIRABASE_API_KEY
  1. Check the key.
curl https://api.mirabase.io/v2/whoami \
  -H "Authorization: Bearer $MIRABASE_API_KEY"

The response lists the key's capabilities and the Spaces it can read and write. Any other MCP client that supports Streamable HTTP and can send a header connects the same way: see Connect an Agent.

What the agent does with it

WhenToolEffect
Before a taskmira.contextReturns a pack of relevant files and memories within a token budget
Looking for something specificmira.searchReturns passages that match by words and by meaning
Saving a document, notes or a planmira.files.writeWrites a file at a path; every write keeps a version
Recording a statement that stays truemira.memory.rememberStores a memory, such as a decision or a preference
Fixing a wrong memorymira.memory.correctReplaces the memory and keeps the old statement as history

The server tells the model what each tool is for in the instructions of its handshake. The recommended order is in Recommended call order.

Limits

  • https://api.mirabase.io/mcp/lean offers six tools for agents that only need memory and files. See Toolsets.
  • Writing a project memory requires the memory:confirm capability. Without it, use files, or ask the Space owner to grant it.
  • mira.memory.forget erases a memory permanently. Use mira.memory.correct to fix one.
  • A tool call counts as two requests against the rate limit: the MCP call and the API request it makes.
  • An agent that changes a file it does not own creates a proposal for review unless the Space owner has set its write mode to direct. See Agent write mode.