Feedback

Octocode MCP Server

@bgauryy Claim

Basic information

Runtime
TypeScript
Version
1.0.0
Category
License
MIT
Transports
stdio
Author
bgauryy
Submitted by
Community
Quality
25
Stars
741

About Octocode MCP Server

Octocode seamlessly integrates with GitHub CLI and npm for fast code discovery, repo analysis, and commit tracking with smart caching.

Octocode is a MCP server in the Ai Ml category listed in the AddMCP.net directory, published by bgauryy. It exposes 6 tools, including githubSearchCode, githubGetFileContent, githubViewRepoStructure, githubSearchRepositories and more. Supported transport: stdio. Runtime: TypeScript. License: MIT. The repository has 741 GitHub stars. Source code is hosted on github.com. Related topics: agent, ai, ai-agents, ai-assistant, ai-ml.

Setup

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

Octocode MCP Server config

Add this server to your MCP-compatible client using the configuration below.

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

Octocode MCP Server tools

  • githubSearchCode — ## Search file content or files by path <when> - Find code patterns | Locate files | Discovery - Find File (`match="path"`), Find Pattern (`match="file"`) </when> <fromTool> - self: Refine query | Try semantic variants | Switch `match="path"↔"file"` (BFS/DFS) - githubGetFileContent: Read full content of found matches - githubViewRepoStructure: Locate file in directory tree - githubSearchRepositories: Find other repositories - githubSearchPullRequests: Find history/blame for file - packageSearch: Check imported packages </fromTool> <gotchas> - FILTERS: 1-2 filters safe. 3+ filters risky. NEVER combine extension+filename+path (returns empty). - PATHS: Strict prefix matching. `path:pkg` finds `pkg/file`, NOT `parent/pkg/file`. Verify with githubViewRepoStructure. - AVOID: Broad terms | Finding package repos (use `packageSearch`). - Start lean: single filter → verify results → add one filter at a time. - Prefer specifying owner & repo for precision and cost. </gotchas> <examples> - owner="facebook", repo="react", match="path", keywordsToSearch=["utils"] - owner="facebook", repo="react", keywordsToSearch=["useState"], match="file", limit=10 - owner="facebook", repo="react", path="src/api", extension="ts", keywordsToSearch=["export"] </examples>31:T4b
  • githubGetFileContent
  • githubViewRepoStructure — ## Display directory structure <when> - Understand repo structure (layout, configs, implementations) | Discover file paths. - Workflow: Map Root (`depth=1`) → Drill Down (`path` + `depth=2`) → Locate Files. </when> <output> - Returns `structure`: Record<dirPath, {files: string[], folders: string[]}> - Returns `summary`: {totalFiles, totalFolders, truncated, filtered, originalCount} - Keys are relative paths ("." = root, "src" = src/) - Auto-filters: 85+ directories (.git, node_modules, dist, build, etc.) - Truncation: Max 200 items (50 per depth level). Check summary.truncated </output> <fromTo
  • githubSearchRepositories
  • githubSearchPullRequests — ## Search or fetch Pull Requests (metadata, diffs, discussions) <when> - Implementation history | Review changes | Find changes - Workflow: Review PR Meta (type=metadata) → Check specific diff (type=partialContent) - Use type=fullContent on small PRs only </when> <fromTool> - SELF: Refine query | Try semantic variants | Check related PRs | Widen date range. - Other: Find changes or known issues in repository </fromTool> <gotchas> - AVOID: Fetching large changes (fullContent - token-heavy) - prNumber ignores all other filters. </gotchas> <examples> - prNumber=123, type="metadata" (specific PR) - owner="org", repo="repo", state="closed", merged=true, limit=3 - prNumber=123, type="partialContent", partialContentMetadata=[{"file": "src/app.ts"}] </examples>
  • packageSearch

Overview

What is Octocode?

Octocode is an AI-powered code assistant that provides advanced search and discovery across GitHub and NPM ecosystems. It uses heuristic algorithms with smart fallbacks to understand connections between repositories and NPM packages across public, private, and organization repositories. It is designed for developers and technical researchers who want to explore code intelligently.

How to use Octocode?

Install Node.js 18.12+ and GitHub CLI, then authenticate with gh auth login (and optionally npm login). Add "octocode-mcp" to your MCP configuration with npx octocode-mcp. Octocode automatically works with your repositories — just ask natural language questions. It is also available as a Desktop Extension (DXT) for Claude Desktop.

Key features of Octocode

  • AI-powered search with heuristic pattern recognition and automatic fallbacks
  • Connection mapping between NPM packages and GitHub repositories
  • Zero-config security using GitHub CLI OAuth — no tokens needed
  • Universal access to public, private, and organization repositories
  • Advanced content minification reduces LLM token usage by 80‑90%
  • 10 specialized tools for discovery, analysis, activity, and content

Use cases of Octocode

  • Understand how popular libraries implement specific patterns (e.g., React concurrent rendering)
  • Find authentication patterns in frameworks like Next.js
  • Compare implementations across projects (e.g., React vs Vue.js rendering)
  • Analyze code from specific commits, PRs, or historical versions
  • Build tutorials or examples by discovering real-world code snippets

Frequently asked questions

1 How does Octocode authenticate?

It uses GitHub CLI (gh) OAuth flow — no personal access tokens needed. Works with SSO, 2FA, and organization access.

2 What are the runtime requirements?

Node.js 18.12+ and GitHub CLI. NPM login is optional for package research.

3 Where does my data live?

Octocode runs 100% locally on your machine — no data collection or telemetry is transmitted.

4 How does Octocode differ from other GitHub MCPs?

While others focus on project management or basic operations, Octocode provides AI-powered code discovery and deep technical research across the entire GitHub and NPM ecosystem.

5 What transport and auth does Octocode use?

It uses the MCP protocol via command-line transport (npx). Authentication is handled entirely through the GitHub CLI, with no separate tokens or configuration needed.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