SuperAPI AI Directory

octocode-mcp

Octocode is a code research platform for AI agents and developers that emphasizes "evidence first." It uses the same set of tools to research both local code and external code (GitHub repositories, PRs, npm), providing ripgrep + AST search, directory trees, precise reads, and LSP capabilities, and can be used as a CLI or MCP server, powered under the hood by a Rust engine, pursuing fast and token-efficient results. It supports providing agents with compact, citable context before changing, reviewing, or explaining code, and by default performs secret scanning and redaction on output content.

Open website

About this tool

Octocode is an "evidence first" code research platform for AI agents and developers. Its goal is to provide compact, citable context before agents modify, review, or explain code, so that agents work based on evidence rather than guesswork. It uses the same set of tools to research two worlds at once: local code, and external code such as GitHub repositories, PRs, and npm.

Main capabilities

  • Unified toolset: ripgrep + AST search, directory trees, precise reads, LSP, covering everything from a single file to very large repositories.
  • Dual-form usage: it can be used both as a CLI and as an MCP server, with both sharing the same set of tools and Rust engine.
  • Agent-driven efficient workflow: search broadly first, then fetch only the exact matching lines or regions, with smart pagination and out-of-the-box compression to prevent the model from over-fetching; every result comes with a hint pointing to the most cost-effective next step.
  • Scalable to monorepos: after discovering a pattern in one repository, you can trace the PR that introduced it, then continue tracing across other repositories and local files without leaving the conversation.
  • Smart GitHub workflow: perform parallel batch queries on code, PRs, commits, issues, and repositories, following the discipline of "broad search, narrow read, semantic tracing."
  • Usable without GitHub: after cloning any repository, point the local tools (search, AST, LSP, content) at it and keep the same evidence-first workflow.
  • Read structure, not noise: instant compression/skeletonization for 70+ languages, compressing a 100 KB file down to a few hundred tokens.
  • Fast and self-contained: search, parsing, navigation, and redaction all run in one prebuilt Rust engine, fast on laptops or very large repositories, with no additional installation required.
  • Secure by default: every byte sent to the model is first scanned and redacted.

How to use Prerequisite: Node.js 20.12+.

  1. Run the Octocode CLI with npx.
  2. Optionally authenticate with GitHub to unlock private repositories and higher API rate limits.
  3. Choose the interface: CLI or MCP, both with the same tools and Rust engine (cloning is enabled by default in the CLI and must be explicitly enabled in MCP).

Using as an MCP server: add octocode-mcp to the MCP client configuration, or install it with one click in supported clients; for other clients, use npx octocode install. GitHub tokSet en and options under env.

Use as an agent-friendly CLI: run npx octocode, and agents can infer usage on their own; the bare command prints built-in usage and the full tool catalog. Every MCP tool is also a regular command: input JSON, output token-saving YAML. Local paths route to local tools; owner/repo[/path] routes to GitHub.

Authentication (choose any one)

  • Octocode CLI interactive login (recommended): you can choose Octocode browser OAuth or gh auth login; OAuth credentials are stored encrypted on disk.
  • GitHub CLI: Octocode automatically reads the gh token, with no extra configuration required.
  • Personal access token: set OCTOCODE_TOKEN, GH_TOKEN, or GITHUB_TOKEN in the shell; required scopes are repo, read:user, read:org. Note: never commit tokens to version control; use environment variables or secure secrets management.

Configuration All settings are optional, and Octocode uses sensible defaults. Settings are resolved by priority from three sources: MCP/environment variables (highest), global config <octocode-home>/.octocoderc, built-in defaults. Octocode home is .octocode under the operating system home directory on all platforms (macOS/Linux: ~/.octocode, Windows: %USERPROFILE%.octocode), and can be overridden with OCTOCODE_HOME. Do not put tokens in .octocoderc; use env or npx octocode auth login.

