# bgauryy/octocode-mcp [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/bgauryy/octocode-mcp  
**GitHub Stars:** 927  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bgauryy-octocode-mcp

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

## Tools
Capabilities this server exposes over MCP:

- **ghSearchCode** — Code and path search across GitHub by owner, repository, path, filename, extension, and match filters. Accepts 1 to 5 parallel queries.
- **ghGetFileContent** — Read a GitHub file or region: full file, line range, match slice, or paginated chars.
- **ghViewRepoStructure** — Browse a repository's directory tree, plus opt-in repository enrichments.
- **ghSearchRepos** — Discover repositories by keywords, owner, topic, language, stars, updated, license, visibility.
- **ghSearchPullRequests** — Search pull requests, or deep-read one PR: files, patches, comments, reviews, commits.
- **ghSearchIssues** — Search issues, or read one issue's body and comments.
- **ghSearchCommits** — Walk a repository's commit history, or compare two refs (`base`+`head`).
- **ghListReleases** — List releases and the latest stable release, with opt-in assets. **Opt-in** (see [Tools](#tools) for the flags).
- **ghSearchDiscussions** — Search a repository's Discussions (Q&A, RFCs, announcements) through GraphQL. **Opt-in** (see [Tools](#tools) for the flags).
- **ghCloneRepo** — Clone a repository or sparse subtree into the local cache for local and LSP analysis. **Opt-in** on MCP (`ENABLE_CLONE=true`); on by default in the CLI.
- **localSearchCode** — Local code/text search returning file and line anchors. `mode:"structural"` runs Octocode AST shape queries (`pattern` or `rule`).
- **localViewStructure** — Browse a local directory tree: depth, filters, pagination, metadata.
- **localFindFiles** — Find local files and directories by name, path, regex, extension, size, time, permissions, type.
- **localFindDeadCode** — Find likely-unreferenced exports and dead-code clusters using whole-repository reachability analysis.
- **localGetFileContent** — Read a local file or region: exact slice, match string, line range, or paginated chars.
- **npmSearch** — npm package lookup and keyword search; returns metadata and the source repository for GitHub handoff.
- **lspGetSemantics** — Typed 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 --querie…

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "octocode-mcp": {
    "command": "npx",
    "args": ["-y","octocode"],
    "env": {
      "ENABLE_CLONE": ""
    }
  }
}
```

**Requires environment variables:** `ENABLE_CLONE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the bgauryy/octocode-mcp MCP server does

The bgauryy/octocode-mcp MCP server exposes one research-oriented toolset for local code, GitHub, and npm. It is intended for questions that require inspecting source, tracing changes, or comparing implementation patterns across repositories. Results are designed to provide compact context with file and line anchors rather than returning an entire codebase at once.

The server supports both external and local research. GitHub tools can search code, repositories, pull requests, issues, commits, releases, and Discussions. npm search returns package metadata and the related source repository, allowing an agent to move from package discovery to GitHub inspection. Local tools work against files and directories available to the process.

## How it works

The MCP process uses the same toolset and Rust-backed engine as the project’s CLI. A client starts the server over stdio with Node.js and sends tool calls using MCP. The tool catalog includes broad search operations followed by narrower reads, such as retrieving only a matched file region, line range, or character page.

Local code search can use ordinary text matching or structural AST queries. LSP operations provide semantic navigation such as definitions, references, callers, callees, call hierarchies, symbols, hover information, type relationships, implementations, and diagnostics. A repository can also be cloned into the local cache for local and LSP analysis; cloning is enabled by default in the CLI but must be enabled for MCP.

The README describes minification and skeletonization for reducing boilerplate in results, support for more than 70 languages, smart pagination, and secret redaction before data is returned to the model. These behaviors are part of the shared engine described by the project.

## Setup and configuration

The documented prerequisite is Node.js 20.12 or newer. The MCP configuration runs the package with `npx`:

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

The bgauryy/octocode-mcp MCP server can be added through client-specific installation links for Cursor and Windsurf, or through the project’s general installation flow. The README also shows a Claude Code command. For direct execution, the project’s own CLI is started with `npx octocode`; its tools can be invoked as CLI commands as well as through MCP.

GitHub authentication is optional. Logging in with the CLI can unlock private repositories and higher GitHub API rate limits. The README says to place a GitHub token and other options in the MCP client’s environment configuration, but the supplied material does not specify the environment variable names.

## Tools and capabilities

- Search GitHub code with owner, repository, path, filename, extension, and match filters; up to five queries can run in parallel.
- Read complete or selected GitHub and local file content using ranges, matches, or pagination.
- Browse repository trees and local directory structures with filtering and pagination.
- Search repositories, pull requests, issues, commits, npm packages, and GitHub Discussions.
- Inspect a pull request or issue in depth, including related files, patches, comments, reviews, commits, and issue comments.
- Compare GitHub commit references and inspect releases, including optional release assets.
- Clone repositories or sparse subtrees for local analysis when `ENABLE_CLONE=true` is set for MCP.
- Run local text or AST searches, find files, identify likely dead code, and use LSP semantic queries.

## Limitations and notes

Release and Discussion tools are opt-in. Repository cloning is also opt-in for MCP and requires `ENABLE_CLONE=true`; the CLI enables cloning by default. GitHub authentication is not required for basic operation, but unauthenticated access may not provide private-repository access or the higher rate limits available after login.

The provided material does not document a hosted endpoint, Claude Desktop compatibility, exact token environment variable names, or a license. The package configuration shown in the README uses `octocode-mcp@latest`; the repository name and package name should not be assumed to identify a different distribution.

_Full upstream README: https://allmcps.com/mcp/bgauryy-octocode-mcp/readme_

