project-memory-mcp

project-memory-mcp

Persistent AI knowledge base for Claude via Model Context Protocol — fully offline, no cloud API key required. Stores architectural decisions, technical debt, project progress, and domain knowledge in versioned Markdown files.

Category
访问服务器

README

project-memory-mcp

Persistent AI knowledge base for Claude via Model Context Protocol — fully offline, no cloud API key required.

Stores architectural decisions, technical debt, project progress, and domain knowledge in versioned Markdown files. Claude reads these files automatically via MCP Resources and writes new entries via MCP Tools.

Features

  • 4 MCP Resources — Claude reads memory://decisions, memory://tech-debt, memory://progress, memory://context automatically at session start
  • 7 MCP Toolsadd_decision, log_tech_debt, update_progress, add_context, get_memory, search_memory, reindex_memory
  • Semantic Search — Embedding-based search via @huggingface/transformers (all-MiniLM-L6-v2) stored locally in SQLite
  • Git Hook — Post-commit hook sends diff + message to Ollama for automatic summarization and auto-commits the updated memory files
  • Filesystem Watcher — Changes to CLAUDE.md, docs/adr/, etc. trigger memory updates
  • Session Summary — Inactivity timer writes a session summary to progress.md
  • Ollama Fallback — Keyword extraction when Ollama is unavailable

Prerequisites

  • Node.js >= 20
  • Ollama (optional, for automatic summarization)
ollama pull llama3.2

Installation

In a new project (recommended)

npx @pnientiedt/project-memory-mcp init

This sets up everything automatically:

  • Creates .project-memory/config.yaml with documented defaults
  • Adds project-memory entry to .mcp.json
  • Updates .gitignore with database/log exclusions
  • Installs the git post-commit hook
  • Pulls llama3.2 if Ollama is running

From source

npm install
npm run build

Register the MCP server in Claude Code (.mcp.json already pre-configured):

{
  "mcpServers": {
    "project-memory": {
      "command": "npx",
      "args": ["@pnientiedt/project-memory-mcp"]
    }
  }
}

Usage

After startup Claude reads the memory files automatically. New entries are written via tools:

add_decision    — Save an architectural decision (ADR format); upsert=true to replace existing
log_tech_debt   — Record technical debt; upsert=true to replace existing
update_progress — Update a milestone; upsert=true to replace existing
add_context     — Save domain knowledge / conventions; upsert=true to replace existing
get_memory      — Read a memory file directly
search_memory   — Semantic search across the knowledge base
reindex_memory  — Rebuild the embedding index

Configuration

.project-memory/config.yaml (created with defaults on first run):

ollama:
  base_url: "http://localhost:11434"
  model: "llama3.2"
  timeout_seconds: 60
  fallback_to_keywords: true

embeddings:
  model: "Xenova/all-MiniLM-L6-v2"
  db_path: ".project-memory/embeddings.db"

git:
  hook_enabled: true
  hook_port: 47832
  skip_keyword: "[skip-memory]"

watcher:
  enabled: true
  paths: ["CLAUDE.md", "docs/adr/", "README.md"]
  debounce_ms: 2000

session:
  inactivity_timeout_minutes: 30
  summarize_on_end: true

Environment variables override config:

Variable Overrides
PMM_OLLAMA_URL ollama.base_url
PMM_OLLAMA_MODEL ollama.model
PMM_HOOK_PORT git.hook_port
PMM_LOG_LEVEL logging.level

Memory Files

Located in .project-memory/ and versioned in git (except embeddings.db and server.log):

File Contents
decisions.md Architectural decisions (ADRs)
tech_debt.md Technical debt
progress.md Project progress & session summaries
context.md Domain knowledge & conventions

Development

npm test              # Run tests (101 tests)
npm run test:coverage # Coverage report (83% line coverage)
npm run build         # Compile TypeScript
npm run typecheck     # Type check only
npm run release       # typecheck + test + build + npm publish

Project Structure

src/
  index.ts              # Entry point, stdio transport
  server.ts             # MCP server factory
  config.ts             # Load & validate configuration (zod)
  types.ts              # Shared TypeScript types
  resources/
    memory.ts           # MCP resources (memory://)
  tools/
    write.ts            # add_decision, log_tech_debt, update_progress, add_context
    read.ts             # get_memory, search_memory
    admin.ts            # reindex_memory
  services/
    file.ts             # Atomic read/write of memory files
    embedding.ts        # transformers.js + cosine similarity
    db.ts               # SQLite schema (WAL mode)
    ollama.ts           # Ollama HTTP client + keyword fallback
    summarization.ts    # Prompts per memory category
    git.ts              # simple-git integration
  triggers/
    git-hook.ts         # HTTP server for post-commit hook
    watcher.ts          # Filesystem watcher (chokidar)
    session.ts          # Inactivity timer & session summary
hooks/
  post-commit           # Shell script for git hook

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选