MCP Configs2026年4月6日·1 分钟阅读

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.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Context+ — Semantic Code Intelligence MCP Server
安全暂存命令
npx -y tokrepo@latest install bf876394-1dbf-4b0a-9d41-179ea6522616 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

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.

常见问题

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.

引用来源 (3)
🙏

来源与感谢

Created by ForLoopCodes. Licensed under MIT.

contextplus — ⭐ 1,700+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产