code-context-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@code-context-mcpsearch code for 'payment processing'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
code-context-mcp
MCP server for semantic code search and dependency graph analysis. Indexes codebases into a knowledge graph (Apache AGE) with vector embeddings (pgvector + Ollama) for AI-powered code understanding.
Supported Languages
TypeScript (
.ts,.tsx) — functions, classes, types, interfaces, importsRust (
.rs) — functions, structs, enums, traits, impl blocks, modules, use declarationsSolidity (
.sol) — contracts, functions, events, modifiers, structs, enums, interfaces, importsC - functions, enums
Related MCP server: code-graph-mcp
Prerequisites
Docker and Docker Compose
Node.js >= 18
Quick Start
# Start PostgreSQL (with AGE + pgvector) and Ollama
docker-compose up -d
# Install dependencies and build
npm install
npm run buildIndexing a Codebase
# Index a directory (project name auto-derived from directory basename)
node dist/cli/index.js index ./src
# Override the project name
node dist/cli/index.js index ./src --project my-project
# Index multiple codebases
node dist/cli/index.js index /path/to/frontend --project frontend
node dist/cli/index.js index /path/to/backend --project backendThe indexer will:
Parse all supported source files (TypeScript, Rust, Solidity) using tree-sitter
Build a code graph with functions, classes, types, contracts, traits, and their relationships
Generate vector embeddings for semantic search via Ollama
Show a progress bar during indexing
Re-running the indexer on the same directory skips unchanged files (detected via content hash).
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"code-context": {
"command": "node",
"args": ["dist/mcp/server.js"],
"cwd": "/path/to/code-context-mcp",
"env": {
"PGHOST": "localhost",
"PGPORT": "5433",
"PGDATABASE": "rag_db",
"PGUSER": "postgres",
"PGPASSWORD": "postgres",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}MCP Tools
list_projects
List all indexed projects and their node counts.
Parameters: none
search_code
Semantic search across the indexed codebase. Finds functions, classes, types, and imports by meaning.
Parameter | Type | Required | Description |
| string | yes | Natural language search query |
| number | no | Maximum results (default: 10) |
| string | no | Scope search to a project |
get_call_stack
Trace the call dependency tree from a function.
Parameter | Type | Required | Description |
| string | yes | Function to trace from |
| number | no | Max traversal depth, 1-10 (default: 3) |
| string | no | Scope to a project |
get_function_context
Gather full context for a function: callers, callees, types it uses.
Parameter | Type | Required | Description |
| string | yes | Function to get context for |
| string | no | Scope to a project |
get_impact_analysis
Analyze impact of changes to a file. Shows all external code that depends on definitions in the file.
Parameter | Type | Required | Description |
| string | yes | Relative path of the file (as indexed) |
| string | no | Scope to a project |
Environment Variables
Variable | Default | Description |
|
| PostgreSQL host |
|
| PostgreSQL port |
|
| Database name |
|
| Database user |
|
| Database password |
|
| Ollama API endpoint |
Testing
Unit Tests
Unit tests run without Docker and cover extractors, scanner, registry, progress bar, embeddings, and DB queries.
npm test # Run all unit tests
npm run test:watch # Watch modeIntegration Tests
Integration tests require separate Docker containers to avoid interfering with development data.
# Start test infrastructure (separate ports: PG=5434, Ollama=11435)
docker compose -f docker-compose.test.yml up -d
# Run integration tests
npm run test:integrationIntegration tests cover the full indexing pipeline and multi-language graph population.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RafaelC457ro/code-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server