Memoir MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add memoir-mcp -- npx -y memoir-mcp
README.md

Structured session journals for AI agents.

memoir-mcp

Structured session journals for AI agents. Persistent memory across sessions -- no more repeating dead ends.

When a session ends, all reasoning is lost -- what was tried, what failed, what's blocked. The next session starts from scratch and repeats the same mistakes. memoir logs it all and hands it off so the next session picks up where the last one left off.

Works with any MCP client: Claude Code, Cursor, Codex, Windsurf, and more.

Install

Claude Code

claude mcp add memoir -s user -- npx -y memoir-mcp

Other MCP clients

npx -y memoir-mcp

How it works

  • Automatic project detection -- identifies the project by its git root, so logs stay scoped without any configuration.
  • Implicit sessions -- a session is created automatically on first log. No setup step.
  • Rolling retention -- keeps the last 20 sessions per project (configurable). Old sessions are pruned automatically.

Tools

Write

Tool Description
log_attempt Record something that was tried and its outcome.
log_blocker Flag something that's stuck and why.
resolve_blocker Mark a blocker as resolved with what fixed it.
log_decision Record a design or architecture choice and its rationale.
end_session Close the current session with an optional summary.

Read

Tool Description
get_handoff Structured summary of the last session -- what was attempted, what's blocked, what was decided.
get_history Query past sessions (default: last 3, max 20).
get_blockers List unresolved (or resolved) blockers across all sessions.

Storage

Single SQLite file at ~/.memoir/memoir.db. No API keys, no external services.

Configuration

All limits are configurable via environment variables:

Variable Default Description
MEMOIR_MAX_CONTENT 500 Max characters for content fields
MEMOIR_MAX_OUTCOME 300 Max characters for outcome/resolution fields
MEMOIR_MAX_ENTRIES 50 Max entries per session
MEMOIR_MAX_SESSIONS 20 Max sessions per project (rolling)

Example with custom limits:

claude mcp add memoir -s user -e MEMOIR_MAX_CONTENT=1000 -e MEMOIR_MAX_ENTRIES=100 -- npx -y memoir-mcp

Handoff output uses a compact format to keep context window usage low.

License

MIT

Tools (8)

log_attemptRecord something that was tried and its outcome.
log_blockerFlag something that's stuck and why.
resolve_blockerMark a blocker as resolved with what fixed it.
log_decisionRecord a design or architecture choice and its rationale.
end_sessionClose the current session with an optional summary.
get_handoffStructured summary of the last session.
get_historyQuery past sessions.
get_blockersList unresolved or resolved blockers across all sessions.

Environment Variables

MEMOIR_MAX_CONTENTMax characters for content fields
MEMOIR_MAX_OUTCOMEMax characters for outcome/resolution fields
MEMOIR_MAX_ENTRIESMax entries per session
MEMOIR_MAX_SESSIONSMax sessions per project

Configuration

claude_desktop_config.json
{"mcpServers": {"memoir": {"command": "npx", "args": ["-y", "memoir-mcp"], "env": {"MEMOIR_MAX_SESSIONS": "20"}}}}

Try it

Log that I attempted to refactor the authentication module but it caused a circular dependency.
What were the blockers identified in the last session?
Record a decision to use PostgreSQL instead of SQLite for the production database due to scalability requirements.
Get the handoff summary from my previous session to see where I left off.
End the current session and summarize the progress made on the API integration.

Frequently Asked Questions

What are the key features of Memoir MCP?

Automatic project detection via git root. Implicit session creation without manual setup. Rolling retention of the last 20 sessions. Persistent local storage using SQLite. Structured logging for attempts, blockers, and decisions.

What can I use Memoir MCP for?

Maintaining context across long-running coding tasks. Tracking architectural decisions and their rationale for future reference. Managing blockers in complex debugging sessions. Handing off progress between different AI agent sessions.

How do I install Memoir MCP?

Install Memoir MCP by running: claude mcp add memoir -s user -- npx -y memoir-mcp

What MCP clients work with Memoir MCP?

Memoir MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Memoir MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare