by bgauryy
Enables AI assistants to perform deep, semantic code search, repository analysis, and package discovery across public and private GitHub repositories, delivering structured, AI‑optimized context for development workflows.
Octocode MCP provides a comprehensive set of tools that let AI assistants analyze GitHub repositories, execute semantic code searches, inspect commits, PRs, and explore NPM/Python packages. It turns raw code bases into structured knowledge that can be consumed instantly by AI models.
npx octocode-mcp@latest
GITHUB_TOKEN environment variable, GH_TOKEN, or use the GitHub CLI).Q: Do I need a GitHub token?
A: Yes, for full functionality. Set GITHUB_TOKEN (or GH_TOKEN) or log in with the GitHub CLI.
Q: Can I use Octocode MCP with private repositories? A: Absolutely. Once authenticated, the server can access any repositories your token has permission to view.
Q: Which AI assistants are compatible? A: Any assistant that implements the Model Context Protocol, such as Claude, Cursor, and similar tools.
Q: How is the output formatted? A: JSON structures optimized for token efficiency, with optional natural‑language summaries.
Q: Is there an easy install for non‑technical users?
A: The recommended one‑liner with npx handles download and execution without a global install.
A Model Context Protocol (MCP) server enabling AI assistants to search, analyze, and extract insights from millions of GitHub repositories with enterprise-grade security and token efficiency.
Watch AI assistant use Octocode to research, plan, and build a complete chat application with Express backend.
Prompt:
Use Octocode MCP for Deep Research
I want to build an application with chat (front-end) that shows a chat window to the user. The user enters a prompt in the chat, and the application sends the prompt to an Express backend that uses AI to process the request.
Add a return box (to show the message returned from the AI) and loaders to the UI. I want to build an AI agent system in Node.js using LangChain and LangGraph. Can you research the latest patterns?
Please conduct thorough research on how to create this in the best way possible. Focus on repositories with good documentation and recent activity.
- Do a deep research
- Create a plan document
- Initiate the plan and create the application
Phase 1: Research & Planning
https://github.com/user-attachments/assets/4225ab98-ae2f-46dc-b3ce-7d117e552b8c
Octocode Plan Document - Detailed architecture and step-by-step guide
Phase 2: Implementation
https://github.com/user-attachments/assets/2aaee9f1-3592-438a-a633-255b5cbbb8e1
Result: Production-ready full-stack application with authentication, real-time features, and best practices - All in less than 10 minutes
Why use the /research command? Instead of manually searching through repositories and piecing together information, let the AI conduct comprehensive research for you:
Prompt:
/octocode/research How can I use LangChain, LangGraph, and similar open-source AI tools to create agentic flows between agents for goal-oriented tasks? Can you suggest UI frameworks I can use to build a full-stack AI application?
https://github.com/user-attachments/assets/82ed97ae-57a9-46ae-9acd-828a509e711b
Octocode excels at both broad discovery and deep code analysis. Whether you're exploring new APIs, finding frameworks, or understanding how popular libraries work under the hood, Octocode provides comprehensive answers in seconds.
First Prompt - Broad Discovery:
list top repositories for:
- Stock market APIs (Typescript)
- Cursor rules examples
- UI for AI
- Mobile development using React
- State management for React
What happens: Octocode searches across GitHub to find the most popular and well-maintained repositories for each category, analyzing stars, activity, documentation quality, and recent updates. You get curated lists with context about each repository's strengths.
Second Prompt - Deep Implementation Analysis:
How React implemented useState under the hood?
What happens: Octocode dives into React's source code, traces the implementation flow, analyzes the relevant files (ReactHooks.js, ReactFiberHooks.js), and explains the internal mechanics including fiber architecture, hook state management, and dispatcher patterns—all with code references and detailed explanations.
The Power: Move seamlessly from discovering what exists to understanding how it works in a single conversation. No manual repository hunting or code spelunking required.
https://github.com/user-attachments/assets/c184d5d4-c9b6-40a1-a55a-41cb9b3ecc4f
gh auth loginrepo, read:user, read:orgFirst, install the Octocode MCP server with your client.
Standard config works in most of the tools:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
}
Note: This configuration uses GitHub CLI authentication. For Personal Access Token, see the Authentication Guide below.
Add via the Amp VS Code extension settings screen or by updating your settings.json file:
"amp.mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
Amp CLI Setup:
Add via the amp mcp add command below:
amp mcp add octocode -- npx octocode-mcp@latest
Use the Claude Code CLI to add the Octocode MCP server:
claude mcp add octocode npx octocode-mcp@latest
Follow the MCP install guide, use the standard config above.
Use the Codex CLI to add the Octocode MCP server:
codex mcp add octocode npx "octocode-mcp@latest"
Alternatively, create or edit the configuration file ~/.codex/config.toml and add:
[mcp_servers.octocode]
command = "npx"
args = ["octocode-mcp@latest"]
For more information, see the Codex MCP documentation.
Go to Cursor Settings -> MCP -> Add new MCP Server. Name to your liking, use command type with the command npx octocode-mcp@latest. You can also verify config or add command like arguments via clicking Edit.
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"]
}
}
}
Add via the Cline VS Code extension settings or by updating your cline_mcp_settings.json file:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
}
Follow the MCP install guide, use the standard config above.
Go to Advanced settings -> Extensions -> Add custom extension. Name to your liking, use type STDIO, and set the command to npx octocode-mcp@latest. Click "Add Extension".
Follow the MCP Servers documentation. For example in .kiro/settings/mcp.json:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
}
Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above.
Follow the MCP Servers documentation. For example in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"octocode": {
"type": "local",
"command": [
"npx",
"octocode-mcp@latest"
],
"enabled": true
}
}
}
Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
Click Save.
Follow the MCP install guide, use the standard config above. You can also install the Octocode MCP server using the VS Code CLI:
# For VS Code
code --add-mcp '{"name":"octocode","command":"npx","args":["octocode-mcp@latest"]}'
After installation, the Octocode MCP server will be available for use with your GitHub Copilot agent in VS Code.
Go to Settings -> AI -> Manage MCP Servers -> + Add to add an MCP Server. Use the standard config above.
Alternatively, use the slash command /add-mcp in the Warp prompt and paste the standard config from above:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
}
Follow Windsurf MCP documentation. Use the standard config above.
Follow the MCP Servers documentation. Use the standard config above.
Octocode MCP supports two authentication methods:
Advantages: Automatic token management, works with 2FA, supports SSO
# Install GitHub CLI
# macOS
brew install gh
# Windows
winget install --id GitHub.cli
# Linux
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md
# Authenticate
gh auth login
Then use the standard configuration (no GITHUB_TOKEN needed).
When to use: CI/CD environments, automation, or if GitHub CLI isn't available
repo, read:user, read:org{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
Security Tip: Never commit tokens to version control. Use environment variables or secure secret management.
After installation, verify Octocode MCP is working:
Search GitHub for React hooks implementations
If you see Octocode tools being used, you're all set! 🎉
Octocode MCP supports GitHub Enterprise Server instances with custom API URLs.
Add the GITHUB_API_URL environment variable to your MCP configuration:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"],
"env": {
"GITHUB_TOKEN": "your_token",
"GITHUB_API_URL": "https://github.company.com/api/v3"
}
}
}
}
Default: If not specified, defaults to https://api.github.com (public GitHub).
Note: Ensure your GitHub Enterprise token has the same scopes as documented in the Authentication Guide.
Side-by-side comparison showing:
Key Differences:
YouTube: React Hooks Internals
Demonstrates progressive research workflow:
Octocode is an agentic code research platform that bridges the gap between AI assistants and real-world code implementations. By providing structured access to GitHub's vast repository ecosystem, it enables AI systems to learn from production codebases rather than relying solely on training data.
| Capability | Implementation | Benefit |
|---|---|---|
| Code Discovery | Multi-dimensional search across repositories, code, and pull requests | Find relevant implementations in seconds |
| Context Extraction | Smart content retrieval with pattern matching and line-range targeting | Get exactly the context you need |
| Token Optimization | Advanced minification strategies (50+ language support) | 30-70% reduction in token consumption |
| Security | Automatic secrets detection and content sanitization | Enterprise-grade data protection |
| Progressive Research | Workflow-driven exploration (Discover → Explore → Analyze) | Deep understanding of complex systems |
| Access Control | GitHub permission-based access to public and private repositories | Organization-wide code research |
Octocode provides five specialized research tools designed to work together for comprehensive code analysis:
Find code implementations across repositories
Search for specific code patterns, functions, or implementations across millions of repositories.
Key Features:
Common Use Cases:
• Find implementation examples: "How do popular repos implement OAuth?"
• Discover patterns: "Search for React custom hooks in vercel repos"
• Locate functions: "Find error handling patterns in Express apps"
Discover repositories by topics and keywords
Your starting point for repository discovery - find the right projects to analyze.
Key Features:
Common Use Cases:
• Find popular implementations: "Discover TypeScript CLI tools with >1000 stars"
• Research ecosystems: "Find all React state management libraries"
• Organization research: "List all repos from microsoft with topic 'ai'"
Explore repository directory structure
Understand how a project is organized before diving into specific files.
Key Features:
Common Use Cases:
• Project overview: "Show me the structure of facebook/react"
• Find entry points: "Explore src/ directory in a monorepo"
• Understand architecture: "Navigate to the API implementation folder"
Read file contents with smart extraction
Retrieve specific content from files efficiently - full files or targeted sections.
Key Features:
Common Use Cases:
• Read specific functions: "Get the validateUser function from auth.ts"
• Extract sections: "Show me all the middleware definitions in app.js"
• Read configuration: "Get the full package.json file"
• Analyze specific code: "Read lines 100-150 from the API handler"
Analyze pull requests, changes, and discussions
Understand how code evolved, why decisions were made, and learn from production changes.
Key Features:
Common Use Cases:
• Learn from changes: "Show recent merged PRs about authentication"
• Understand decisions: "Find PRs discussing the API redesign with comments"
• Track implementations: "See how feature X was implemented with diffs"
• Expert contributions: "Find PRs by @author in the last 6 months"
Octocode MCP provides intelligent prompt commands that enhance your research workflow:
/research - Expert Code & Product ResearchPowerful research prompt leveraging Octocode's full capabilities for deep code discovery, documentation analysis, pattern identification, and bug investigation. Orchestrates parallel bulk queries with staged analysis to uncover insights fast.
When to use:
Usage Examples:
/research How does React's useState hook work internally?
/research Compare state management approaches: Redux vs Zustand vs Jotai
/research Why is the payment webhook failing? Trace the error through payment-service
/plan - Research, Plan & Implement Complex TasksYour AI architect for tackling complex development work. Breaks down ambitious tasks into actionable steps, researches existing patterns and implementations, then guides you through execution—all powered by Octocode's deep codebase intelligence.
When to use:
Usage Examples:
/plan Build a real-time chat application with WebSocket support
/plan Migrate our authentication from JWT to OAuth2
/plan Implement a plugin system for our CLI tool
/review_pull_request - Comprehensive PR ReviewArgs: prUrl (required) - GitHub Pull Request URL (e.g., https://github.com/owner/repo/pull/123)
Expert-level PR review with a Defects-First mindset. Dives deep into code changes, spots bugs before they ship, flags complexity risks, and delivers actionable feedback that elevates code quality.
What it analyzes:
Usage:
/review_pull_request prUrl: https://github.com/facebook/react/pull/12345
/review_security - Security AuditArgs: repoUrl (required) - GitHub repository URL (e.g., https://github.com/owner/repo)
Comprehensive security analysis of a repository. Identifies vulnerabilities, reviews authentication/authorization patterns, checks for secrets exposure, and provides remediation guidance.
What it analyzes:
Usage:
/review_security repoUrl: https://github.com/your-org/your-repo
/research for code exploration - Deep dive into how things work/plan for building - Research, plan, then implement complex features/review_pull_request before merging PRs for thorough code review/review_security for security audits of repositories💡 Pro Tip: Combine
/researchand/planfor maximum effectiveness—research existing patterns first, then plan your implementation with confidence.
| Resource | Description | Link |
|---|---|---|
| Configuration Guide | Environment variables and server configuration | CONFIGURATION.md |
| Authentication Guide | Setup instructions and troubleshooting | AUTH_GUIDE.md |
octocode-mcp-local brings the power of Octocode's research capabilities to your local filesystem.
An MCP server that provides AI assistants with native Unix tools for local code exploration. Built on ripgrep for pattern search, find for file metadata queries, and ls for directory traversal.
ripgrep for high-performance regex searching{
"mcpServers": {
"octocode-local": {
"command": "npx",
"args": [
"octocode-mcp-local@latest"
]
}
}
}
👉 Get Started with Octocode Local
If Octocode helps your AI development workflow:
MIT - See LICENSE for details.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
],
"env": {
"GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
}
}
}
}claude mcp add octocode npx octocode-mcp@latest