Skip to content
Back to search

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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/muvon--octocode/badge.svg)](/listings/muvon--octocode)

HTML

<a href="/listings/muvon--octocode"><img src="/api/listings/muvon--octocode/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

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](INSTALL.md) 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](https://www.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](doc/API_KEYS.md) 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.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 273 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <img src="logo.svg" width="240" alt="Octocode logo">
  3. # Octocode
  4. **Code search and dependency graphs for AI assistants.**
  5. [![CI](https://github.com/Muvon/octocode/actions/workflows/ci.yml/badge.svg)](https://github.com/Muvon/octocode/actions/workflows/ci.yml)
  6. [![Coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fmuvon%2Foctocode%2Fbadges%2Fcoverage.json&style=flat-square)](https://github.com/Muvon/octocode/actions/workflows/ci.yml)
  7. [![Crates.io](https://img.shields.io/crates/v/octocode)](https://crates.io/crates/octocode)
  8. [![Release](https://img.shields.io/github/v/release/Muvon/octocode)](https://github.com/Muvon/octocode/releases)
  9. [![Rust](https://img.shields.io/badge/Rust-1.95%2B-orange.svg)](https://www.rust-lang.org)
  10. [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
  11. [Quick start](#quick-start) · [MCP integration](#mcp-integration) · [OctoFS](#use-octocode-with-octofs) · [Documentation](#documentation) · [Contributing](#contributing) · [Website](https://octomind.run/product/octocode)
  12. <a href="https://glama.ai/mcp/servers/Muvon/octocode">
  13. <img width="300" src="https://glama.ai/mcp/servers/Muvon/octocode/badge" alt="Octocode MCP server listing on Glama" />
  14. </a>
  15. </div>
  16. Octocode is a Rust CLI and [MCP](https://modelcontextprotocol.io) server for exploring codebases. It combines semantic search, structural search, and a live graph of symbols and dependencies. Connect it to Claude Code, Codex, Cursor, Windsurf, or another MCP client, or search directly from your terminal.
  17. - **Find code by intent** with hybrid vector and keyword search, plus configurable reranking.
  18. - **Locate definitions and usages** with structural search over the current source.
  19. - **Trace relationships** between files and symbols: imports, calls, inheritance, and implementations.
  20. - **Read signatures** without loading entire files; add a language server for definitions, references, and hover information.
  21. - **Run locally** with the default embedding and reranking models, or configure remote providers.
  22. ## Quick start
  23. ### 1. Install
  24. Use the installer on Linux or macOS, or in a Unix-compatible shell on Windows:
  25. ```bash
  26. curl -fsSL https://raw.githubusercontent.com/Muvon/octocode/master/install.sh | sh
  27. ```
  28. Alternatively, on macOS:
  29. ```bash
  30. brew install muvon/tap/octocode
  31. ```
  32. <details>
  33. <summary>Other installation methods</summary>
  34. Download a binary from [GitHub Releases](https://github.com/Muvon/octocode/releases/latest), or install the published crate:
  35. ```bash
  36. cargo install octocode
  37. ```
  38. Building from source requires Rust 1.95 or later and `protoc`. See the [installation guide](INSTALL.md) for platform requirements, build features, and manual installation.
  39. </details>
  40. Verify the installation:
  41. ```bash
  42. octocode --version
  43. ```
  44. ### 2. Index and search
  45. Run these commands in your project's Git repository:
  46. ```bash
  47. cd /path/to/your/project
  48. octocode index
  49. octocode search "authentication middleware"
  50. ```
  51. The default configuration uses local FastEmbed models for embeddings and reranking. No API key is required; model files download on first use. For a directory without Git, use `octocode index --no-git`.
  52. ```bash
  53. # Combine related queries
  54. octocode search "auth" "middleware" "session"
  55. # Filter code results by language
  56. octocode search "database connection pool" --language rust
  57. # Search documentation
  58. octocode search "deployment configuration" --mode docs
  59. ```
  60. ### 3. Connect your AI assistant
  61. Choose your client in [MCP integration](#mcp-integration). Structural search, signatures, and the live dependency graph read the current source directly and work without an index. Semantic search uses the index created above.
  62. ## MCP integration
  63. Install Octocode where your client can find it on `PATH`, and replace `/path/to/your/project` with your project's absolute directory path.
  64. ### Claude Code
  65. ```bash
  66. claude mcp add --transport stdio octocode -- octocode mcp --path /path/to/your/project
  67. claude mcp list
  68. ```
  69. See the [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp) for configuration scopes and connection details.
  70. ### Codex CLI
  71. ```bash
  72. codex mcp add octocode -- octocode mcp --path /path/to/your/project
  73. codex mcp list
  74. ```
  75. See the [Codex MCP documentation](https://developers.openai.com/codex/mcp) for CLI and configuration-file options.
  76. ### Claude Desktop, Cursor, and Windsurf
  77. Add an Octocode entry to your client's MCP configuration:
  78. ```json
  79. {
  80. "mcpServers": {
  81. "octocode": {
  82. "command": "octocode",
  83. "args": ["mcp", "--path", "/path/to/your/project"]
  84. }
  85. }
  86. }
  87. ```
  88. Restart the client after saving. The [MCP client setup guide](doc/MCP_CLIENTS.md) covers configuration locations and other clients.
  89. ### Octomind
  90. [Octomind](https://github.com/Muvon/octomind) is a companion AI agent runtime. Its `developer:general` agent includes Octocode and OctoFS capabilities. After installing Octomind, start it in your project:
  91. ```bash
  92. cd /path/to/your/project
  93. octomind run developer:general
  94. ```
  95. The first run may install required tools and ask for model credentials. See the [Octomind quick start](https://github.com/Muvon/octomind#quick-start) for installation and model access.
  96. ### Available tools
  97. | Tool | Use it for | Requires an index |
  98. |------|------------|-------------------|
  99. | `semantic_search` | Find code, documentation, and indexed history by meaning | Yes |
  100. | `structural_search` | Find definitions, usages, and AST patterns in current source | No |
  101. | `view_signatures` | Read function signatures, declarations, and imports | No |
  102. | `graphrag` | Explore live file and symbol relationships and dependency paths | No |
  103. | `lsp_*` | Definitions, references, hover information, symbols, and completion | No; requires a language server |
  104. To enable LSP tools, install a language server and add `--with-lsp` to the server command, for example:
  105. ```bash
  106. octocode mcp --path /path/to/your/project --with-lsp rust-analyzer
  107. ```
  108. By default, the MCP server uses the existing semantic index without updating it. Rerun `octocode index` after changes, or run `octocode watch` separately in the project directory. In-process indexing is available through `index.mcp_index = true`.
  109. See the [MCP integration guide](doc/MCP_INTEGRATION.md) for tool parameters, HTTP transport, and serving multiple repositories, and the [LSP guide](doc/LSP_INTEGRATION.md) for language server setup.
  110. ## Use Octocode with OctoFS
  111. [OctoFS](https://github.com/Muvon/octofs) adds file reading and atomic editing tools to your assistant. Run both MCP servers against the same project directory.
  112. Octocode's `structural_search` returns source lines as `N:hh|content`, with the same line IDs used by OctoFS `view`. An agent can use these IDs directly in OctoFS `batch_edit`, without reading the same lines again to obtain edit targets. Exact-name lookups include complete definitions up to 32 lines; larger results identify omitted ranges for a targeted read.
  113. Each ID hashes the original line, including indentation. OctoFS checks IDs before applying edits and reports stale targets when the content no longer matches. Group known edits to a file into one atomic batch, then use the fresh IDs returned by the edit for follow-up changes. The `N:hh|` prefix is metadata, not part of the source code.
  114. After [installing OctoFS](https://github.com/Muvon/octofs#installation), add it alongside the Octocode server configured above. Choose your client:
  115. **Claude Code:**
  116. ```bash
  117. claude mcp add --transport stdio octofs -- octofs mcp --path /path/to/your/project
  118. ```
  119. **Codex CLI:**
  120. ```bash
  121. codex mcp add octofs -- octofs mcp --path /path/to/your/project
  122. ```
  123. Use the same absolute project path for both servers. OctoFS is optional; Octocode's search and navigation tools work independently.
  124. ## How it works
  125. ```text
  126. Current source → Language parsers → Live file and symbol graph → MCP tools
  127. Indexed code → Embeddings + BM25 → Hybrid search + reranking → CLI / MCP
  128. ```
  129. The live graph uses Tree-sitter to extract symbols and relationships from current source, without embeddings or an LLM. It remains available through MCP when `[graphrag].enabled = false`.
  130. Enabling indexed GraphRAG adds persisted file-level enrichment, including semantic file discovery and optional LLM descriptions and architectural relationships. The `octocode graphrag` CLI uses this persisted layer:
  131. ```bash
  132. octocode config --graphrag-enabled true
  133. octocode index
  134. octocode graphrag overview
  135. ```
  136. See the [architecture guide](doc/ARCHITECTURE.md) for module boundaries and storage details.
  137. ## Supported languages
  138. | Language | Extensions |
  139. |----------|------------|
  140. | Rust | `.rs` |
  141. | Python | `.py` |
  142. | TypeScript / JavaScript | `.ts`, `.tsx`, `.js`, `.jsx` |
  143. | Go | `.go` |
  144. | PHP | `.php` |
  145. | C / C++ | `.c`, `.cpp`, `.cc`, `.cxx`, `.c++`, `.h`, `.hpp`, `.hxx`, `.cppm`, `.ixx`, `.mxx`, `.ccm`, `.cxxm` |
  146. | Ruby | `.rb` |
  147. | Elixir | `.ex`, `.exs` |
  148. | Java | `.java` |
  149. | Swift | `.swift` |
  150. | Svelte | `.svelte` |
  151. | Lua | `.lua` |
  152. | CSS | `.css`, `.scss`, `.sass` |
  153. | JSON | `.json` |
  154. | Bash | `.sh`, `.bash` |
  155. | Markdown | `.md`, `.markdown` |
  156. ## Retrieval benchmark
  157. The repository includes [ground truth, scoring scripts, and reproduction instructions](benchmark/README.md). The published local matrix used 127 code-search queries, corpus commit `b1771ba`, Octocode **0.17.1**, and `fastembed:jinaai/jina-embeddings-v2-base-code`, with reranking disabled for the variants below.
  158. | Configuration | Hit@5 | Hit@10 | MRR | NDCG@10 | Recall@10 |
  159. |---------------|-------|--------|-----|---------|-----------|
  160. | Dense vector only | 0.598 | 0.717 | 0.485 | 0.528 | 0.671 |
  161. | Hybrid, vector/keyword weights 0.7/0.3 | 0.598 | 0.717 | 0.485 | 0.528 | 0.671 |
  162. | Hybrid, vector/keyword weights 0.3/0.7 | 0.732 | 0.835 | 0.572 | 0.620 | 0.807 |
  163. These are historical results from June 21, 2026; they do not measure the current release or its default configuration. See the [full variant matrix](benchmark/RESULTS.md) for settings and reranker comparisons.
  164. ## Privacy and configuration
  165. - **Local models by default.** Embedding and reranking run locally after model downloads. Remote embedding, reranking, and LLM providers are optional; when enabled, they receive the queries and source content needed for those features.
  166. - **Local storage.** Indexes live outside your repository in Octocode's per-project data directory.
  167. - **File exclusions.** Indexing respects `.gitignore` and `.noindex`. Configure exclusions for files you do not want indexed.
  168. - **Client access.** The default MCP transport is stdio. The model used by your AI client may receive source content returned by tools, even when Octocode uses local models.
  169. - **Provider credentials.** API keys can be supplied through environment variables. See the [API key guide](doc/API_KEYS.md) before enabling remote providers.
  170. The [configuration guide](doc/CONFIGURATION.md) explains model selection and indexing options. The [embedded default template](config-templates/default.toml) contains the current defaults.
  171. ## Documentation
  172. - [Getting started](doc/GETTING_STARTED.md) — basic workflow
  173. - [Installation](INSTALL.md) — binaries, source builds, and platform requirements
  174. - [MCP clients](doc/MCP_CLIENTS.md) — client setup and configuration locations
  175. - [MCP integration](doc/MCP_INTEGRATION.md) — tools, transports, and multiple repositories
  176. - [LSP integration](doc/LSP_INTEGRATION.md) — language server tools
  177. - [Commands](doc/COMMANDS.md) — CLI reference
  178. - [Configuration](doc/CONFIGURATION.md) — models and customization
  179. - [API keys](doc/API_KEYS.md) — remote provider setup
  180. - [Architecture](doc/ARCHITECTURE.md) — internals
  181. - [Changelog](CHANGELOG.md) — release history
  182. ## Contributing
  183. Bug reports, documentation improvements, and code contributions are welcome. Read the [contributing guide](doc/CONTRIBUTING.md) for development setup and the [engineering standards](AGENTS.md) before changing code.
  184. Use [GitHub Issues](https://github.com/Muvon/octocode/issues) for bugs and feature requests, [Discussions](https://github.com/Muvon/octocode/discussions) for questions, or contact [opensource@muvon.io](mailto:opensource@muvon.io).
  185. ## License
  186. [Apache License 2.0](LICENSE). Maintained by [Muvon](https://muvon.io).
  187. <!-- mcp-name: io.github.Muvon/octocode -->

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.