MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

M
MCP Project Context

๐Ÿง  Advanced MCP server that gives Claude Desktop project-aware capabilities. Features include auto-discovery, Git integration, hierarchical memory, file watching, and CLAUDE.md instruction support.

Created 9/4/2025
Updated 3 days ago
Repository documentation and setup instructions

MCP Project Context Manager

A powerful Model Context Protocol (MCP) server that provides Claude Desktop with Claude Code-like project context management, file-based persistent memory, and comprehensive search capabilities.

๐Ÿš€ Key Features

๐Ÿง  File-Based Memory System (Claude Code-like)

  • Hierarchical CLAUDE.md files for persistent memory storage
  • Always in context - no search required, memories are immediately available
  • @import system for including external files
  • Memory hierarchy: Enterprise > Project > User > Local

๐Ÿ” Enhanced Search Capabilities

  • Search ALL text files - not just code files
  • Includes: .md, .json, .yaml, .xml, .env, .txt, .log, .csv, .html, .css, .svg
  • Advanced pattern matching with regex support
  • Context lines for better understanding
  • Symbol search across multiple languages
  • TODO/FIXME comment tracking

๐Ÿ“ Smart Working Directory Detection

  • Automatic project root detection - handles Claude Desktop's exe folder issue
  • Environment variable support (PROJECT_ROOT)
  • Git repository detection
  • Automatic process.chdir() to correct directory

๐Ÿ›  Comprehensive Tool Set

  • File Operations: read, write, edit, delete, move, create directories
  • Multi-file Operations: read multiple files simultaneously
  • Git Integration: status, diff, add, commit
  • Search Tools: code search, symbol search, TODO search
  • Memory Management: add memories, list recent memories, reload memories

๐Ÿ“ฆ Installation

  1. Clone the repository:
cd C:\
git clone <repository-url> mcp-project-context
cd mcp-project-context
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

โš™๏ธ Configuration

Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "project-context": {
      "command": "node",
      "args": ["C:\\mcp-project-context\\dist\\enhancedIndex.js"],
      "env": {
        "PROJECT_ROOT": "C:\\your-project-directory",
        "NODE_ENV": "production"
      }
    }
  }
}

Configuration Notes:

  • PROJECT_ROOT: Specify your project directory (tool auto-detects if not set)
  • enhancedIndex.js: The enhanced version with all new features
  • Tool automatically handles working directory issues

๐Ÿ“ CLAUDE.md Memory System

Create CLAUDE.md files in your project for persistent memory:

Root CLAUDE.md Example

# Project Memory

## Project Standards
- Use TypeScript with strict mode
- Follow ESLint configuration
- Write tests for all features

## Architecture Notes
- Frontend: React + TypeScript
- Backend: Node.js + Express
- Database: PostgreSQL

## Recent Decisions
- 2025-01-07: Migrated to file-based memory system
- 2025-01-06: Added WebRTC for video chat

@import ./docs/API.md
@import ./docs/DATABASE.md

Memory Hierarchy

  1. Enterprise: C:\CLAUDE.md - Organization-wide knowledge
  2. Project: C:\project\CLAUDE.md - Project-specific information
  3. User: %USERPROFILE%\CLAUDE.md - Personal preferences
  4. Local: .\CLAUDE.md - Current directory context

๐Ÿ”ง Available Tools

File Operations

  • read_file - Read single file
  • read_multiple_files - Read multiple files at once
  • write_file - Write content to file
  • edit_file - ENHANCED Smart text replacement with 5 strategies
    • EXACT: Traditional exact match (default)
    • FUZZY: Handles whitespace/formatting differences
    • SECTION: Edit between headers (perfect for markdown/docs)
    • LINES: Edit specific line ranges
    • PATTERN: Regex-based replacements
    • BETWEEN: Edit content between markers
  • delete_file - Delete files
  • move_file - Move or rename files
  • create_directory - Create new directories
  • list_directory - List directory contents

Search Tools (Enhanced)

  • search_code - Search in ALL text files (not just code)
    • Pattern matching (text or regex)
    • File type filtering
    • Context lines
    • Gitignore respect
  • search_symbols - Find function/class definitions
  • search_todos - Find TODO/FIXME/NOTE comments

Git Operations

  • git_status - Check repository status
  • git_diff - View changes
  • git_add - Stage files
  • git_commit - Create commits

