Skip to content

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…

Install

$claude mcp add octocode -- octocode mcp --path /path/to/your/project

Install command taken from the project's README or registry entry. Always review code before running it.

Structural 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


🤖 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 ─────┘

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related