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
Metadata
Release files for mimir-memory-mcp 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mimir_memory_mcp-1.0.0.tar.gz | 644.2 kB | With provenance | Details for mimir_memory_mcp-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mimir_memory_mcp-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for mimir_memory_mcp-1.0.0-py3-none-any.whl |
Total release size: 763.7 kB
Release files / mimir_memory_mcp-1.0.0.tar.gz
| Download URL | mimir_memory_mcp-1.0.0.tar.gz |
|---|---|
| Size | 644.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39edfc6250db5e86c4c09e1d9938832630a3a246e84a2a2aa5ea957cfee95ea6
|
|
BLAKE2b-256 checksum How to use checksums |
be361f3a1d59428c5a7abcfdaa1632c8e61d49b64ae2904ea17257fb36f104bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / mimir_memory_mcp-1.0.0-py3-none-any.whl
| Download URL | mimir_memory_mcp-1.0.0-py3-none-any.whl |
|---|---|
| Size | 119.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f35ad76c28b324d3b530495fdbd4ccc5ae5eb7efc753463ec9003f2efc3e0822
|
|
BLAKE2b-256 checksum How to use checksums |
76b02c46981f5c3385caa0473cde066dad46b3f204b67814fbd4f8bede7e3332
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logSecurity for mimir-memory-mcp 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mimir_memory_mcp-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.