bgauryy/octocode-mcp
If you are the rightful owner of octocode-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Octocode MCP is a smart assistant designed to enhance AI agents by providing enriched code context, enabling better code handling, documentation, and complex ecosystem solutions.
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.
Table of Contents
- See It In Action
- Installation
- Octocode CLI
- More Examples
- Overview
- Tools
- Commands
- Documentation
- Local Research
- Community
- License
See It In Action
Full-Stack Application Built in Under 10 Minutes
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
Research and Build Fullstack Agentic Application with /research command in Under 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:
- 🎯 Intelligent Tool Orchestration: Automatically selects and combines the right Octocode tools (repository search, code search, file content, PR analysis, repo structure) based on your research needs
- 🧠 Smart Decision Making: Makes strategic choices throughout the research flow—when to search broadly vs. specifically, which repositories to explore, and how to validate findings
- 👥 Multi-Purpose Research: Perfect for feature discovery (product managers), code understanding (developers), bug investigation, flow analysis, planning from scratch, dependency tracking, security audits, and more
- 🔬 Specialized Workflows: Handles Technical Research (code flows), Product Research (docs+code validation), Pattern Analysis (cross-repo comparison), Bug Investigation, Architecture Mapping, API Research, Security/Auth flows, and more
- 🔍 Transparent Reasoning: Shows you exactly which tools it's using, what it's searching for, and why at each step
- 🎨 Adaptive Strategy: Works across public repos, private organizations, and specific repositories with configurable depth (overview, deep dive, or cross-repo comparison)
- 📊 Cross-Validated Results: Leverages multiple Octocode tools to verify information from different sources and perspectives
- 🚀 Actionable Insights: Delivers implementation-ready plans with code examples, not just raw information
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
Discover APIs, Frameworks, and Dive Into Internal Implementation Details
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
Installation
🚀 Octocode CLI (Recommended)
The easiest way to install Octocode MCP, skills, and other MCP servers.
npx octocode-cli
The interactive CLI will:
- ✅ Auto-detect your IDEs (Cursor, VS Code, Claude Desktop, etc.)
- ✅ Install and configure Octocode MCP with one click
- ✅ Set up GitHub authentication
- ✅ Optionally install AI skills and other MCP servers
Learn more about Octocode CLI →
Standalone Binary (No Node.js Required)
curl -fsSL https://raw.githubusercontent.com/bgauryy/octocode-mcp/main/install/install.sh | sh
— Manual downloads, MCP configs, troubleshooting
npm / npx (Requires Node.js)
Prerequisites
- Node.js >= 18.12.0
- GitHub Authentication (choose one):
- GitHub CLI (recommended): Install from cli.github.com and run
gh auth login - Personal Access Token: Create at github.com/settings/tokens with scopes:
repo,read:user,read:org
- GitHub CLI (recommended): Install from cli.github.com and run
Getting started
First, 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.
Amp
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
Claude Code
Use the Claude Code CLI to add the Octocode MCP server:
claude mcp add octocode npx octocode-mcp@latest
Claude Desktop
Follow the MCP install guide, use the standard config above.
Codex
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.
Cursor
Click the button to install:
Or install manually:
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.
Project-Specific Configuration
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"]
}
}
}
Cline
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"
]
}
}
}
Gemini CLI
Follow the MCP install guide, use the standard config above.
Goose
Click the button to install:
Or install manually:
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".
Kiro
Follow the MCP Servers documentation. For example in .kiro/settings/mcp.json:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": [
"octocode-mcp@latest"
]
}
}
}
LM Studio
Click the button to install:
Or install manually:
Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above.
opencode
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
}
}
}
Qodo Gen
Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
Click Save.
VS Code
Click the button to install:
Or install manually:
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.
Warp
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"
]
}
}
}
Windsurf
Follow Windsurf MCP documentation. Use the standard config above.
Zed
Follow the MCP Servers documentation. Use the standard config above.
Authentication Methods
Octocode MCP supports two authentication methods:
Option 1: GitHub CLI (Recommended)
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).
Option 2: Personal Access Token
When to use: CI/CD environments, automation, or if GitHub CLI isn't available
- Create a token at github.com/settings/tokens
- Select scopes:
repo,read:user,read:org - Add to your MCP configuration:
{
"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.
Verify Installation
After installation, verify Octocode MCP is working:
- Restart your MCP client completely
- Check connection status:
- Cursor: Look for green dot in Settings → Tools & Integrations → MCP Tools
- Claude Desktop: Check for "octocode" in available tools
- VS Code: Verify in GitHub Copilot settings
- Test with a simple query:
Search GitHub for React hooks implementations
If you see Octocode tools being used, you're all set! 🎉
Octocode CLI
One-command setup for Octocode, MCP servers, and AI skills across all your IDEs.
The Octocode CLI is an interactive tool that simplifies the installation and management of:
- 🐙 Octocode MCP - Install and sync across Cursor, VS Code, Claude Desktop, and more
- 🧠 AI Skills - Browse marketplace, install bundled skills, manage your skill library
- ⚡ System MCPs - Add and configure popular MCP servers from a curated registry
Quick Install
npx octocode@latest
Or install globally:
npm install -g octocode
octocode
Features
| Feature | Description |
|---|---|
| Multi-IDE Support | Automatically detects and configures Cursor, VS Code, Claude Desktop, Windsurf, and more |
| Skills Marketplace | Browse 7+ community skill sources with 170+ skills available |
| Bundled Skills | Official Octocode skills for research, planning, PR review, and code generation |
| MCP Registry | 50+ curated MCP servers ready to install with one click |
| GitHub Auth | Quick browser-based OAuth or GitHub CLI integration |
| Sync Across IDEs | Keep your MCP configuration in sync across all supported clients |
Interactive Menu
🐙 Octocode MCP - Install/sync Octocode across IDEs
🧠 Manage System Skills - Browse marketplace, install & manage skills
⚡ Manage System MCP - Add popular MCP servers to your setup
Learn More
- What are Skills? - Learn about Claude Code skills
- - Full CLI documentation
GitHub Enterprise Support
Octocode MCP supports GitHub Enterprise Server instances with custom API URLs.
Configuration
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 .
More Examples
Additional Demonstrations
ThreeJS Implementation Quality Comparison
Side-by-side comparison showing:
- Generic AI: Basic implementation with common patterns
- Octocode-Enhanced AI: Production-grade implementation with advanced techniques from real projects
Key Differences:
- Performance optimizations from high-performance projects
- Proper resource management patterns
- Industry-standard error handling
- Real-world edge case handling
Deep Technical Research
YouTube: React Hooks Internals
Demonstrates progressive research workflow:
- Repository discovery (React source)
- Structure exploration (hooks implementation)
- Code analysis (internal mechanisms)
- Comprehensive explanation with code references
Overview
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.
Core Capabilities
| 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 |
Tools
Octocode provides five specialized research tools designed to work together for comprehensive code analysis:
🔍 githubSearchCode
Find code implementations across repositories
Search for specific code patterns, functions, or implementations across millions of repositories.
Key Features:
- Content Search: Find code inside files by keywords (AND logic)
- Path Search: Discover files/directories by name (25x faster)
- Smart Filtering: Scope by repository, path, file extension, or popularity
- Context-Rich Results: Returns code snippets with surrounding context
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"
📚 githubSearchRepositories
Discover repositories by topics and keywords
Your starting point for repository discovery - find the right projects to analyze.
Key Features:
- Topic-Based Discovery: Search by exact GitHub topics (most precise)
- Keyword Search: Find repos by name, description, or README content
- Quality Filters: Filter by stars, language, size, activity
- Sorting Options: By popularity, recency, or relevance
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'"
🗂️ githubViewRepoStructure
Explore repository directory structure
Understand how a project is organized before diving into specific files.
Key Features:
- Directory Tree: Visual representation of folder structure
- File Sizes: See file sizes to identify important components
- Depth Control: Explore 1 level (overview) or 2 levels (detailed)
- Path Targeting: Navigate directly to specific directories
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"
📄 githubGetFileContent
Read file contents with smart extraction
Retrieve specific content from files efficiently - full files or targeted sections.
Key Features:
- Pattern Matching: Extract sections matching specific patterns with context
- Line Range Reading: Read specific line ranges for efficiency
- Full Content Access: Get entire file when needed
- Content Minification: Automatic optimization for token efficiency
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"
🔀 githubSearchPullRequests
Analyze pull requests, changes, and discussions
Understand how code evolved, why decisions were made, and learn from production changes.
Key Features:
- PR Discovery: Search by state, author, labels, dates
- Direct Access: Fetch specific PR by number (10x faster)
- Code Diffs: Include full diff content to see what changed
- Discussions: Access comment threads and review discussions
- Merged Code: Filter for production-ready, merged changes
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"
Commands
Octocode MCP provides intelligent prompt commands that enhance your research workflow:
/research - Expert Code & Product Research
Powerful 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:
- Understanding repository workflows: Discover how repositories work, trace specific flows through codebases, and understand technical implementations
- Cross-repository flow analysis: Understand complex flows that span multiple repositories, trace data flows across microservices
- Deep technical investigations: Trace code flows, understand complex implementations, analyze architecture decisions
- Bug investigation: Find root causes by analyzing code, commit history, and related PRs
- Pattern discovery: Compare implementations across multiple repos to find best practices
- Documentation validation: Verify docs match actual code behavior
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 Tasks
Your 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:
- Building new features: Research patterns, plan architecture, then implement
- Complex refactoring: Understand current state, plan migration path, execute safely
- Learning new technologies: Research best practices, create learning plan, build incrementally
- System design: Explore existing implementations, design your approach, validate decisions
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 Review
Args: 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:
- Defects & Bugs: Logic errors, edge cases, race conditions, null handling
- Security Issues: Injection vulnerabilities, auth bypasses, data exposure
- Performance: N+1 queries, memory leaks, inefficient algorithms
- Code Quality: Complexity, maintainability, test coverage gaps
- Best Practices: Design patterns, error handling, documentation
Usage:
/review_pull_request prUrl: https://github.com/facebook/react/pull/12345
/review_security - Security Audit
Args: 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:
- Authentication & Authorization: Auth flows, session management, access controls
- Input Validation: Injection points, sanitization, boundary checks
- Secrets Management: Hardcoded credentials, API keys, configuration security
- Dependencies: Known vulnerabilities, outdated packages, supply chain risks
- Data Protection: Encryption, PII handling, data flow security
Usage:
/review_security repoUrl: https://github.com/your-org/your-repo
Tips for Using Commands
- Use
/researchfor code exploration - Deep dive into how things work - Use
/planfor building - Research, plan, then implement complex features - Use
/review_pull_requestbefore merging PRs for thorough code review - Use
/review_securityfor security audits of repositories
💡 Pro Tip: Combine
/researchand/planfor maximum effectiveness—research existing patterns first, then plan your implementation with confidence.
Documentation
Comprehensive Guides
| Resource | Description | Link |
|---|---|---|
| Binary Installation | Standalone binary download and setup | |
| Configuration Guide | Environment variables and server configuration | |
| Authentication Guide | Setup instructions and troubleshooting |
Local Research
Octocode Local brings the power of Octocode's research capabilities to your local filesystem with LSP-powered code intelligence.
An MCP server that provides AI assistants with powerful tools for local code exploration, combining fast Unix utilities with semantic code understanding through Language Server Protocol (LSP) integration.
Core Capabilities
| Capability | Implementation | Benefit |
|---|---|---|
| Pattern Search | ripgrep integration | 10x faster than grep, respects .gitignore |
| Code Intelligence | LSP integration | Go-to-definition, find references, call hierarchy |
| Smart Navigation | Directory analysis | Structure exploration with filtering and sorting |
| File Discovery | Metadata search | Find by name, time, size, permissions |
| Secure Access | Workspace scoping | Automatic secrets filtering, no indexing required |
Quick Install
{
"mcpServers": {
"octocode-local": {
"command": "npx",
"args": [
"octocode-mcp-local@latest"
]
}
}
}
Tools
📁 localViewStructure
Explore directory structure with depth control and filtering
Navigate your codebase hierarchy, understand project organization, and discover important files.
• Project overview: "Show me the structure of src/ with depth 2"
• Find components: "List all directories in app/components"
• Discover patterns: "Show files sorted by modification time"
🔍 localSearchCode
Fast pattern search powered by ripgrep
Find code patterns, function definitions, or text across your entire codebase in milliseconds.
• Find implementations: "Search for 'useAuth' in TypeScript files"
• Locate patterns: "Find all TODO comments in src/"
• Discovery mode: "List files containing 'export default'"
📂 localFindFiles
Find files by metadata (name, time, size, permissions)
Locate files based on properties rather than content—perfect for finding recent changes or specific file types.
• Recent changes: "Find files modified in the last 7 days"
• By name: "Find all *.test.ts files"
• By size: "Find files larger than 1MB"
📄 localGetFileContent
Read file contents with smart extraction
Retrieve specific sections using pattern matching or line ranges—avoid loading entire files into context.
• Pattern matching: "Show me the validateUser function with 10 lines of context"
• Line ranges: "Read lines 50-100 from api/handler.ts"
• Full content: "Get the entire package.json file"
LSP Tools (Code Intelligence)
Octocode Local includes Language Server Protocol integration for semantic code understanding—go beyond text search to understand code relationships.
🎯 lspGotoDefinition
Navigate to where symbols are defined
Jump directly to function definitions, class declarations, or variable origins.
• "Go to the definition of handleSubmit"
• "Where is UserContext defined?"
• "Find the source of this imported function"
🔗 lspFindReferences
Find all usages of a symbol
Discover everywhere a function, variable, or type is used across your codebase.
• "Find all references to validateToken"
• "Where is the User type used?"
• "Show all calls to this API function"
🌳 lspCallHierarchy
Trace function call relationships
Understand code flow by seeing who calls a function (incoming) and what it calls (outgoing).
• "Who calls the authenticate function?" (incoming)
• "What functions does processPayment call?" (outgoing)
• "Trace the flow from API handler to database"
When to use: Flow tracing, understanding code paths, impact analysis before refactoring.
Research Workflows
Octocode Local tools work together in powerful combinations:
The Discovery Flow
localViewStructure → localSearchCode → localGetFileContent
Map structure → Find patterns → Read details
The Semantic Flow
localSearchCode → lspGotoDefinition → lspFindReferences
Find text → Jump to definition → Trace usages
The Flow Analysis
localSearchCode → lspCallHierarchy(incoming) → lspCallHierarchy(outgoing)
Find function → See callers → See callees
Use Cases
| Task | Recommended Approach |
|---|---|
| Understand new codebase | localViewStructure → localSearchCode → lspGotoDefinition |
| Find where function is used | localSearchCode → lspFindReferences |
| Trace code flow | localSearchCode → lspCallHierarchy |
| Find recent changes | localFindFiles(modifiedWithin="7d") |
| Read specific code section | localGetFileContent(matchString="functionName") |
| Impact analysis | lspGotoDefinition → lspCallHierarchy(incoming) |
👉
Community
Get Support
- GitHub Discussions: Ask questions, share ideas
- GitHub Issues: Report bugs, request features
Show Your Support
If Octocode helps your AI development workflow:
- Star the repository on GitHub
- Share on social media with #OctocodeMCP
License
MIT - See for details.