MCP Context Manager MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g claude-mcp-context
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add mcp-context-manager -- node "<FULL_PATH_TO_MCP_CONTEXT_MANAGER>/dist/index.js"

Replace <FULL_PATH_TO_MCP_CONTEXT_MANAGER>/dist/index.js with the actual folder you prepared in step 1.

README.md

The smartest code search for Claude.

MCP Context Manager

The smartest code search for Claude. Reduces token usage by 70-90% with BM25 ranking, fuzzy matching, and natural language queries.

What is this?

An MCP (Model Context Protocol) server that gives Claude superhuman code navigation. Instead of reading entire files (thousands of tokens), Claude queries for exactly what it needs (tens of tokens).

The difference:

- Claude reads 3 files → 5,400 tokens → 5 seconds
+ Claude queries "auth middleware" → 230 tokens → 85ms

95% token savings + 10x faster = drastically lower API costs.

Features

  • 🎯 Natural Language Search - "authentication middleware" finds all auth code
  • 🔍 BM25 Ranking - Industry-standard relevance algorithm (like Elasticsearch)
  • Fuzzy Matching - Handles typos automatically ("athenticate" → "authenticate")
  • 🧠 Smart Tokenization - Understands camelCase, snake_case, paths
  • 🚀 Blazing Fast - <100ms searches on 10,000+ file repos
  • 🌐 Multi-Language - TypeScript, JavaScript, Python, Go, Rust, Java, C/C++, C#, Lua
  • 💰 Token Savings - 70-90% reduction in typical usage

Quick Start

Installation

npm install -g claude-mcp-context

Automatic Setup (Claude Code CLI):

The package automatically detects and configures Claude Code. After installation, run:

mcp-context-setup

This will:

  1. ✅ Build the server (if needed)
  2. ✅ Verify server functionality
  3. ✅ Register with Claude Code automatically
  4. ✅ Confirm registration

Manual Configuration (Claude Desktop or troubleshooting):

If automatic setup doesn't work or you're using Claude Desktop, add to your config file:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "context-manager": {
      "command": "claude-mcp-context"
    }
  }
}

Claude Code (~/.claude/mcp.json):

{
  "mcpServers": {
    "context-manager": {
      "command": "claude-mcp-context"
    }
  }
}

Verify Installation:

claude mcp list  # Should show "context-manager"

Usage

Restart Claude and try:

"Index this repository"
"Find the authentication middleware"
"Show me all payment-related functions"
"What does the UserService class do?"

That's it! Claude will now use intelligent search instead of reading entire files.

How It Works

1. Index Your Repository (One Time)

You: "Index this repository"

MCP Context Manager parses all code and builds a searchable index (~1 second per 1000 files).

2. Natural Language Queries

You: "Find authentication middleware"

Returns:
📍 authMiddleware (function) - Score: 892.3
   src/middleware/auth.ts:15

📍 AuthService (class) - Score: 654.2
   src/services/AuthService.ts:8

3. Massive Token Savings

Instead of 5,400 tokens to read 3 files, you get exactly what you need in 230 tokens.

Search Intelligence

Multi-Word Queries

"payment validation" → finds validatePayment(), PaymentValidator, checkPayment()
"user auth service" → finds UserAuthService, authenticateUser(), etc.

Fuzzy Matching

"athenticate" → suggests authenticate
"usrService" → suggests userService

Query Expansion

"auth" → searches: auth, authenticate, authentication, authorization
"db" → searches: db, database, data
"config" → searches: config, configuration, configure, settings

Code Body Search

Searches inside function implementations, not just names:

"jwt token" → finds code that uses JWT, even if function isn't named jwt*

Available Tools

Tool What It Does
get_relevant_context Natural language search with BM25 ranking
find_symbol Locate specific function/class with fuzzy suggestions
get_function Get complete function code
get_class Get class definition (optionally filter methods)
search_code Regex pattern search with relevance ranking
find_similar Discover structurally similar code
get_file_summary File overview without full content
get_repository_structure Directory tree view
get_dependencies Trace imports and dependencies
index_repository Build/refresh code index

Claude automatically chooses the best tool based on your query.

Examples

Find Authentication Code

You: "Find all authentication-related code"

Claude uses: get_relevant_context("authentication")

Returns:
- authMiddleware() in middleware/auth.ts
- authenticate() in auth/handler.ts
- AuthService class in services/auth.ts
- validateToken() in utils/jwt.ts

Tokens: 340 (vs 4,200 reading all files) = 92% savings

Debug Payment Flow

You: "Show me the payment processing flow"

Claude uses: get_rel

Tools (10)

get_relevant_contextNatural language search with BM25 ranking
find_symbolLocate specific function/class with fuzzy suggestions
get_functionGet complete function code
get_classGet class definition (optionally filter methods)
search_codeRegex pattern search with relevance ranking
find_similarDiscover structurally similar code
get_file_summaryFile overview without full content
get_repository_structureDirectory tree view
get_dependenciesTrace imports and dependencies
index_repositoryBuild/refresh code index

Configuration

claude_desktop_config.json
{"mcpServers": {"context-manager": {"command": "claude-mcp-context"}}}

Try it

Index this repository
Find the authentication middleware
Show me all payment-related functions
What does the UserService class do?

Frequently Asked Questions

What are the key features of MCP Context Manager?

Natural Language Search using BM25 ranking. Fuzzy matching for typo-tolerant code discovery. Multi-language support including TypeScript, Python, Go, and Rust. Significant token usage reduction by querying specific symbols. Fast indexing and search performance on large repositories.

What can I use MCP Context Manager for?

Reducing API token costs by querying only relevant code snippets. Quickly locating specific class or function definitions in large codebases. Understanding repository structure and dependency chains. Debugging complex flows by searching for specific implementation patterns.

How do I install MCP Context Manager?

Install MCP Context Manager by running: npm install -g claude-mcp-context

What MCP clients work with MCP Context Manager?

MCP Context Manager works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Context Manager docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare