Octocode MCP
A server for semantic code search and context generation across public and private repositories using LLMs.
Octocode MCP - Smart Assistant for Code Context Creation
The missing piece for AI agents that need quality code context. Transform any AI assistant into a code research expert that enriches context for better code handling, documentation, and complex ecosystem solutions.
π― Why Octocode MCP?
Octocode MCP closes the codeβcontext gap by giving AI assistants secure, real-time access to public/private code anywhere so they reason from real implementations and have a better, more quality context.
π Core capabilities
- π context generation from code anywhere
- π Smart semantic code discovery
- π Learn and search anything from top public repositories
- π§ Discover anything from complex multiβrepo scenarios
- ποΈ Ecosystemβaware solutions across stacks and orgs
- π Docs and example enrichment from production code
- π Progressive research flows for deep understanding
π‘ Ideal for
- Code creation, complex bug fixes, architecture insight, documentation, learning, and navigating large codebases...
π Quick Setup
Prerequisites
- Node.js >= 18.12.0
- GitHub Authentication (choose one method below)
Authentication Setup
Option 1: GitHub CLI (Recommended)
# Install GitHub CLI if needed
# macOS: brew install gh
# Windows: winget install --id GitHub.cli
# Authenticate
gh auth login
Option 2: Personal Access Token
- Create token at GitHub Settings β Personal Access Tokens
- Required scopes:
repo
,read:user
,read:org
MCP Configuration
Add to your AI assistant's MCP configuration:
With GitHub CLI:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"]
}
}
}
With Personal Access Token:
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp@latest"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
That's it! Your AI assistant can now search and analyze GitHub repositories.
π οΈ Available Research Tools
Tool | Purpose | Default | Description |
---|---|---|---|
githubSearchCode | Code Discovery | β | Search code across repositories with semantic queries |
githubSearchRepositories | Repository Discovery | β | Find repositories by topic, language, or description |
githubViewRepoStructure | Structure Analysis | β | Explore repository file structure and navigation |
githubGetFileContent | Content Access | β | Fetch specific files or code sections with context |
githubSearchPullRequests | History Analysis | β | Analyze pull requests and code changes |
Default tools are automatically enabled. Non-default tools require configuration (see Advanced Setup below).
π― Real-World Context Creation Examples
Code Creation Context:
"I need to implement OAuth2 in my Node.js app - show me real implementations"
β Finds proven OAuth2 patterns β Analyzes security practices β Provides implementation context
Complex Ecosystem Solutions:
"How do large organizations handle microservices communication?"
β Discovers enterprise patterns β Examines real architectures β Explains design decisions
Documentation Enhancement:
"Find real examples of GraphQL error handling for my API docs"
β Searches GraphQL implementations β Extracts error patterns β Provides documentation examples
Best Practices Discovery:
"What are the current best practices for React state management in 2024?"
β Analyzes modern React apps β Compares state solutions β Identifies trending patterns
See the dramatic difference in AI assistant capability: π― Live Demo: ThreeJS Code Creation Comparison
This interactive comparison shows how Octocode MCP transforms AI assistants from providing generic code suggestions to delivering expert-level, context-rich implementations with real-world patterns and best practices.
πΊ Examples
Example 1: Deep code research with Octocode
- Prompt:
Explain deeply how React hooks work under the hood, using information from code and documents.
Provide a technical explanation, covering both basic and advanced concepts.
Do a deep research
- Video: YouTube
Example 2: Learn about AI Agents using Octocode
- Goal: Create context for agents creation
- Video: YouTube
Example 3: Review PRs using Octocode
- Video: YouTube
βοΈ Advanced Configuration
Tool Selection
# Run only specific tools (exclusive mode)
export TOOLS_TO_RUN="githubSearchCode,githubSearchRepositories"
# Enable additional tools (additive mode)
export ENABLE_TOOLS="githubSearchPullRequests"
# Disable specific default tools
export DISABLE_TOOLS="githubViewRepoStructure"
# Enable experimental features
export BETA="1"
Note: TOOLS_TO_RUN
cannot be combined with ENABLE_TOOLS
/DISABLE_TOOLS
.
Enterprise Features
- Content Sanitization: Automatic detection and redaction of sensitive data
- Smart Token Management: Efficient content reduction for large codebases
- Access Control: Uses your GitHub permissions (public/private repositories)
- Rate Limiting: Built-in GitHub API rate limit handling
π Documentation & Resources
Resource | Description |
---|---|
π octocode.ai | Official website |
πΊ YouTube Channel | Video tutorials and demos |
π Usage Guide | 20+ examples and best practices |
π Authentication Guide | Complete setup and enterprise features |
π§ Tool Schemas | Complete API reference for all tools |
ποΈ Architecture Overview | System design and performance details |
π§° octocode-utils | Utility library for token-efficient minification and helpers used by Octocode |
π Featured On
Official Community MCP Server
Community Collections
punkpeye/awesome-mcp-servers
appcypher/awesome-mcp-servers
wong2/awesome-mcp-servers
Puliczek/awesome-mcp-security
MCP Directories & Tools
π¬ Support & Community
- Issues & Bugs: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: octocode.ai
Related Servers
TouchDesigner MCP
Control and operate TouchDesigner projects with AI agents using the Model Context Protocol.
POC MCP HTTP Server
A proof-of-concept server implementing the Model Context Protocol with a streamable HTTP transport.
MCP Options Order Flow Server
A high-performance MCP server for comprehensive options order flow analysis.
Terragrunt-Docs
Terragrunt documentation always up to date.
VideoDB
Server for advanced AI-driven video editing, semantic search, multilingual transcription, generative media, voice cloning, and content moderation.
MCP Hello World
A minimal MCP server mock in TypeScript for testing MCP clients, supporting both STDIO and HTTP/SSE protocols.
Liveblocks
Interact with the Liveblocks REST API to manage rooms, threads, comments, and notifications, with read access to Storage and Yjs.
Context Portal MCP (ConPort)
A server for managing structured project context using SQLite, with support for vector embeddings for semantic search and Retrieval Augmented Generation (RAG).
MCP Chart Server
Generates TradingView chart visualizations using the Chart-IMG API.
UnityNaturalMCP
An MCP server implementation for the Unity game engine that enables a natural user experience.