MCP Project Context Server

MCP Project Context Server

A persistent memory layer for Claude Code that maintains project information, technology stack, tasks, decisions, and session history between coding sessions, eliminating the need to re-explain project context.

Category
访问服务器

README

MCP Project Context Server

A Model Context Protocol (MCP) server that provides persistent project context and planning state between Claude Code sessions. This eliminates the need to re-explain project details, current status, and development context every time you start a new coding session.

What It Does

The MCP Project Context Server acts as a persistent memory layer for your development projects, maintaining:

  • Project Information: Name, description, current phase, and status
  • Technology Stack: Frontend, backend, database, infrastructure, and tooling choices
  • Task Management: Development tasks with priorities, status tracking, and dependencies
  • Decision History: Architectural and technical decisions with reasoning
  • Session Continuity: Goals, achievements, and blockers from previous sessions
  • Development Notes: Important observations and insights

How It Works

The server implements the Model Context Protocol to provide Claude Code with tools for managing project context:

  1. Project Creation: Initialize new projects with tech stack and current phase
  2. Context Retrieval: Get comprehensive project state and history
  3. Task Management: Create, update, and track development tasks
  4. Decision Recording: Document important technical and architectural decisions
  5. Session Tracking: Maintain continuity between development sessions
  6. Note Taking: Capture important insights and observations

Data is stored as JSON files in a local data directory, making it easy to backup, version control, or inspect manually.

Key Features

  • Persistent Context: Project state survives between Claude Code sessions
  • Technology Stack Awareness: Tracks your preferred technologies and tools
  • Task Prioritization: Organize work with priority levels and status tracking
  • Decision Documentation: Maintain architectural decision records (ADRs)
  • Session Goals: Track what you planned vs what you achieved
  • File-Based Storage: Simple JSON storage that's easy to understand and backup

Prerequisites

  • Node.js 18 or higher
  • pnpm package manager
  • Claude Code CLI tool

Installation

  1. Clone and setup the project:
git clone <repository-url>
cd mcp-project-context
pnpm install
  1. Build the server:
pnpm run build
  1. Make the server executable:
chmod +x dist/index.js

Configuration

Claude Code Setup

  1. Create or edit the Claude Code MCP configuration file:
mkdir -p ~/.claude
  1. Add your server configuration to `~/.claude.json:
{
    "mcpServers": {
      "mcp-project-context": {
        "type": "stdio",
        "command": "/path/to/mcp-project-context/dist/index.js",
        "args": [],
        "env": {}
      }
    }
}

Replace /absolute/path/to/your/mcp-project-context with the actual path to your project directory.

  1. Verify the configuration:
cat ~/.claude/mcp.json

Usage

Once configured, Claude Code will automatically start and connect to your MCP server. You can then use natural language to interact with your project context:

Example Commands

Create a new project:

"Create a new project called 'E-commerce Platform' for building a modern online store using Next.js, Node.js, PostgreSQL, and Docker"

Get current project status:

"What's the current status of my project? Where did we leave off?"

Add development tasks:

"Add a high-priority task to implement user authentication with OAuth"

Record architectural decisions:

"Record that we decided to use Prisma as our ORM because it provides better TypeScript support and easier migrations"

Update task status:

"Mark the authentication task as completed"

Add project notes:

"Add a note that the API rate limiting is causing issues in development"

Available Tools

The server provides these tools to Claude Code:

  • create_project - Initialize a new project with tech stack and description
  • get_project_context - Retrieve comprehensive project state and history
  • list_projects - Show all projects ordered by last access
  • add_task - Create new development tasks with priorities
  • update_task - Modify task status, priority, or details
  • add_note - Capture important observations and insights
  • record_decision - Document architectural and technical decisions
  • start_session - Begin a development session with specific goals

Data Storage

Project data is stored in the data directory:

data/
├── projects/
│   ├── project-uuid-1.json
│   ├── project-uuid-2.json
│   └── project-uuid-3.json
└── sessions/
    ├── session-uuid-1.json
    ├── session-uuid-2.json
    └── session-uuid-3.json

Each file contains structured JSON data that you can inspect or backup as needed.

Development

Project Structure

mcp-project-context/
├── src/
│   ├── index.ts              # Entry point
│   ├── server.ts             # MCP server implementation
│   ├── storage/
│   │   ├── project-store.ts  # File-based storage layer
│   │   └── context-manager.ts # Context management logic
│   └── types/
│       └── project-types.ts  # TypeScript type definitions
├── data/                     # Project data storage
├── package.json
├── tsconfig.json
└── README.md

Available Scripts

  • pnpm run build - Compile TypeScript to JavaScript
  • pnpm run start - Run the compiled server
  • pnpm run dev - Run in development mode with auto-reload

Testing the Server

You can test the server manually:

# Start the server directly
node dist/index.js

# The server will wait for MCP protocol messages via stdin

For interactive testing, use the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Troubleshooting

Server Connection Issues

  1. Verify the server builds successfully:
pnpm run build
  1. Check that the executable bit is set:
ls -la dist/index.js
chmod +x dist/index.js
  1. Test the server manually:
node dist/index.js
  1. Verify Claude Code configuration:
cat ~/.claude/mcp.json

Data Directory Issues

If you encounter permission errors, ensure the data directory exists and is writable:

mkdir -p data/projects data/sessions
chmod -R 755 data/

Claude Code Logs

Check Claude Code logs for connection issues:

# The server logs errors to stderr, which Claude Code captures
# Check your terminal output when starting Claude Code

Privacy and Data

  • All project data is stored locally on your machine
  • No data is transmitted to external services
  • JSON files can be easily backed up or version controlled
  • Each developer/machine maintains separate project contexts

Contributing

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

License

MIT License - see LICENSE file for details

Support

For issues related to:

推荐服务器

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

官方
精选