# Octocode MCP - AI Context Platform

Searches and reads code in your local project and on GitHub: ripgrep, AST search, file trees, precise reads, LSP. Useful when an agent needs context before editing.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 955
- Author: bgauryy
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/bgauryy/octocode
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/octocode-mcp-ai-context-platform

## What it does

Octocode is an MCP server for code research. One toolset covers local files and outside sources: GitHub repositories, pull requests, npm packages. A Rust engine keeps results compact so the model does not over-fetch tokens.

The agent picks what to ask for next: broad search first, then only the matched lines or region, with pagination and hints for the cheapest follow-up. Local paths go to local tools; `owner/repo[/path]` goes to GitHub. The same toolset runs as a CLI through `npx octocode`.

Node.js 20.12+ is required. A GitHub token is optional, but private repositories stay out of reach without it and API limits are lower. In a client config the token goes under `env`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GITHUB_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: GitHub

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add octocode-mcp -e GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add octocode-mcp-ai-context-platform --env GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "octocode-mcp-ai-context-platform": {
            "command": "npx",
            "args": [
                "-y",
                "octocode-mcp"
            ],
            "env": {
                "GITHUB_TOKEN": "<GITHUB_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "octocode-mcp-ai-context-platform": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "octocode-mcp"
            ],
            "env": {
                "GITHUB_TOKEN": "<GITHUB_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GITHUB_TOKEN=<GITHUB_TOKEN> octocode-mcp-ai-context-platform npx -y octocode-mcp
```
Replace <…> with your own values

## When to use it
- find where a function is called in the project
- read through someone else's repo before forking it
- trace which pull request introduced a pattern
- gather context on a file before refactoring
- look up usage examples for an npm package

## Example prompts
- Find every call to `authenticate` in the local project and show the lines.
- Walk through the `owner/repo` repository and explain how auth works.
- Show the schema for the `localSearchCode` tool.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
