$git clone https://github.com/Muvon/octocodeGive 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.
| 1 | <div align="center"> |
| 2 | |
| 3 | <img src="https://raw.githubusercontent.com/Muvon/octocode/master/logo.svg" width="240" alt="Octocode"> |
| 4 | |
| 5 | ### **Structural Code Intelligence for AI Agents — MCP Server + Knowledge Graph + Semantic Search** |
| 6 | |
| 7 | [](https://github.com/Muvon/octocode/stargazers) |
| 8 | [](https://opensource.org/licenses/Apache-2.0) |
| 9 | [](https://www.rust-lang.org) |
| 10 | [](https://github.com/Muvon/octocode/releases) |
| 11 | |
| 12 | **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. |
| 13 | |
| 14 | [🚀 Quick Start](#-quick-start) • [🤖 MCP Integration](#-mcp-server-integration) • [📖 Documentation](#-documentation) • [🌐 Website](https://octocode.muvon.io) |
| 15 | |
| 16 | <a href="https://glama.ai/mcp/servers/Muvon/octocode"> |
| 17 | <img width="300" src="https://glama.ai/mcp/servers/Muvon/octocode/badge" alt="Octocode MCP server" /> |
| 18 | </a> |
| 19 | |
| 20 | </div> |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## 🤖 Built for AI Agents |
| 25 | |
| 26 | **The Problem:** AI assistants are blind to your codebase. They can't search your files, understand dependencies, or remember context across sessions. |
| 27 | |
| 28 | **The Solution:** Octocode's MCP server gives AI agents: |
| 29 | - 🔍 **Semantic search** — Find code by meaning, not keywords |
| 30 | - 🕸️ **Knowledge graph** — Navigate imports, calls, and dependencies |
| 31 | - 📝 **Code signatures** — View structure without reading entire files |
| 32 | - 🧠 **Persistent memory** — Remember decisions across conversations |
| 33 | |
| 34 | **Works with:** Claude Desktop • Cursor • Windsurf • Any MCP-compatible AI |
| 35 | |
| 36 | ```json |
| 37 | // Add to your AI assistant config |
| 38 | { |
| 39 | "mcpServers": { |
| 40 | "octocode": { |
| 41 | "command": "octocode", |
| 42 | "args": ["mcp", "--path", "/your/project"] |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | ``` |
| 47 | |
| 48 | Now your AI assistant can: |
| 49 | ``` |
| 50 | You: "Where is authentication handled?" |
| 51 | AI: *searches your codebase* "Authentication is in src/middleware/auth.rs, |
| 52 | which imports jwt.rs for token validation and calls user_store.rs for lookup." |
| 53 | |
| 54 | You: "What files depend on the payment module?" |
| 55 | AI: *queries knowledge graph* "src/api/handlers/payment.rs imports payment/mod.rs, |
| 56 | which is also used by src/workers/refund.rs and src/cron/billing.rs" |
| 57 | |
| 58 | You: "Remember this bug fix for future reference" |
| 59 | AI: *stores in memory* "Got it. I'll remember this authentication bypass fix |
| 60 | and apply similar patterns when reviewing security code." |
| 61 | ``` |
| 62 | |
| 63 | ## 🤔 Why Octocode? |
| 64 | |
| 65 | **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*. |
| 66 | |
| 67 | ``` |
| 68 | # Semantic search finds the right code |
| 69 | octocode search "authentication middleware" |
| 70 | → src/middleware/auth.rs | Similarity 0.923 |
| 71 | |
| 72 | # GraphRAG reveals the full dependency chain |
| 73 | octocode graphrag get-relationships --node_id src/middleware/auth.rs |
| 74 | Outgoing: |
| 75 | imports → jwt (src/auth/jwt.rs): token validation logic |
| 76 | calls → user_store (src/db/user_store.rs): user lookup by token |
| 77 | Incoming: |
| 78 | imports ← router (src/router.rs): wires auth into the request pipeline |
| 79 | ``` |
| 80 | |
| 81 | Octocode uses **tree-sitter AST parsing** to extract real symbols (functions, imports, dependencies), builds a **GraphRAG knowledge graph** of relationships between files, and exposes everything via **MCP** — so AI tools can *navigate* your project architecture, not just search it. |
| 82 | |
| 83 | ## 🔬 How It Works |
| 84 | |
| 85 | ``` |
| 86 | Source Code → Tree-sitter AST → Symbols & Relationships → Knowledge Graph |
| 87 | ↓ |
| 88 | Embeddings + Hybrid Search + Reranking → MCP Server |
| 89 | ``` |
| 90 | |
| 91 | 1. **AST Parsing** — tree-sitter extracts real code symbols (functions, classes, imports), not arbitrary text chunks |
| 92 | 2. **Knowledge Graph** — GraphRAG maps rela |