Memory & Context

  • get_context - Get project context with memory
  • add_memory - Add to CLAUDE.md
  • add_quick_memory - Quick note (like # in Claude Code)
  • list_recent_memories - Show recent memory entries
  • get_memory_status - Check memory file status
  • reload_memories - Reload if edited externally

๐Ÿ’ก Usage Examples

Adding Memory

// Add important project decision
add_memory("Decided to use WebSockets for real-time updates", ["architecture", "websocket"])

Enhanced Search

// Search in ALL files including configs, docs, etc.
search_code({
  pattern: "API_KEY",
  contextLines: 2
})
// Now finds matches in .env, .json, .yaml, etc.!

Smart Edit Examples

// 1. FUZZY - Handles whitespace differences
edit_file("README.md", "## Configuration", "## Setup", { 
  strategy: "fuzzy" 
})

// 2. SECTION - Edit markdown sections
edit_file("README.md", 
  { sectionStart: "## Configuration", sectionEnd: "## Usage" }, 
  "New configuration content...", 
  { strategy: "section" }
)

// 3. LINES - Edit specific lines
edit_file("app.js", 
  { startLine: 10, endLine: 15 }, 
  "// New code here", 
  { strategy: "lines" }
)

// 4. PATTERN - Regex replacements
edit_file("*.js", 
  { pattern: /console\.log\(/g }, 
  "logger.debug(", 
  { strategy: "pattern" }
)

// 5. BETWEEN - Edit between markers
edit_file("template.html", 
  { 
    startMarker: "<!-- BEGIN CONTENT -->", 
    endMarker: "<!-- END CONTENT -->" 
  }, 
  "<div>New content</div>", 
  { strategy: "between" }
)

Reading Multiple Files

read_multiple_files({
  paths: ["package.json", "README.md", ".env"]
})

๐Ÿ“Š Performance

  • Working Directory Detection: <100ms
  • Memory Loading: Instant (always in context)
  • Search Operations: <500ms for typical projects
  • Multi-file Read: Parallel processing
  • Context Generation: <1 second with caching

๐Ÿ—‚ Project Structure

mcp-project-context/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ enhancedIndex.ts         # Main enhanced server
โ”‚   โ”œโ”€โ”€ discovery/                # Project analysis
โ”‚   โ”œโ”€โ”€ storage/
โ”‚   โ”‚   โ””โ”€โ”€ fileBasedMemoryManager.ts  # File-based memory
โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ””โ”€โ”€ enhancedContextManager.ts  # Enhanced context
โ”‚   โ”œโ”€โ”€ search/
โ”‚   โ”‚   โ””โ”€โ”€ codeSearcher.ts      # Enhanced search (all files)
โ”‚   โ”œโ”€โ”€ handlers/                 # MCP handlers
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ workingDirectoryFix.js  # Auto directory detection
โ”œโ”€โ”€ dist/                         # Compiled output
โ”œโ”€โ”€ CLAUDE.md                     # Project memory
โ””โ”€โ”€ README.md

๐Ÿ” Security & Privacy

  • All data stored locally (no cloud sync)
  • Sensitive file filtering
  • Binary file exclusion
  • Gitignore respect
  • Safe file operations

๐Ÿ› Troubleshooting

Working Directory Issues

If the tool starts in wrong directory:

  1. Set PROJECT_ROOT environment variable in config
  2. Tool auto-detects git repositories
  3. Check logs for directory detection

Memory Not Loading

  1. Ensure CLAUDE.md exists in project root
  2. Check file permissions
  3. Use reload_memories tool

Search Not Finding Files

  1. Check if file type is in binary exclusion list
  2. Verify file is not gitignored
  3. Use specific file patterns

๐Ÿ“ˆ Recent Improvements

Version 2.1.0 (January 2025)

  • โœ… Smart Edit System: 5 powerful editing strategies
    • Fuzzy matching for whitespace tolerance
    • Section-based editing for documentation
    • Line range editing for precise changes
    • Pattern/regex support for bulk replacements
    • Between markers for template editing
  • โœ… Enhanced error messages with similarity detection
  • โœ… Backup support for safe editing
  • โœ… Diff statistics for change tracking

Version 2.0.0 (January 2025)

  • โœ… File-based memory system (replaced database)
  • โœ… Enhanced search for ALL text files
  • โœ… Working directory auto-detection
  • โœ… Multi-file read operations
  • โœ… Surgical file editing

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

MIT

๐Ÿ†˜ Support

For issues and questions, please open an issue on GitHub.

Quick Setup
Installation guide for this server

Install Package (if required)

npx @modelcontextprotocol/server-mcp-project-context

Cursor configuration (mcp.json)

{ "mcpServers": { "crycool-mcp-project-context": { "command": "npx", "args": [ "crycool-mcp-project-context" ] } } }