Back to MCP Servers

Octocode

AI-powered developer assistant that enables advanced research, analysis and discovery across GitHub and NPM realms in realtime.

developer-toolsgithubai
By bgauryy
90377Updated 3 days agoTypeScriptMIT

Installation

npx -y octocode-mcp

Configuration

{
  "mcpServers": {
    "octocode-mcp": {
      "command": "npx",
      "args": ["-y", "octocode-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

Octocode - Agentic Research Platform

<div align="center"> <img src="https://github.com/bgauryy/octocode/raw/main/packages/octocode-mcp/assets/logo_white.png" width="400px" alt="Octocode Logo">

MCP Community Server Ask DeepWiki

Website YouTube

</div>

Evidence-first code research for AI agents and developers.

Evidence from your local workspace and external sources (GitHub repos, PRs, npm). One toolset: ripgrep + AST search, trees, precise reads, and LSP — as a CLI or MCP server, backed by a Rust engine for fast, token-efficient results across single files or mega-repos.


Table of Contents


Quick Start

1. Run the Octocode CLI with npx

npx octocode --help

2. Authenticate with GitHub — optional, but unlocks private repositories and higher API rate limits:

npx octocode auth login
npx octocode status       # verify the active token source

3. Choose your interface. The same engine and tools run identically either way.

🖥️ CLI — research straight from your terminal:

npx octocode

🤖 MCP — one-click install:

Claude Code:

claude mcp add-json octocode --scope user '{"command":"npx","type":"stdio","args":["@octocodeai/mcp@latest"]}'

Any other client: npx octocode install

➡️ Learn more at octocode.ai.


Why Octocode

Agents write better code from evidence than from assumptions. Octocode turns guess-driven work into research-driven work. Before an agent changes, reviews, or explains code, it gathers real evidence from your local workspace and from GitHub repositories, pull requests, and npm packages, then hands it back as compact, citable context. Code is truth; context is the map.

Most tools cover one slice: searching the web, or grepping your repo. Octocode covers the whole research flow, end to end:

  • Built for scale. In organizations with thousands of repositories and endless code, Octocode is the solution: spot a pattern in one repo, follow it through the pull request that introduced it, then trace the same shape across other repos and your own files without leaving the conversation. Clone any repo and study it locally, on any machine.
  • Smart GitHub workflows. Parallel bulk queries and built-in next-step hints keep the agent on the cheapest path: search broadly, read narrowly, trace semantically. Each result points to the natural follow-up.
  • No GitHub required. Even without GitHub, clone any repository locally and point Octocode's local tools (search, structural AST, LSP, content) at it for the same evidence-first research.
  • Reads the shape, not the noise. Code is minified and skeletonized on the fly across 70+ languages, so an agent grasps a 100 KB file in a few hundred tokens instead of spending its context on boilerplate.
  • Fast and self-contained. Search, parsing, semantic navigation, and redaction run in one prebuilt Rust engine: quick on a laptop or a mega-repo, with no extra toolchain to install.
  • Safe by default. Every byte returned to the model is scanned and secrets redacted first (see Security).

What You Can Do

Octocode is useful whenever the next coding step depends on finding and proving context, not guessing it.

NeedUse Octocode to
Codebase questionsSearch local or GitHub code, read exact regions, browse trees, and carry file/line anchors into the answer.
Implementation researchCompare patterns across repositories, npm packages, pull requests, commits, and local files before changing code.
Semantic navigationResolve definitions, references, callers/callees, call hierarchy, hovers, symbols, diagnostics, and type relationships through LSP.
Structural matchingRun AST-shaped searches with patterns or YAML rules so comments and strings do not become false positives.
Large-file contextMinify, skeletonize, or paginate code so agents spend tokens on relevant structure instead of boilerplate.
Agent workflowsSame engine via MCP, CLI, and Agent Skills.

See Quick Start to install in your terminal or AI assistant.


Tools

13 always-on tools (same on MCP and CLI). Local tools on by default (ENABLE_LOCAL=false to disable). Three opt-ins: ghCloneRepo (MCP opt-in ENABLE_CLONE=true, CLI on by default), ghListReleases (ENABLE_RELEASES=true), and ghSearchDiscussions (ENABLE_DISCUSSIONS=true). Flags: Configuration.

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

GitHub Tools

ToolWhat it doesKnob
ghSearchCodeCode and path search across GitHub by owner, repo, path, filename, extension, and match filters. Accepts 1 to 5 parallel queries.concise
ghGetFileContentRead a GitHub file or region: full file, line range, match slice, or paginated chars.minify
ghViewRepoStructureBrowse a repository's directory tree, plus opt-in repo enrichments.include
ghSearchReposDiscover repositories by keywords, owner, topic, language, stars, updated, license, visibility.concise
ghSearchPullRequestsSearch pull requests, or deep-read one PR: files, patches, comments, reviews, commits.content
ghSearchIssuesSearch issues, or read one issue's body and comments.content
ghSearchCommitsWalk a repo's commit history, or compare two refs (base+head).includeDiff
ghListReleasesList releases + latest, with opt-in assets. Opt-in (ENABLE_RELEASES=true).includeAssets
ghSearchDiscussionsSearch a repo's Discussions (Q&A, RFCs, announcements) via GraphQL. Opt-in (ENABLE_DISCUSSIONS=true).keywordsToSearch
ghCloneRepoClone a repo or sparse subtree into the local cache for local/LSP analysis. Opt-in on MCP (ENABLE_CLONE=true; CLI on by default).sparsePath

Local Tools

ToolWhat it doesKnob
localSearchCodeLocal code/text search returning file and line anchors. mode:"structural" runs Octocode AST shape queries (pattern or rule).mode
localViewStructureBrowse a local directory tree: depth, filters, pagination, metadata.concise
localFindFilesFind local files and directories by name, path, regex, extension, size, time, permissions, type.
localGetFileContentRead a local file or region: exact slice, match string, line range, or paginated chars.minify

Package Search

ToolWhat it doesKnob
npmSearchnpm package lookup and keyword search; returns metadata and the source repository for GitHub handoff.concise

LSP

ToolWhat it does
lspGetSemanticsTyped semantic navigation: definition, references, callers, callees, callHierarchy, hover, documentSymbols, typeDefinition, implementation, workspaceSymbol, supertypes, subtypes, and diagnostic. From the CLI, invoke it directly: npx octocode tools lspGetSemantics --queries '<json>'. Navigation runs through installed language servers (see the LSP Tools Reference).

Full schemas, fields, and examples for every tool live in docs/OCTOCODE_TOOLS.md (linked under Documentation).


MCP

The MCP server exposes the Octocode tool catalog directly to your AI assistant over stdio.

https://github.com/user-attachments/assets/de8d14c0-2ead-46ed-895e-09144c9b5071

Manual Configuration

Add to your MCP client config. Pick the package that matches the version you want:

New Octocode (Rust-powered engine) — use @octocodeai/mcp:

{
  "octocode": {
    "command": "npx",
    "type": "stdio",
    "args": [
      "@octocodeai/mcp@latest"
    ]
  }
}

Classic octocode-mcp — use octocode-mcp:

{
  "octocode": {
    "command": "npx",
    "type": "stdio",
    "args": [
      "octocode-mcp@latest"
    ]
  }
}

Add a GitHub token and options under env — see Authentication and Configuration.


CLI

Same research engine, no MCP client needed. Local paths route to local tools; owner/repo[/path] routes to GitHub.

npx octocode auth login   # authenticate once
npx octocode status       # verify setup
npx octocode --help       # full usage

Commands

Tools

CommandWhat it does
npx octocode tools <name> --schemeShow one tool's schema: fields, types, bounds, defaults
`npx oct

View source on GitHub