Skip to main content

Mimir

Structured memory server for AI assistants.

Mimir stores what an assistant needs to keep: work (threads, tasks, reminders) and knowledge (rules, facts) anchored to the work it is about. Multi-user, scope-based access control, tiered context loading, keyword search, a full audit trail.

The HTTP API is the contract. The MCP surface is a generated adapter over the same operation registry — every operation exists on both, and neither can quietly grow one the other lacks.

Named after Mímir, the Norse keeper of the Well of Wisdom.

1.0 is a clean break

1.0 does not read a 0.x database. New schema, new API, new database file; the server refuses a pre-1.0 file at boot and names the way across:

mimir-mcp migrate --from ./old-mimir.db --to ./mimir.db

The migration is a one-time move into a new file — dry-runnable, with judgement queues for what does not map cleanly. The 0.x tool names and session lifecycle (start_session, end_session, set_context, …) are gone: nothing opens, closes or resumes — every call carries its own authority, and re-reading replaces remembering.

Quick Start

pip

pip install mimir-memory-mcp
# write seed.sql — your principal, scope, membership (see Provisioning below)
MIMIR_DB_PATH=./mimir.db MIMIR_SEED_FILE=./seed.sql MIMIR_PORT=8100 mimir-mcp

Docker

cp seed.sql.example data/seed.sql   # edit: your principal and scope
docker compose up -d --build        # compose provides MIMIR_DB_PATH and MIMIR_SEED_FILE

scripts/setup.sh walks the same steps with a health check.

From Source

git clone https://github.com/jimmy-larsson/mimir.git
cd mimir
pip install -e ".[dev]"
cp seed.sql.example seed.sql        # edit: your principal and scope
MIMIR_DB_PATH=./mimir.db MIMIR_SEED_FILE=./seed.sql mimir-mcp

Configuration

Environment Variable Default Description
MIMIR_DB_PATH /data/mimir.db SQLite database file path
MIMIR_PORT 8100 HTTP port (both surfaces)
MIMIR_SEED_FILE (unset) SQL file auto-applied at boot while the database has no principals

Provisioning

Identity and credentials are separate things, provisioned separately:

1. Principals, scopes, memberships come from a seed file — see seed.sql.example. No credentials live there: 1.0 stores token hashes, so a plaintext key in a seed file would be a recoverable credential on disk. Auto-applied at boot via MIMIR_SEED_FILE while the database has no principals, or loaded by hand: mimir-mcp seed --file seed.sql.

2. Tokens are minted, never seeded. In the hermes deployment, hermes-template's provisioning does this. Standalone, bootstrap the first token at the domain — point MIMIR_DB at the same file the server runs against (the plaintext is printed once and never recoverable):

MIMIR_DB=./mimir.db python -c "
import os
from mimir_mcp.db import init_db
from mimir_mcp import tokens
db = init_db(os.environ['MIMIR_DB'])
row, plaintext = tokens.mint(db, 'your-user-id', label='console', scopes='*',
                             may_write_rules=True, privileged=True)
print(plaintext)"

Docker: run the same snippet inside the container against the volume — docker compose exec mimir env MIMIR_DB=/data/mimir.db python -c "…".

Every further token is minted over the API (POST /tokens / manage_tokens) with that one. A token is a first-class object: a scope subset, capability limits, individually revocable, rotatable with an overlap window. Authority is always token.scopes ∩ live membership, resolved per request.

The Surface

Five item types — thread · task · reminder · rule · fact. Type carries force (a rule binds, a fact informs), anchors carry reach (knowledge loads with the work it is anchored to).

HTTP (the contract)

Authenticate with x-api-key. Every response carries X-Mimir-API-Version.

Route Operation
GET /orientation T0 — the always-loaded view: rules, unanchored facts, active threads, due reminders, scopes, tags
GET /items/{id}/context T1 drill — the item in full, open children, anchored knowledge, links
GET /items?ids= T2 detail for explicit ids
GET /items Browse by filters (type, status, scope, tag, parent, anchor)
GET /search?q= Keyword search with per-hit matched terms and honest totals
GET /history Audit trail, by item or by conversation
POST /items Create items; anchor knowledge at creation via anchors
PATCH /items/{id} Update fields; explicit null clears
POST /items/resolve Finish work: done, dropped or archived — cascade guarded
DELETE /items Hard delete (privileged), stranded-knowledge guarded
POST /relations · DELETE /relations Anchor, link, blocked_by
POST /items/{id}/log Append a progress note
GET /scopes · POST /scopes · POST|DELETE /scopes/{id}/members Scopes and membership (writes privileged)
POST|GET /tokens · DELETE /tokens/{id} Mint, list, revoke tokens (privileged)
GET /version · GET /health Open probes

MCP Tools (15)

Generated from the same registry; served at http://host:8100/mcp.

Category Tools
Reads orient, open, read_items, find_items, read_history, list_scopes
Writes add_items, update_item, add_log, relate_items, resolve_items, delete_items
Administration manage_scope, manage_tokens
Probe version

Integrating with Claude Code

See docs/integration/claude-code.md. Quick version — add to .mcp.json:

{
  "mcpServers": {
    "mimir": {
      "type": "http",
      "url": "http://localhost:8100/mcp",
      "headers": {
        "x-api-key": "YOUR_TOKEN"
      }
    }
  }
}

Development

pip install -e ".[dev]"
pre-commit install   # installs ruff check/format as a git hook
python -m pytest tests/ -q

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mimir_memory_mcp-1.0.0.tar.gz (644.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mimir_memory_mcp-1.0.0-py3-none-any.whl (119.5 kB view details)

Uploaded Python 3

File details

Details for the file mimir_memory_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: mimir_memory_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 644.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mimir_memory_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 39edfc6250db5e86c4c09e1d9938832630a3a246e84a2a2aa5ea957cfee95ea6
MD5 7014e44f1dcec07b9703e21f40aafc57
BLAKE2b-256 be361f3a1d59428c5a7abcfdaa1632c8e61d49b64ae2904ea17257fb36f104bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mimir_memory_mcp-1.0.0.tar.gz:

Publisher: release.yml on jimmy-larsson/mimir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mimir_memory_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mimir_memory_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f35ad76c28b324d3b530495fdbd4ccc5ae5eb7efc753463ec9003f2efc3e0822
MD5 8eed1ff33cd21361ba31d14178f9dd02
BLAKE2b-256 76b02c46981f5c3385caa0473cde066dad46b3f204b67814fbd4f8bede7e3332

See more details on using hashes here.

Provenance

The following attestation bundles were made for mimir_memory_mcp-1.0.0-py3-none-any.whl:

Publisher: release.yml on jimmy-larsson/mimir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page