Project Memory MCP

Project Memory MCP

Provides AI-driven project memory management through structured prompts that help Claude parse tasks from specs, review code changes, sync with commit history, and maintain project documentation without directly accessing files.

Category
访问服务器

README

Project Memory MCP

A Model Context Protocol (MCP) server that provides AI-driven project memory management through structured prompts. This server acts as a pure prompt provider - it never touches your files directly. Instead, it returns instructions for Claude to execute using its standard tools.

What is This?

project-memory-mcp helps Claude manage your project context by:

  • Parsing tasks from specs and implementation plans
  • Reviewing code before commits
  • Syncing project memory with commit history
  • Maintaining project documentation (architecture, conventions, commands)

All operations are performed by Claude using its Read, Write, Edit, and Bash tools after getting your approval.

Key Features

Pure prompt provider - No file access, only returns instructions ✅ Interface-agnostic - Works with Claude Desktop, Claude Code CLI, or custom clients ✅ No API costs - Uses your existing Claude subscription ✅ User approval required - Claude asks before making any changes ✅ Project-specific prompts - Customized during initialization for your stack ✅ 200-line limit - Prevents context bloat

Installation

Install globally from GitHub:

npm install -g git+https://github.com/misaamane21j/project-memory-mcp.git

Setup

Configure MCP in Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "project-memory": {
      "command": "project-memory-mcp"
    }
  }
}

Configure MCP in Claude Code CLI

Add to your MCP settings (~/.config/claude/mcp_settings.json):

{
  "mcpServers": {
    "project-memory": {
      "command": "project-memory-mcp"
    }
  }
}

Restart Claude

Restart Claude Desktop or Claude Code CLI to load the MCP server.

Usage

Initialize Project Memory

In your project directory, ask Claude:

"Initialize project memory"

Claude will:

  1. Create .project-memory/ folder structure
  2. Analyze your project (language, frameworks, structure, conventions)
  3. Generate and customize project-specific prompts (base.md, parse-tasks.md, review.md, sync.md)
  4. Populate initial documentation files (architecture.md, conventions.md, useful-commands.md) with detected project info
  5. Add minimal IMPORTANT reference to claude.md

Important: Each prompt file is limited to ≤ 200 lines to prevent context bloat.

Parse Tasks from Specs

Add a spec file to .project-memory/specs/feature-name.md, then ask Claude:

"Parse tasks from the spec"

Claude will:

  1. Read the spec file
  2. Extract tasks with IDs, descriptions, acceptance criteria, dependencies
  3. Show you the parsed tasks
  4. After approval, add them to .project-memory/tasks/tasks-active.json

Review Code Before Committing

Before committing, ask Claude:

"Review my changes"

Claude will:

  1. Get git diff and git diff --cached
  2. Read current tasks and architecture
  3. Analyze code for issues
  4. Propose task status updates
  5. After approval, update project memory

Sync After Commits

After committing, ask Claude:

"Sync project memory"

Claude will:

  1. Get recent commit history
  2. Determine completed tasks
  3. Update commit log (last 20 commits)
  4. Update architecture if changed
  5. After approval, apply updates

Organize Existing CLAUDE.md

For existing projects with verbose CLAUDE.md files, ask Claude:

"Organize my CLAUDE.md into project memory"

Claude will:

  1. Read and analyze your CLAUDE.md
  2. Identify sections: architecture, conventions, commands, tasks, specs
  3. Show migration plan with line numbers
  4. After approval, migrate content to .project-memory/ files
  5. Replace verbose sections with minimal references in CLAUDE.md

Example migration:

  • Architecture (75 lines) → .project-memory/architecture.md
  • Conventions (60 lines) → .project-memory/conventions.md
  • Commands (30 lines) → .project-memory/useful-commands.md
  • Tasks → .project-memory/tasks/tasks-active.json
  • Specs → .project-memory/specs/*.md

Result: CLAUDE.md stays clean with just references, detailed content lives in organized files.

Proactive Prompting

After initialization, Claude will automatically prompt you:

  • When you provide a spec: "Would you like me to parse tasks?"
  • Before commits: "Would you like me to review your changes?"
  • After commits: "Would you like me to sync project memory?"
  • Session start: Check for pending reviews/syncs

Project Structure

After initialization, your project will have:

.project-memory/
├── tasks/
│   ├── tasks-active.json       # Active and in-progress tasks
│   └── tasks-completed.json    # Completed tasks
├── specs/
│   └── *.md                    # Immutable spec files (you create these)
├── prompts/
│   ├── base.md                 # Core instructions (≤200 lines)
│   ├── parse-tasks.md          # Task parsing workflow (≤200 lines)
│   ├── review.md               # Code review workflow (≤200 lines)
│   ├── sync.md                 # Post-commit sync workflow (≤200 lines)
│   └── languages/              # Optional language-specific extensions
├── architecture.md             # Project architecture docs
├── conventions.md              # Coding conventions
├── useful-commands.md          # Common commands
└── commit-log.md               # Last 20 commits

Task Schema

Tasks follow this structure:

{
  "id": "TASK-001",
  "title": "Brief description",
  "description": "Detailed description",
  "status": "pending | in_progress | completed",
  "priority": "low | medium | high | critical",
  "acceptanceCriteria": ["criterion 1", "criterion 2"],
  "dependencies": ["TASK-000"],
  "subtasks": [
    {
      "id": "TASK-001-1",
      "title": "Sub-task title",
      "status": "pending",
      "acceptanceCriteria": ["optional"]
    }
  ],
  "specReference": "specs/feature-auth.md",
  "complexity": "simple | moderate | complex",
  "createdAt": "2025-01-15T10:00:00Z",
  "updatedAt": "2025-01-16T14:30:00Z",
  "completedAt": null
}

MCP Tools

The server exposes 5 tools (all return prompts only):

init

Initialize project memory system. Run once per project.

parse-tasks

Parse tasks from spec files or implementation plans.

review

Review uncommitted code changes against project context.

sync

Sync project memory with recent commits.

organize

Organize existing CLAUDE.md into project-memory structure. Migrates architecture, conventions, commands, tasks, and specs from verbose CLAUDE.md to organized files.

How It Works

┌─────────────────────────────────────┐
│ Claude (your subscription)          │
│ - Analyzes prompts                  │
│ - Uses Read/Write/Edit/Bash tools   │
│ - Asks for user approval            │
└──────────────┬──────────────────────┘
               │ MCP protocol
               ▼
┌─────────────────────────────────────┐
│ project-memory-mcp Server           │
│ - Returns prompt text only          │
│ - NO file operations                │
│ - NO git commands                   │
└─────────────────────────────────────┘

Architecture Principles

  1. MCP is a pure prompt provider

    • Only returns text instructions
    • Never reads/writes project files
    • Never executes git commands
  2. Claude does all the work

    • Uses standard tools (Read, Write, Edit, Bash)
    • User sees all operations
    • Requires approval via AskUserQuestion
  3. Project-specific customization

    • Prompts tailored to your tech stack
    • Language-specific guidelines
    • Framework conventions
  4. 200-line limit per prompt

    • Prevents context bloat
    • Keeps prompts focused
    • Enforced during init

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run watch

# Run tests
npm test

# Lint
npm run lint

# Format
npm run format

Testing

Run the test suite:

npm test

Tests cover:

  • Prompt length validation (200-line limit)
  • Prompt composition
  • Edge cases

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT

Links

Support

For issues, questions, or feedback:


Note: This MCP server requires Claude Desktop, Claude Code CLI, or another MCP-compatible client to function.

推荐服务器

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

官方
精选