MCP ConfigsApr 6, 2026·2 min read

Context+ — Semantic Code Intelligence MCP Server

MCP server combining RAG, Tree-sitter AST parsing, and spectral clustering to turn large codebases into searchable feature graphs. 99% accuracy on monorepos. 1,700+ GitHub stars.

TL;DR
MCP server combining RAG, Tree-sitter AST parsing, and spectral clustering to make large codebases searchable by AI agents.
§01

What it is

Context+ is an MCP server that combines RAG (Retrieval-Augmented Generation), Tree-sitter AST parsing, and spectral clustering to transform large codebases into searchable feature graphs. It gives AI coding agents deep understanding of code structure, dependencies, and feature boundaries.

Context+ targets teams using AI coding assistants on large monorepos where standard file search is insufficient. By clustering related code into semantic features, it helps agents find relevant code faster and understand architectural patterns.

§02

How it saves time or tokens

Without semantic code intelligence, AI agents grep through entire codebases to find relevant code, consuming tokens on irrelevant files. Context+ pre-indexes the codebase into a feature graph, so agents query by concept ('authentication flow') rather than by file name.

The spectral clustering groups related functions, classes, and modules into features. An agent asking about 'payment processing' gets the relevant controllers, services, models, and tests without searching every directory.

§03

How to use

  1. Install Context+ as an MCP server:
npm install -g context-plus
context-plus init
  1. Index your codebase:
context-plus index --path ./src
  1. Connect to your AI coding tool via MCP:
{
  "mcpServers": {
    "context-plus": {
      "command": "context-plus",
      "args": ["serve"]
    }
  }
}
  1. The AI agent can now query the feature graph:
Agent: Find all code related to user authentication
Context+: Returns clustered results from auth controller, middleware, models, and tests
§04

Example

# Query the feature graph via CLI
context-plus query 'payment processing'

# Output:
# Feature: Payment Processing (confidence: 0.94)
# Files:
#   src/controllers/payment.ts (score: 0.97)
#   src/services/stripe.ts (score: 0.95)
#   src/models/transaction.ts (score: 0.92)
#   tests/payment.test.ts (score: 0.89)
§05

Related on TokRepo

§06

Common pitfalls

  • Not re-indexing after significant code changes. The feature graph becomes stale as code evolves. Set up automatic re-indexing on git push or as a CI step.
  • Expecting instant indexing on large monorepos. Initial indexing of a 100K+ file codebase can take minutes. Subsequent incremental updates are faster.
  • Trusting cluster boundaries blindly. Spectral clustering groups related code statistically. Review and adjust cluster assignments for domain-specific accuracy.
  • Failing to review community discussions and changelogs before upgrading. Breaking changes in major versions can disrupt existing workflows. Pin versions in production and test upgrades in staging first.

Frequently Asked Questions

What is a feature graph?+

A feature graph maps code elements (functions, classes, modules) to semantic features (authentication, payment, notification). It is built by analyzing code structure with AST parsing, semantic similarity with embeddings, and relationship patterns with spectral clustering.

How does Context+ use Tree-sitter?+

Context+ uses Tree-sitter to parse source code into Abstract Syntax Trees (ASTs). This provides structural understanding of functions, classes, imports, and dependencies without executing the code. Tree-sitter supports most programming languages.

Does Context+ work with any programming language?+

Context+ supports languages that Tree-sitter can parse, which includes most popular languages: TypeScript, Python, Go, Java, Rust, C/C++, Ruby, and more. The RAG embeddings work with any text-based source code.

How does MCP integration work?+

Context+ runs as an MCP server that exposes tools for querying the feature graph, searching code by concept, and retrieving relevant code snippets. Any MCP-compatible client (Claude Code, Claude Desktop) can connect to it.

What is spectral clustering?+

Spectral clustering is a graph-based clustering algorithm that groups code elements by their relationships (imports, calls, type references). Unlike simple directory-based grouping, it discovers cross-directory feature boundaries that reflect actual code architecture.

Citations (3)
🙏

Source & Thanks

Created by ForLoopCodes. Licensed under MIT.

contextplus — ⭐ 1,700+

Thanks for bringing deep semantic code intelligence to MCP.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.