Context Memory MCP Server

Context Memory MCP Server

Tracks mistakes and solutions from past Claude sessions to avoid repeating failed approaches.

Category
访问服务器

README

Context Memory MCP Server

An MCP server for tracking mistakes and solutions. Don't repeat what failed.

What This Is

Context Memory is a simple tool that helps Claude learn from your past sessions. It stores two things:

  1. Mistakes - approaches that failed and why
  2. Solutions - problems you solved and how

Before trying something, Claude can check if you've been down that road before. After solving something tricky, you can save it for next time.

Why This Exists

The Original Problem (2025)

When this project started, Claude Code had a significant limitation: conversation compression. As context windows filled up, Claude would compress older messages to make room. This meant losing valuable context:

  • Why you chose one approach over another
  • Edge cases you discovered along the way
  • Failed attempts and what broke
  • Handoff context between specialized agents

The original v0.x built an elaborate system to preserve all of this: notes, file decisions, agent handoffs, problem caches, session management. It worked, but it was complex.

What Changed

Claude Code got smarter. A lot smarter.

The compression that once destroyed context now preserves what matters. Claude maintains its own understanding of the conversation, the codebase, and the decisions being made. Most of what v0.x did became redundant—Claude handles it natively now.

But one thing Claude still can't do: learn from sessions it wasn't part of.

If you spent two hours debugging an authentication issue last week, and hit the same issue today in a new session, Claude starts from zero. It will suggest the same failed approaches. It doesn't know what you already tried.

The v1.0 Refocus

Version 1.0 strips away everything Claude now handles itself and focuses on the one remaining gap: cross-session learning from failures.

The API went from 8+ tools to 4:

Tool Purpose
mistake Record what you tried and why it failed
learned Save a problem/solution pair that worked
recall Search for relevant past context
promote Export important learnings to CLAUDE.md

That's it. Simple, focused, useful.

Installation

Claude Code CLI

Add to your project's .mcp.json:

{
  "mcpServers": {
    "context-memory": {
      "command": "npx",
      "args": ["-y", "github:Dithilli/context-memory-mcp"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "context-memory": {
      "command": "npx",
      "args": ["-y", "github:Dithilli/context-memory-mcp"]
    }
  }
}

Tools

mistake

Record an approach that didn't work.

{
  "what": "Tried using localStorage for auth tokens",
  "why_failed": "XSS vulnerability - any script can read localStorage",
  "tags": ["security", "auth"],
  "files": ["src/auth/storage.ts"]
}

learned

Save a problem/solution pair.

{
  "problem": "Supabase RLS returns empty array instead of 401",
  "solution": "Add explicit auth check before query - RLS fails silently",
  "tags": ["supabase", "auth"]
}

recall

Search past mistakes and solutions.

{
  "query": "authentication",
  "tags": ["security"],
  "limit": 10
}

promote

Export a learning to CLAUDE.md for permanent reference.

{
  "id": "solution-123",
  "type": "solution"
}

Storage

Data is stored in ~/.context-memory/ by default:

  • mistakes.jsonl - Failed approaches
  • solutions.jsonl - Working solutions

Custom Location

Use --storage-dir for per-project or custom storage:

{
  "mcpServers": {
    "context-memory": {
      "command": "npx",
      "args": [
        "-y",
        "github:Dithilli/context-memory-mcp",
        "--storage-dir",
        ".context-memory"
      ]
    }
  }
}

Project Auto-Detection

The server automatically detects your project from the git root, so mistakes and solutions are tagged with project context without manual configuration.

When to Use This

Do use it for:

  • "We tried X, it failed because Y" - saves hours of repeated debugging
  • Tricky solutions that aren't obvious from the code
  • Patterns that apply across projects

Don't use it for:

  • General notes (Claude remembers within a session)
  • Implementation details (that's what git history is for)
  • Obvious things (trust Claude to figure those out)

Migration from v0.x

If you have data from v0.x, the server will automatically migrate it on first run:

  • Old notes.jsonl entries become mistakes
  • Old problems.jsonl entries become solutions
  • Handoffs and file decisions are archived (no longer needed)

Changelog

v1.0.0 (2026-01-23)

  • Breaking change: Simplified API to four tools: mistake, learned, recall, promote
  • Added project auto-detection from git root
  • Added promote tool to export learnings to CLAUDE.md
  • Automatic migration from v0.x data format
  • Removed handoffs, notes, and file decisions (Claude Code handles these natively now)

v0.2.0 (2025-01-12)

  • Added configurable storage directory (--storage-dir option)
  • Support for per-project storage

v0.1.0 (2025-01-12)

  • Initial release with full context preservation system

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选