What is MCP?

The Model Context Protocol (MCP) is a standard for AI agent communication. Memento provides an MCP server with 16 tools that AI agents can use to manage persistent memory.

Available Tools

Tool Description
mem_save Save an observation
mem_search Search observations (FTS5)
mem_get_observation Get full observation by ID
mem_update Update an existing observation
mem_delete Delete/restore/purge observations
mem_context Get recent context for recovery
mem_session_start Start a new session
mem_session_end End current session
mem_session_summary Create end-of-session summary
mem_capture_passive Parse text for learnings
mem_timeline Chronological observation list
mem_status System diagnostics
mem_merge Merge related observations
mem_export Export observations (JSON/XML/TXT)
mem_lock / mem_unlock Lock/unlock observations
mem_pin / mem_unpin Pin/unpin for system prompt injection

Configuration

Claude Code

Add to your Claude Code MCP config (.claude/claude_desktop_config.json or project .mcp.json):

{
  "mcpServers": {
    "memento": {
      "command": "memento-mcp"
    }
  }
}

Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "memento": {
      "command": "memento-mcp"
    }
  }
}

OpenCode

Add to your OpenCode config (.opencode.json):

{
  "mcpServers": {
    "memento": {
      "command": "memento-mcp"
    }
  }
}

Usage Patterns

Session Workflow

The recommended workflow for AI agents:

1. mem_session_start(project: "my-app")
2. mem_context() — recover previous context
3. ... do work, save observations ...
4. mem_session_summary() — persist session summary
5. mem_session_end() — close session

Saving Observations

// Decision
mem_save({
  title: "Chose Zustand over Redux",
  type: "decision",
  content: "What: Using Zustand for state management\nWhy: Simpler API, less boilerplate",
  topic_key: "architecture/state-management",
  project: "my-app"
})

// Bug fix
mem_save({
  title: "Fixed N+1 in UserList",
  type: "bug",
  content: "What: Added batch loading for user profiles\nWhy: N+1 query causing 5s load time",
  topic_key: "bugfix/n1-userlist",
  project: "my-app"
})

Searching Memory

// Full-text search
mem_search({ query: "database choice" })

// Filter by type and project
mem_search({ query: "auth", type: "decision", project: "my-app" })

Tips

  • Always start a session — observations are grouped by session for context recovery
  • Use topic keys — stable keys like architecture/auth-model enable grouping and merging
  • Save proactively — don't wait to be asked. Save decisions, bugs, and discoveries immediately
  • Use mem_session_summary at session close — this persists what was done for next session