octocode
Structural code intelligence for AI agents — semantic search, knowledge graphs, and a built-in MCP server in one Rust binary. Give Claude, Cursor, and any MCP client a deep understanding of your codebase.
Install / Use
claude mcp add Muvon -- npx -y github:Muvon/octocodeIf 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
Our assessment of octocode
octocode scores 92/100 on our quality scale, 227th of 964 AI & Machine Learning skills we index (top 24%).
Its MCP Server is 19 KB long, well organised into 39 sections with 16 code examples: a thorough specification that gives an agent plenty to work with.
It has 510 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 2 days ago, so octocode is actively maintained.
- Our last check on 2026-09-24 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. 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 (2 minor notes below). An AI review of the same text found nothing harmful.
- noteInstalls by piping a downloaded script into a shellline 133
curl -fsSL https://raw.githubusercontent.com/Muvon/octocode/master/install.sh | sh - noteInstalls by piping a downloaded script into a shellline 280
curl -fsSL https://raw.githubusercontent.com/muvon/octomind/master/install.sh | bash
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
octocode compared with similar skills
All 4 of these similar skills score higher than octocode; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| octocode (this skill)by Muvon | 92 | 510 | 2d ago | MCP Server |
| claude-memby thedotmack | 100 | 100.2k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 96.7k | 5d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 86.1k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 75.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install octocode?
- Run
claude mcp add Muvon -- npx -y github:Muvon/octocode. The install tabs above show the steps for each supported agent. - Which AI agents does octocode work with?
- It is written for Claude Code, Claude Desktop and Cursor, as a MCP Server file. Other agents that read the same format can often use it too.
- Is octocode safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (2 minor notes below). An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/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 octocode still maintained?
- The repository was last updated 2 days ago, so octocode is actively maintained.
Skill content
View source on GitHubStructural Code Intelligence for AI Agents — MCP Server + Knowledge Graph + Semantic Search
Give your AI assistant a brain for your codebase. Octocode transforms your project into a navigable knowledge graph that Claude, Cursor, and other AI agents can search, understand, and navigate.
🚀 Quick Start • 🤖 MCP Integration • 📖 Documentation • 🌐 Website
<a href="https://glama.ai/mcp/servers/Muvon/octocode"> <img width="300" src="https://glama.ai/mcp/servers/Muvon/octocode/badge" alt="Octocode MCP server" /> </a> </div>🤖 Built for AI Agents
The Problem: AI assistants are blind to your codebase. They can't search your files, understand dependencies, or remember context across sessions.
The Solution: Octocode's MCP server gives AI agents:
- 🔍 Semantic search — Find code by meaning, not keywords
- 🕸️ Knowledge graph — Navigate imports, calls, and dependencies
- 📝 Code signatures — View structure without reading entire files
- 🧭 LSP precision — Go-to-definition, find-references, and hover docs via your language server
Works with: Claude Desktop • Cursor • Windsurf • Any MCP-compatible AI
Now your AI assistant can:
You: "Where is authentication handled?"
AI: *searches your codebase* "Authentication is in src/middleware/auth.rs,
which imports jwt.rs for token validation and calls user_store.rs for lookup."
You: "What files depend on the payment module?"
AI: *queries knowledge graph* "src/api/handlers/payment.rs imports payment/mod.rs,
which is also used by src/workers/refund.rs and src/cron/billing.rs"
You: "Find every call site of this function"
AI: *uses LSP find-references* "process_payment() is called from 4 places:
checkout.rs:87, refund.rs:134, billing.rs:56, and tests/payment_test.rs:23"
🤔 Why Octocode?
Standard RAG treats your code as flat text chunks. It finds similar-sounding snippets but has no idea that auth_middleware.rs imports jwt.rs, calls user_store.rs, and is wired into router.rs. Octocode understands structure.
# Semantic search finds the right code
octocode search "authentication middleware"
→ src/middleware/auth.rs — Similarity: 0.9234
# The GraphRAG CLI queries the optional persisted graph
octocode config --graphrag-enabled true
octocode index
octocode graphrag get-relationships --node-id src/middleware/auth.rs
Outgoing:
imports → jwt (src/auth/jwt.rs): token validation logic
calls → user_store (src/db/user_store.rs): user lookup by token
Incoming:
imports ← router (src/router.rs): wires auth into the request pipeline
Octocode uses tree-sitter AST parsing to build a live graph of files, symbols, imports, calls, inheritance, and implementations. The MCP graphrag tool builds this graph lazily from the current source tree, without an index, embeddings, or an LLM. Optional indexed GraphRAG adds semantic file discovery, descriptions, and broader architectural relationships.
🔬 How It Works
Current Source → Tree-sitter AST → Live Symbol Graph ──────────────→ MCP `graphrag`
↑ ↑
Indexed Code → Embeddings + Optional LLM → Persisted File Enrichment ─────┘
- Live AST Graph — tree-sitter extracts file and symbol nodes plus deterministic
contains,imports,calls,extends, andimplementsrelationships directly from current source - Always-on Graph Navigation — MCP graph lookup, relationship traversal, path finding, and overview work with
[graphrag].enabled = false - Optional Enrichment — enabling indexed GraphRAG overlays semantic file matches, LLM descriptions, and broader file-level architectural relationships; symbols are never embedded or LLM-generated
- Hybrid Search — semantic similarity + BM25 full-text search + reranking handles meaning-based code retrieval separately
- MCP Server — exposes
semantic_search,view_signatures,graphrag, andstructural_searchto any MCP-compatible client
✨ What Makes It Different
| | Standard RAG | Doc Lookup Tools | Octocode |
|---|---|---|---|
| Indexes | Text chunks | External library docs | Your codebase structure (AST) |
| Understands | Similar text | API specs & usage | Functions, imports, dependencies |
| Cross-file | No | No | Yes — navigates the dependency graph |
| Relationships | No | No | imports, calls, implements, extends... |
| AI integration | Varies | MCP | Native MCP server + LSP |
Doc tools give AI the manual for libraries you use. Octocode gives AI the blueprint of how you put them together.
Built with Rust for performance. Local-first for privacy. Open source (Apache 2.0) for transparency.
📊 Retrieval Quality
Octocode ships a reproducible retrieval benchmark (benchmark/): 127 curated code-search queries with line-range ground truth, run against octocode's own source (pinned at b1771ba so annotations never drift). The numbers below use a fully local, no-API-key stack — jina-embeddings-v2-base-code via fastembed, no reranker — so they are a floor, not a ceiling:
| Config | Hit@5 | Hit@10 | MRR | NDCG@10 | Recall@10 | |---|---|---|---|---|---| | Dense vector only | 0.598 | 0.717 | 0.485 | 0.528 | 0.671 | | Hybrid, default RRF weights (0.7/0.3) | 0.598 | 0.717 | 0.485 | 0.528 | 0.671 | | Hybrid, keyword-tuned (0.3/0.7) | 0.732 | 0.835 | 0.572 | 0.620 | 0.807 |
Tilting RRF fusion toward the BM25/keyword signal — which carries disproportionate weight for code's exact identifiers — lifts Hit@5 by +22% and Recall@10 by +20% at zero added cost.
The benchmark also flags what doesn't help here (full 6-variant matrix in benchmark/RESULTS.md): a generic local cross-encoder reranker (bge-reranker-base) actually regressed results (Hit@5 0.732 → 0.598) — code retrieval needs a code-aware reranker (e.g. voyage:rerank-2.5), not an off-the-shelf one.
git clone https://github.com/Muvon/octocode && cd octocode
git worktree add /tmp/corpus b1771ba # pin the corpus to the ground-truth commit
CORPUS=/tmp/corpus python3 benchmark/run_matrix.py # set OCTO_BIN to use a custom binary
See benchmark/README.md for methodology and metric definitions.
🚀 Quick Start
1. Install
# Universal installer (Linux, macOS, Windows)
curl -fsSL https://raw.githubusercontent.com/Muvon/octocode/master/install.sh | sh
# macOS with Homebrew
brew install muvon/tap/octocode
<details>
<summary><strong>Other installation methods</strong></summary>
# From crates.io
cargo install octocode
# Or from source (latest)
cargo install --git https://github.com/Muvon/octocode
# Download binary from releases
# https://github.com/Muvon/octocode/releases
See Installation Guide for platform-specific instructions.
</details>2. Set Up API Keys
# Optional: embedding provider (defaults to local FastEmbed — no key needed)
export VOYAGE_API_KEY="your-voyage-api-key"
# Optional: LLM for commit messages, code review
export OPENROUTER_API_KEY="your-openrouter-api-key"
Get your Voyage API key: voyageai.com (free tier available)
<details> <summary><strong>Other embedding providers</strong></summary>Octocode supports multiple embedding providers:
# OpenAI
export OPENAI_API_KEY="your-key"
octocode config --code-embedding-model "openai:text-embedding-3-small"
# Jina AI
export JINA_API_KEY="your-key"
octocode config --code-embedding-model "jina:jina-embeddings-v3"
# Google
export GOOGLE_API_KEY="your-key"
octocode config --code-embedding-model "google:text-embedding-005"
See API Keys guide for all supported providers.
</details>3. Index Your Codebase
cd /your/project
octocode index
# → ✓ Indexing complete! 342 of 342 files processed (342 new, 0 unchanged)
4. Search Your Code
# Natural language search
octocode search "authentication middleware"
# Multi-query for broader results
octocode search "auth" "middleware" "session"
# Filter by language
octocode search "database connection pool" --language rust
# Search commit history
octocode search "authentication refactor" --mode commits
5. Connect Your AI Assistant
Add to your MCP client config (Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"octocode": {
"command": "octocode",
"args": ["mcp", "--path", "/your/project"]
}
}
}
Done! Your AI assistant now understands your codebase structure.
🔌 MCP Server Integration
Octocode includes a built-in MCP server that exposes your codebase as tools to AI assistants. This is the primary way to use Octocode — give your AI assistant direct access to search and navigate your code.
Available Tools
| Tool | What It Does |
|------|--------------|
| semantic_search | Find code by meaning — "authentication flow", "error handling", "database queries" |
| view_signatures | View file structure — function signatures, class definitions, imports |
| graphrag | Always-on file/symbol graph — search nodes, inspect relationships, and find paths without indexing |
| structural_search | AST pattern matching — find .unwrap() calls, new instantiations, specific patterns |
| lsp_goto_definition | Jump to a symbol's definition (requires --with-lsp) |
| lsp_find_references | Find all usages of a symbol across the workspace (requires --with-lsp) |
| lsp_hover | Type info and documentation for a symbol (requires --with-lsp) |
| lsp_document_symbols / lsp_workspace_symbols / lsp_completion | File symbols, workspace-wide symbol search, completions (requires --with-lsp) |
Enable the LSP tools by starting the server with your language server:
octocode mcp --path /your/project --with-lsp="rust-analyzer"
Conversational AI Examples
Once connected, your AI assistant can answer questions about your codebase:
You: "Where is user authentication implemented?"
AI: *uses semantic_search* "Found in src/auth/login.rs. The authenticate() function
validates credentials against the database, generates a JWT token, and stores
the session in Redis."
You: "What files depend on the payment module?"
AI: *uses graphrag* "src/api/handlers/payment.rs imports payment/mod.rs, which is also
used by src/workers/refund.rs and src/cron/billing.rs. The payment module exports
process_payment() and validate_transaction() functions."
You: "Show me all error handling in the API layer"
AI: *uses structural_search* "Found 23 error handling patterns in src/api/:
- 15 use Result<T, ApiError> with explicit error types
- 8 use .unwrap() (potential panics in handlers/user.rs:42, handlers/auth.
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
100.2kPersistent 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
96.7kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
86.1kGraphs 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.
headroom
75.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
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.
