Skip to content

sbkriz/octocode

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

433 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Octocode Logo

Octocode

AI-Powered Code Intelligence with Built-in MCP Server

GitHub stars License Rust Release

Transform your codebase into a queryable knowledge graph. Ask questions in plain English, get precise answers.

πŸš€ Quick Start β€’ πŸ“– Documentation β€’ πŸ”Œ MCP Server β€’ 🌐 Website

Octocode MCP server

πŸ€” Why Octocode?

You know that feeling β€” staring at a 100k+ line codebase, trying to find where authentication is handled, or how the database layer connects to the API. Traditional search (grep, ripgrep) only finds exact matches. Octocode understands meaning.

# Instead of this:
grep -r "auth" --include="*.rs" | head -20  # 847 results, mostly noise

# Do this:
octocode search "how is user authentication implemented"
# β†’ 3 relevant files with context and relationships

Octocode builds a semantic knowledge graph of your entire codebase using tree-sitter AST parsing and vector embeddings. It connects your code to AI assistants via the Model Context Protocol (MCP) β€” giving Claude, Cursor, and other AI tools deep contextual understanding of your project.

✨ What Makes It Different

Feature Traditional Search Octocode
Query style Exact keywords Natural language
Results Text matches Semantic meaning + relationships
Context Single file Cross-file dependencies & imports
AI integration None Native MCP server + LSP
Speed Instant <2s indexing, instant queries

Built with Rust for performance. Local-first for privacy. Open source (Apache 2.0) for transparency.

πŸš€ Quick Start

1. Install (30 seconds)

# Universal installer (Linux, macOS, Windows)
curl -fsSL https://raw.githubusercontent.com/Muvon/octocode/master/install.sh | sh

# Or with Cargo
cargo install --git https://github.com/Muvon/octocode

2. Configure API Keys (1 minute)

# Required: Voyage AI (200M free tokens/month)
export VOYAGE_API_KEY="your-voyage-api-key"

# Optional: OpenRouter (for AI commit messages, code review)
export OPENROUTER_API_KEY="your-openrouter-api-key"

Get Voyage AI key β€’ Get OpenRouter key

3. Index Your Codebase (2-5 minutes)

cd /your/project
octocode index
# β†’ Indexed 12,847 blocks across 342 files

4. Search with Natural Language

# Single query
octocode search "HTTP middleware pattern"

# Multi-query for comprehensive results
octocode search "authentication" "middleware" "session"

# With filters
octocode search "database connection pool" --lang rust

# Search commit history
octocode search "authentication refactor" --mode commits

5. Connect AI Assistants (MCP Server)

# Start MCP server for Claude Desktop, Cursor, etc.
octocode mcp --path /your/project

# Or HTTP mode for custom integrations
octocode mcp --bind 0.0.0.0:12345

πŸ”Œ MCP Server Integration

Octocode includes a built-in MCP server that exposes your codebase as tools to AI assistants:

Tool What It Does
semantic_search Semantic search across code, docs, text, and commits
view_signatures View file signatures and code structure by glob patterns
graphrag Query code relationships, dependencies, and architecture

Works with: Claude Desktop β€’ Cursor β€’ Any MCP-compatible client

See MCP Integration Guide for setup instructions.

🎯 Use Cases

  • πŸ†• Onboarding β€” "How does the auth system work?" β†’ Get the full picture in seconds
  • πŸ” Code Archaeology β€” Find legacy code patterns without knowing exact names
  • πŸ€– AI Pair Programming β€” Give your AI assistant complete codebase context
  • πŸ“ Refactoring β€” Understand dependencies before making changes
  • πŸ”Ž Code Review β€” "Show me all error handling in the API layer"

🌐 Supported Languages

Language Extensions Features
Rust .rs Full AST parsing, pub/use detection, module structure
Python .py Import/class/function extraction, docstring parsing
TypeScript/JavaScript .ts, .tsx, .js, .jsx ES6 imports/exports, type definitions
Go .go Package/import analysis, struct/interface parsing
PHP .php Class/function extraction, namespace support
C++ .cpp, .hpp, .h Include analysis, class/function extraction
Ruby .rb Class/module extraction, method definitions
Java .java Import analysis, class/method extraction
JSON .json Structure analysis, key extraction
Bash .sh, .bash Function and variable extraction
Markdown .md Document section indexing, header extraction

Plus: CSS, Lua, Svelte, and more via tree-sitter

πŸ“š Documentation

πŸ”’ Privacy & Security

  • 🏠 Local-first β€” FastEmbed runs entirely offline (macOS)
  • πŸ” Secure β€” API keys stored locally, env vars supported
  • 🚫 Respects .gitignore β€” Never indexes sensitive files
  • πŸ›‘οΈ MCP security β€” Local-only server, no external network for search
  • πŸ“€ Cloud-safe β€” Embeddings process only metadata, never source code

🀝 Community & Support

βš–οΈ License

Apache License 2.0 β€” See LICENSE for details.


Built with πŸ¦€ Rust by Muvon in Hong Kong

⭐ Star β€’ 🍴 Fork β€’ πŸ“£ Share

About

Semantic code searcher and codebase utility

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 92.7%
  • HTML 2.4%
  • CSS 2.0%
  • Shell 1.4%
  • JavaScript 0.8%
  • Makefile 0.6%
  • Dockerfile 0.1%