Octocode

Code research over local repositories, all of GitHub and npm, with compact, secret-redacted output

By bgauryy (individual) TypeScript Local · stdio Developer toolsGit and code hosting

65 popularity score ★ 957 ↓ 6.1k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add octocode -- npx -y octocode-mcp@latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp@latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp@latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "octocode": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp@latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.octocode]
command = "npx"
args = ["-y", "octocode-mcp@latest"]
Gemini CLITerminal
gemini mcp add --scope user octocode npx -- -y octocode-mcp@latest

Settings 12

GITHUB_TOKEN Optional: GitHub token for the GitHub tools (OCTOCODE_TOKEN and GH_TOKEN also work, checked first); not needed if gh CLI or octocode auth login is set up.
ENABLE_LOCAL Optional: Local file, graph and LSP tools; true by default, set false to turn them off.
ENABLE_CLONE Optional: Set true to enable ghCloneRepo (false by default).
WORKSPACE_ROOT Optional: Root for resolving relative local paths; defaults to the working directory.
ALLOWED_PATHS Optional: Extra paths local tools may read beyond the defaults.
TOOLS_TO_RUN Optional: Strict allowlist of tools to register.
DISABLE_TOOLS Optional: Tools to remove from the default set.
OCTOCODE_OUTPUT_FORMAT Optional: Reply format, yaml (default) or json.
OCTOCODE_STORAGE_MODE Optional: Set memory to stop it writing caches, sessions and stats to disk; persistent by default.
GITHUB_API_URL Optional: API address for GitHub Enterprise.
NPM_CONFIG_REGISTRY Optional: npm registry for npmSearch; defaults to https://registry.npmjs.org (named in the package manifest, not the README).
OCTOCODE_HOME Optional: Folder for config, encrypted credentials and caches; ~/.octocode by default.

What it does

Octocode MCP (npm package octocode-mcp) gives an assistant one set of read-oriented research tools that work the same way on the code in your own workspace and on code hosted on GitHub. On the GitHub side it searches code, repositories and directory trees, reads files or parts of files, and searches or opens pull requests, issues, commits and ref comparisons. Locally it searches text and AST patterns, finds files, walks trees, builds a file dependency graph to spot cycles and dead-code candidates, and does LSP navigation (definitions, references, callers, hover and more). An npm lookup links packages back to their source repositories.

Heavy work runs in a bundled Rust engine with prebuilt binaries, and output is trimmed for tokens: file reads are minified by default, lists can be cut to paths and titles, and replies come back as YAML unless you set OCTOCODE_OUTPUT_FORMAT=json. Everything passing to or from the model goes through a secret scanner first. The same tools are also available as the separate octocode CLI.

Version 19.1.0, the one npx installs today, has 10 tools (listed in the package's manifest.json), and 9 of them are on by default. The README on the GitHub main branch still describes an older 17-tool layout (ghSearchCode, ghSearchRepos, localFindDeadCode and others, with local tools off by default on MCP); the npm README and the published manifest show the merged tools below, so go by those. The official MCP registry entry is also stale: it still points at version 7.0.9.

What it needs

RuntimeNode.js

Node.js ^22.22.2, ^24.15.0 or 26+ (the engines field of octocode-mcp 19.1.0; the README's main-branch copy says 20.12+). macOS (arm64/x64), Linux (arm64/x64, glibc or musl) or Windows x64, where the Rust engine ships prebuilt. A GitHub token for the GitHub tools: GITHUB_TOKEN/GH_TOKEN/OCTOCODE_TOKEN with repo, read:user, read:org scopes, an existing `gh auth login`, or `npx octocode auth login`. LSP navigation beyond JS/TS needs the language server installed (the CLI's `octocode lsp-server install` adds them).

Limits

Read-only research: no tool edits files, opens pull requests, comments or pushes. ghCloneRepo is off unless ENABLE_CLONE=true, and it also needs local tools on and persistent storage (not OCTOCODE_STORAGE_MODE=memory). ghSearch takes 1 to 5 parallel queries. Local reads stay inside allowed roots (home by default, plus ALLOWED_PATHS), and known secret files such as .env*, .npmrc, .aws/ and .git/ return an error instead of contents. Without a GitHub token, private repositories are out of reach and API rate limits are lower. The README's manual config omits -y for npx; the install buttons include it.

Who it suits

Developers who want an assistant to dig through unfamiliar code, both their own checkout and other projects on GitHub, before changing anything, and who care about keeping context small. It suits read-only research well since nothing it does changes a repository. It is a community project, not GitHub's; if you need an assistant to create issues, review or merge pull requests, or manage repositories, pick a server that writes to GitHub instead. Leave ENABLE_LOCAL=false if you only want GitHub and npm lookups and no access to your disk.

Tools 10

ghSearch
Search GitHub code, find repositories, or list a repository's tree, chosen by an operation field
ghGetFileContent
Read a GitHub file whole, by line range, around a match, or in pages
ghSearchHistory
Search or list pull requests, issues or commits in GitHub
ghGetHistoryItem
Open one pull request, issue or commit, or compare two refs
ghCloneRepo
Clone a repository or a sparse subfolder into the local cache for local and LSP analysis (opt-in)
npmSearch
Look up npm packages by name or keyword and return metadata with the source repository
localSearch
Search local code by text or AST pattern, find files, or walk a directory tree
localAnalyzeGraph
Map local file dependencies to find cycles, reachability and dead-code candidates
localGetFileContent
Read a local file whole or in part, minified by default
lspGetSemantics
Language-server navigation: definitions, references, callers, hover, symbols, diagnostics

Similar servers