Octocode MCP — Claude Code MCP server: code research
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.
claude mcp add octocode-mcp -e GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcpWhat Octocode MCP - AI Context Platform 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.
What it helps with
- 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 for the agent
- Find every call to
authenticatein the local project and show the lines. - Walk through the
owner/reporepository and explain how auth works. - Show the schema for the
localSearchCodetool.
How to install Octocode MCP - AI Context Platform
Platform CLI
claude mcp add octocode-mcp -e GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcpReplace <…> with your own values
Platform CLI
codex mcp add octocode-mcp-ai-context-platform --env GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"octocode-mcp-ai-context-platform": {
"command": "npx",
"args": [
"-y",
"octocode-mcp"
],
"env": {
"GITHUB_TOKEN": "<GITHUB_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"octocode-mcp-ai-context-platform": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"octocode-mcp"
],
"env": {
"GITHUB_TOKEN": "<GITHUB_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GITHUB_TOKEN=<GITHUB_TOKEN> octocode-mcp-ai-context-platform npx -y octocode-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Octocode MCP - AI Context Platform
How do I install Octocode MCP in Claude Code?
Run claude mcp add octocode-mcp -e GITHUB_TOKEN=<GITHUB_TOKEN> -- npx -y octocode-mcp, replacing the token with your own.
What does Octocode MCP do?
It gives an agent tools to search and read code: ripgrep and AST search, file trees, precise reads, LSP. It works with local files as well as GitHub, PRs and npm.
Do I need a GitHub token?
No, but it unlocks private repositories and raises API limits. In a client config the token goes under env.