Intelligent Code Context for AI Systems
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.
- See It In Action
- Installation
- More Examples
- Overview
- Architecture
- Features
- Commands
- Documentation
- Community
- Recognition
- License
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
Area.mp4Octocode Plan Document - Detailed architecture and step-by-step guide
Phase 2: Implementation
answer.mp4Result: 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:
- 🎯 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?
research_s.mp4Octocode 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.
research_octocode.mp4- 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
First, install the Octocode MCP server with your client.
Standard config works in most of the tools:
Note: This configuration uses GitHub CLI authentication. For Personal Access Token, see the Authentication Guide below.
AmpAdd via the Amp VS Code extension settings screen or by updating your settings.json file:
Amp CLI Setup:
Add via the amp mcp add command below:
Use the Claude Code CLI to add the Octocode MCP server:
Follow the MCP install guide, use the standard config above.
CodexUse the Codex CLI to add the Octocode MCP server:
Alternatively, create or edit the configuration file ~/.codex/config.toml and add:
For more information, see the Codex MCP documentation.
CursorGo 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:
Add via the Cline VS Code extension settings or by updating your cline_mcp_settings.json file:
Follow the MCP install guide, use the standard config above.
GooseGo 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".
KiroFollow the MCP Servers documentation. For example in .kiro/settings/mcp.json:
Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above.
opencodeFollow the MCP Servers documentation. For example in ~/.config/opencode/opencode.json:
Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
Click Save.
VS CodeFollow the MCP install guide, use the standard config above. You can also install the Octocode MCP server using the VS Code CLI:
After installation, the Octocode MCP server will be available for use with your GitHub Copilot agent in VS Code.
WarpGo 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:
Follow Windsurf MCP documentation. Use the standard config above.
ZedFollow the MCP Servers documentation. Use the standard config above.
Octocode MCP supports two authentication methods:
Advantages: Automatic token management, works with 2FA, supports SSO
Then use the standard configuration (no GITHUB_TOKEN needed).
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:
Security Tip: Never commit tokens to version control. Use environment variables or secure secret management.
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! 🎉
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
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
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.
| 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:
- 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:
Best Practices:
- Start with path search for discovery, then use content search for details
- Specify owner/repo to avoid rate limits
- Use extension filter for specific file types
- Set limit=5-10 for focused results
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:
Best Practices:
- Use topicsToSearch for curated, high-quality results
- Apply stars=">1000" filter for production-ready code
- Sort by stars for popular repos, updated for maintained projects
- Start broad, then narrow with specific filters
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:
Best Practices:
- Start with depth=1 at root for overview
- Use depth=2 for specific directories when you know the structure
- Navigate progressively: root → interesting folder → specific subfolder
- Use before reading files to understand project organization
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:
Best Practices:
- Use matchString with context lines for targeted reads (85% token savings)
- Use startLine/endLine for known locations
- Only use fullContent=true for small files or when you need everything
- Set minified=false for config files (JSON, YAML) to preserve formatting
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:
Best Practices:
- Use prNumber for direct access when you know the PR
- Filter state="closed" + merged=true for production code
- Set withContent=true only when you need to see code changes (expensive)
- Set withComments=true to understand context and decisions
- Use limit=3-5 for focused analysis
Octocode MCP provides intelligent prompt commands that enhance your research workflow:
Purpose: Systematic code research using decision-tree workflows
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, or analyze how different repos interact
- Technical flow investigation: Deep-dive into technical flows within or across repositories (even cross-repo dependencies and integrations)
- Real-world code examples: Learn from actual production code implementations, not just documentation or tutorials
- Deep technical investigations: Trace code flows, understand complex implementations, analyze architecture decisions
- Answering team questions: Quickly research Slack/Jira questions about features, APIs, or behavior with code-backed answers
- Bug investigation: Find root causes by analyzing code, commit history, and related PRs
- Organization features: Understand how features work across your private/public repositories
- Pattern discovery: Compare implementations across multiple repos to find best practices
- Documentation validation: Verify docs match actual code behavior
What it does:
- Provides systematic guidance through research stages (discovery → exploration → analysis → synthesis)
- Executes multiple queries in parallel for faster results
- Shows transparent reasoning at each step
- Adapts to different research types: code implementation, documentation validation, pattern comparison, or bug investigation
Usage Examples (by research type):
Technical Research (code-first, understanding implementations):
Product Research (docs + code validation):
Pattern Analysis (comparing multiple implementations):
Bug Investigation (root cause analysis):
Key Features:
- Progressive refinement (broad → specific → deep dive)
- Code-as-truth validation (verifies docs against actual implementation)
- Cross-repository pattern analysis (public & private repos)
- Comprehensive synthesis with Mermaid diagrams and cited references
- Perfect for answering technical questions from Slack/Jira with code evidence
Purpose: List and appreciate all GitHub repositories used in your research session
When to use:
- End of a research session to see what repos helped you
- Finding repositories to star and support
What it does:
- Analyzes conversation history
- Identifies all GitHub repositories explored via Octocode tools
- Creates formatted list with links and usage notes
- Reminds you to show appreciation to maintainers
Usage:
Output Example:
Purpose: Simple reminder of Octocode MCP capabilities and best practices
When to use:
- Quick refresher on available tools
- Learning key practices for efficient research
- Getting started with Octocode
What it covers:
- Code Discovery: Search repositories, explore structures, find patterns
- Deep Analysis: Read files, analyze PRs with diffs, track commits
- Research Workflow: Progressive refinement methodology
- Key Practices: Bulk queries, partial file access, search-first approach
Usage:
- Start with /use if you're new to Octocode MCP
- Use /research for all code research - This is the recommended way to use Octocode for any research task, providing structured guidance and optimal tool usage
- Run /kudos at the end of sessions to document sources and show appreciation
- Commands work in any MCP-compatible client (Claude, Cursor, etc.)
💡 Pro Tip: For any code research, start with /research in Octocode MCP. This command intelligently orchestrates all tools for you, optimizing your workflow, depth of analysis, and research quality.
| Official Website | Interactive tutorials, demos, community | octocode.ai |
| Usage Guide | 20+ real-world examples and best practices | USAGE_GUIDE.md |
| Authentication Guide | Setup instructions and troubleshooting | AUTHENTICATION.md |
| Tool Schemas | Complete API reference for all tools | TOOL_SCHEMAS.md |
| Architecture | System design, performance, internals | SUMMMARY.md |
| YouTube Channel | Video tutorials and demonstrations | Octocode on YouTube |
- GitHub Discussions: Ask questions, share ideas
- GitHub Issues: Report bugs, request features
- Documentation: Complete guides and references
- YouTube: Video tutorials and examples
If Octocode helps your AI development workflow:
- Star the repository on GitHub
- Share on social media with #OctocodeMCP
- Write about your experience on your blog
- Create tutorials and share with the community
- Contribute improvements and bug fixes
Built with care for developers by developers
Octocode MCP is an official MCP Community Server
MIT - See LICENSE for details.
.png)