Security

  • Bidirectional secret redaction on input and output: 300+ provider credential patterns (AWS, Azure, GCP, GitHub, OpenAI, Anthropic, Stripe, Slack, 1Password, etc.), plus generic JWTs, PEM/private keys, bearer tokens, database connection strings, and high-entropy strings; masked values display a redaction warning.
  • Content is sanitized at the source: local reads and external fetches are scanned at read time.
  • Path safety: relativeinput is resolved from WORKSPACE_ROOT/config/cwd, and local reads are restricted by the engine's allowed roots; symlinks are resolved and the real target is revalidated.
  • Sensitive files are blocked by default: keys/certificates, .env*, .npmrc/.netrc, cloud/infrastructure credentials, .git/, browser logins, OS keychains, wallets, etc. return a redacted error instead of content.
  • Command safety: local searches run inside the octocode-engine process; external helpers are pinned per channel, with command/argument allowlists, and run via spawn with an argument array, no shell strings, no injection.
  • Credentials: GitHub authentication is via env token, AES-256-GCM encrypted on-disk OAuth, or gh CLI; tokens are never logged.

Language support Four code intelligence axes, three of which are natively supported by the Rust engine with no external tools required. The full support matrix lists the AST, signature, LSP, and compression capabilities for each extension.

Tool catalog The full catalog contains 17 tools; the registered count depends on the interface and the flags set. ghListReleases and ghSearchDiscussions require two settings on MCP: ENABLE_RELEASES=1 or ENABLE_DISCUSSIONS=1 puts the tool in the catalog, and ENABLE_TOOLS="ghListReleases,ghSearchDiscussions" is what actually registers it; setting only one does not register it. CLI only needs the ENABLE_RELEASES and ENABLE_DISCUSSIONS flags. ENABLE_LOCAL and ENABLE_CLONE accept true or 1; ENABLE_RELEASES and ENABLE_DISCUSSIONS also accept yes and on.

Token tuning: concise:true returns path/title-only lists; minify controls file read density: symbols = skeleton with line numbers, standard = strips comments/blank lines (default), none = exact bytes.

Agent Skills Agent Skills is a lightweight, open format for extending AI agent capabilities. Available at skills.sh/bgauryy/octocode-mcp browsing and installation. There are 13 skills under skills/, packaged in the octocode package. Each is a streamlined SKILL.md that loads references only when needed, so they are composable. It is recommended to start with ⭐ Research for evidence-first code work. The skills cover core research and extraction, planning and architecture, evaluation and review, and agent orchestration. Web automation workflow: octocode-scraping first performs safe static traversal (fetch/crawl/extract → local corpus → graph v2); when the graph exposes dynamic operations or the static output is blocked/too thin, octocode-chrome-devtools verifies live operability, cookies/storage, network/HAR bodies, screenshots, or authenticated state; discovered URLs/data/artifacts can be fed back into the scraping corpus to continue proving.

Architecture This is a yarn-workspaces monorepo. The MCP server and CLI are both thin frontends sitting on top of a shared TypeScript utility core, which delegates all CPU-intensive paths to a single Rust engine (compiled into prebuilt .node binaries via napi-rs). One tool catalog, one security layer, one response shaper, accessed in two ways. Whether the call comes from MCP or the CLI, the request flow is exactly the same. The Rust engine handles secret detection, sanitization, path and command validation, compression (70+ languages), signature extraction, structured AST search, ripgrep parsing, diff filtering, YAML serialization, and LSP. The engine is prebuilt for darwin (arm64/x64), linux (arm64/x64, gnu and musl), and win32-x64, requiring no Rust toolchain at runtime.

When to use

  • An agent needs provable context before changing, reviewing, or explaining code.
  • Tracing patterns across repositories, dependency/call graph chains, commit ranges, impact scope, PR review.
  • Efficient code research in monorepos or very large repositories.
  • Need to research local code and external GitHub/npm code at the same time without leaving the conversation.

Limitations and caveats

  • Requires Node.js 20.12+.
  • GitHub-related tools require authentication; private repositories and higher API rate limitsRequires GitHub authentication.
  • Some tools (such as ghListReleases, ghSearchDiscussions) require both flags to be set on MCP before they are registered.
  • Sensitive files are blocked from reading by default, returning a redacted error.
  • Benchmark results are based on a specific methodology (30 GitHub issues × 3 rounds, blind evaluation gpt-5.5, counted by characters), and actual results may vary by scenario.
  • For more complete schemas, fields, and examples, see docs/OCTOCODE_TOOLS.md; for the security model, see SECURITY.md; for configuration reference, see Configuration Reference.

Website: octocode.ai. Product documentation: github.com/bgauryy/octocode/tree/main/docs.