structured-repo-context-mcp
MCP server for semantic code search and codebase analysis — AST parsing, Tree-sitter, embeddings and vector search for AI assistants and LLMs
Install / Use
claude mcp add kvnpetit -- npx -y github:kvnpetit/structured-repo-context-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of structured-repo-context-mcp
structured-repo-context-mcp scores 74/100 on our quality scale, 865th of 963 AI & Machine Learning skills we index.
Its MCP Server is 78 KB long, well organised into 108 sections with 46 code examples: long enough that it reads more like full documentation than a focused instruction file, which agents can find harder to follow.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so structured-repo-context-mcp is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-11-13. Automated pattern scan on 2026-11-13. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
structured-repo-context-mcp compared with similar skills
All 4 of these similar skills score higher than structured-repo-context-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| structured-repo-context-mcp (this skill)by kvnpetit | 74 | 3 | 2mo ago | MCP Server |
| claude-memby thedotmack | 100 | 119.6k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 114.5k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 94.2k | today | CLAUDE.md |
| hyperframesby heygen-com | 100 | 89.6k | today | CLAUDE.md |
Frequently asked questions
- How do I install structured-repo-context-mcp?
- Run
claude mcp add kvnpetit -- npx -y github:kvnpetit/structured-repo-context-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does structured-repo-context-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is structured-repo-context-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is structured-repo-context-mcp still maintained?
- The repository was last updated about 2 months ago, so structured-repo-context-mcp is actively maintained.
Skill content
View source on GitHubSRC (Structured Repo Context)
Transform your codebase into AI-ready context — MCP server + CLI for semantic code search that makes your code truly understandable for AI assistants
SRC is both:
- 🔌 An MCP Server — Integrates with Claude Desktop, Cursor, and any MCP-compatible AI assistant
- 💻 A Standalone CLI — Use directly from your terminal for indexing and searching
Table of Contents
- Overview
- Quick Start
- Installation
- MCP Tools Reference
- CLI Reference
- Configuration
- Supported Languages
- How It Works
- Comparison
- Troubleshooting
- Links
Overview
The Problem
AI assistants struggle to understand your entire codebase:
- They only see small snippets of code at a time
- Manual copy-pasting of context is tedious and error-prone
- Keyword search misses semantic relationships between code
- Code changes get lost in conversation history
The Solution
SRC indexes your codebase into semantic, searchable chunks that LLMs actually understand:
| Feature | Description | | ----------------------- | ------------------------------------------------------------------------------- | | Hybrid Search | Vector + BM25 + RRF fusion for optimal results | | Call Graph | Shows who calls what and what calls who | | Cross-file Context | Resolves imports and path aliases automatically | | Incremental Updates | SHA-256 hash detection for fast updates | | Semantic Navigation | Local LSP/SCIP when available, with explicit Tree-sitter fallback | | Project Context | Onboarding, repo map, artifacts, memory, Git and task context | | Local Hardening | Strict contracts, snapshots, redaction, injection signals and audit metadata | | 55 Language Modes | 18 Tree-sitter languages plus 37 configured fallback modes across 99 extensions |
Use Cases
| Scenario | Example Query | | ------------------ | -------------------------------------------------- | | Code Review | "Show me all error handling in the payment module" | | Debugging | "Find where user sessions are created" | | Documentation | "Explain the authentication flow" | | Refactoring | "List all deprecated API usages" | | Onboarding | "How does the routing system work?" | | Security Audit | "Find all database query locations" |
Quick Start
1. Choose an embedding provider
The default provider is local Ollama:
# Install from https://ollama.com, then:
ollama pull nomic-embed-text
For a zero-service setup, use the deterministic lexical provider instead:
EMBEDDING_PROVIDER=lexical src-mcp serve
The lexical provider is a useful BM25/identifier baseline; Ollama remains the recommended provider for semantic vector quality.
2. Install SRC
Global installation:
npm install -g src-mcp
Or use npx:
npx -y src-mcp serve
3. Use as MCP Server (with AI Assistants)
Add to your MCP client configuration (e.g., Claude Desktop):
With global installation:
{
"mcpServers": {
"src-mcp": {
"command": "src-mcp",
"args": ["serve"]
}
}
}
With npx:
{
"mcpServers": {
"src-mcp": {
"command": "npx",
"args": ["-y", "src-mcp", "serve"]
}
}
}
The server indexes the current directory when requested and can watch for file
changes. EMBEDDING_PROVIDER=lexical removes the requirement for a running
Ollama service.
Then in your AI assistant:
"Search for authentication logic"
"Find error handling code with limit 20"
"Search for UserService in fts mode"
4. Use as CLI (Standalone)
# Start server (auto-indexes if needed and watches by default)
src-mcp serve
# Search for code
src-mcp search_code --query "authentication"
src-mcp search_code --query "error handling" --limit 20
src-mcp search_code --query "UserService" --mode fts
# Check index status
src-mcp get_index_status
Key Arguments
| Tool | Argument | Default | Description |
| ---------------- | --------------- | ------- | --------------------------- |
| search_code | --limit | 10 | Max results |
| search_code | --mode | hybrid | hybrid / vector / fts |
| index_codebase | --concurrency | 4 | Parallel workers |
| index_codebase | --force | false | Re-index if exists |
Installation
Global Installation
npm install -g src-mcp
Then use directly:
src-mcp serve
src-mcp search_code --query "authentication"
src-mcp --help
npx (No Installation)
npx -y src-mcp serve
npx -y src-mcp search_code --query "authentication"
Local Development
git clone https://github.com/kvnpetit/structured-repo-context-mcp.git
cd structured-repo-context-mcp
bun install --frozen-lockfile
bun run dev
MCP Tools Reference
SRC exposes 35 MCP tools, 7 reusable MCP prompts, 2 static MCP resources, and 1 project resource template. The same tool registry is also available through the CLI. All tools return structured content, bounded results, read-only/destructive annotations, and safe error messages. Indexing and updates report progress when the client supplies a progress token and honor request cancellation.
Source returned by analysis tools is untrusted project data. It is marked with
source_is_untrusted; search_code and assemble_task_context redact common
inline secrets by default. Exact source extraction keeps offsets stable and can
opt into redaction with redact_secrets: true.
Responses also carry provenance, index freshness, confidence, coverage and
truncation metadata. Potential prompt-injection patterns found in returned
source are exposed as bounded instruction_signals without echoing matched
source text. When SRC_AUDIT_LOG is enabled, only non-sensitive tool timing and
project identifiers are written to the local audit log.
Every MCP tool response also has a stable top-level schema_version (currently
1) alongside success, optional data, message, and error fields. Clients
should branch on this envelope before consuming a tool-specific data payload.
Tasks extension
Modern MCP clients that declare io.modelcontextprotocol/tasks in their
per-request client capabilities can receive a durable task handle for the
long-running index_codebase and update_index tools. Poll a handle with
tasks/get; tasks/update and tasks/cancel are also implemented according
to the current extension contract. Task state is stored atomically outside the
project by default, expires after 24 hours, and is bounded to eight active
tasks per server process. A shared store has a hard ceiling of 1,024 records
and 16 MiB; reaching either refuses new writes without evicting existing IDs.
Set MCP_TASKS=off to disable it, or configure MCP_TASK_TOOLS,
MCP_TASK_STORE_DIR, MCP_TASK_TTL_MS, MCP_TASK_POLL_INTERVAL_MS,
MCP_TASK_MAX_ACTIVE, and MCP_TASK_MAX_RESULT_BYTES.
The extension is opt-in per request: clients without the current capability
continue to receive the normal synchronous tool result. Processes sharing a
store coordinate read/modify/write operations with local filesystem locks.
In-progress tasks owned by a living process are preserved; an abandoned task
whose owner has exited is reported as failed because
arbitrary source analysis cannot be resumed without its original runtime
state. There is intentionally no tasks/list endpoint in the current
extension; task IDs are unguessable and retrieval is explicit.
Use a local disk for this store. A persistence failure stops affected runners and rejects new asynchronous work until the server restarts; synchronous tools remain available. Failed states are retained in memory and retried against the store when it becomes writable again. Cross-process cancellation is polled at 500 ms. Owner detection is conservative if the OS reuses a process ID.
Tool profiles and allow-listing
The complete surface is enabled by default. Set SRC_TOOL_PROFILE=readonly to
hide the seven local state/index-mutating tools, or SRC_TOOL_PROFILE=minimal to expose only
server information, index status, search, diagnostics, project discovery,
project context, project artifacts, semantic navigation, and compact
context-orientation tools.
SRC_TOOL_ALLOWLIST takes precedence when it contains explicit names; unknown
entries are ignored by the registry. An explicitly
non-empty but unusable SRC_ALLOWED_ROOTS value fails closed rather than
falling back to the current directory.
index_codebase
Index a directory with semantic chunking, AST enrichment, and embeddings.
| Parameter | Type | Required | Default | Description |
| ------------- | -------- | -------- | ------- | ----------------------------------- |
| directory | string | No | . | Path to directory to index |
| force | boolean | No | false | Force re-indexing if index exists |
| exclude | string[] | No | [] | Additional glob patterns to exclude |
| concurrency | number | No | 4 | Parallel file processing workers |
Example:
"Index the project at /home/user/myapp with concurrency 8"
Returns:
{
"filesIndexed": 150,
"chunksCreated": 892,
"languages": { "typescript": 500, "javascript": 200, "json": 192 }
}
search_code
Hybrid search with vector similarity, BM25 keyword matching, and RRF fusion.
| Parameter | Type | Required | Default | Description |
| -------------------- | ------- | -------- | --------- | ------------------------------------------------------- |
| query | string | Yes | — | Natural language search query |
| directory | string | No | . | Path to indexed directory |
| limit | number | No | 10 | Maximum results to return |
| cursor | string | No | — | Opaque cursor returned by a previous page |
| max_content_bytes | number | No | 20000 | UTF-8 byte cap per returned source result |
| `min_con
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
119.6kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
114.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
94.2kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
hyperframes
89.6kOpen-source AI video editor: edit your own footage, or create and remake any video with Claude Code, Codex or the free Studio app. Write HTML, render MP4. By HeyGen.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
