Package Exports
- octocode-mcp
- octocode-mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (octocode-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Octocode MCP - AI-Powered GitHub Intelligence
Transform your AI assistant into a code research expert

Local Setup
For local development:
# 1. Authenticate with GitHub
gh auth login
# 2. Add to your MCP configuration
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp"]
}
}
}
That's it! Start asking your AI assistant about GitHub repositories and code.
What can Octocode do?
Search & analyze millions of GitHub repositories - Find real implementations, analyze code patterns, extract knowledge from commits and PRs, and connect packages to their source code automatically.
📋 Requirements
- Node.js >= 18.12.0 - Download here
- GitHub Authentication - GitHub CLI (recommended) or Personal Access Token
🔧 Alternative Setup Options
Need a different setup? Choose your preferred method:
GitHub Token (for Windows/CI/Production)
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Enterprise Setup
{
"mcpServers": {
"octocode": {
"command": "npx",
"args": ["octocode-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx",
"GITHUB_ORGANIZATION": "your-org"
}
}
}
}
📚 Need detailed setup help?
- Complete Authentication Guide - All authentication methods, OAuth, GitHub Apps, and enterprise features
- Installation Guide - Step-by-step setup for all environments
🔗 AI Assistant Integration
Claude Desktop setup:
claude mcp add -s user octocode npx 'octocode-mcp@latest'
Octocode works with any MCP-compatible AI assistant.
🚀 What You Can Do
🔍 Code Research & Discovery
- Search millions of repositories for real implementations and patterns
- Analyze code structure and explore directory trees
- Track development history through commits and pull requests
- Connect packages to source - bridge NPM/PyPI packages to their repositories
🎯 Example Use Cases
"Show me authentication patterns in React applications"
"Find TypeScript implementations of rate limiting"
"How does Stripe handle webhooks in their SDK?"
"Compare database migration patterns across frameworks"
🏢 Enterprise Features
For organizations: audit logging, access controls, rate limiting, and compliance features. → Enterprise Setup Guide
🛠️ Available Tools
Tool Name | Description | Default | Type |
---|---|---|---|
githubSearchCode |
Search code across GitHub repositories | ✅ Yes | Search |
githubGetFileContent |
Fetch file content from GitHub repositories | ✅ Yes | Content |
githubViewRepoStructure |
View GitHub repository structure and navigation | ✅ Yes | Content |
githubSearchRepositories |
Search and discover GitHub repositories | ✅ Yes | Search |
githubSearchCommits |
Search GitHub commits and change history | ❌ No | History |
githubSearchPullRequests |
Search GitHub pull requests and code reviews | ❌ No | History |
packageSearch |
Search NPM and Python package registries | ❌ No | NPM |
Default tools are automatically enabled and provide core GitHub research functionality. Non-default tools can be enabled using the configuration options below.
⚙️ Configuration & Advanced Setup
Most common settings:
export GITHUB_TOKEN="ghp_xxxxxxxxxxxx" # GitHub token
export TOOLS_TO_RUN="githubSearchCode,packageSearch" # Run ONLY these tools (exclusive)
export ENABLE_TOOLS="additionalTool1,additionalTool2" # Add non-default tools
export DISABLE_TOOLS="unwantedTool1,unwantedTool2" # Disable default tools
export BETA="1" # Enable experimental features
⚠️ Important: TOOLS_TO_RUN
cannot be used together with ENABLE_TOOLS
/DISABLE_TOOLS
. When TOOLS_TO_RUN
is set, it runs ONLY the specified tools, ignoring all other tool configuration.
📚 For complete configuration options:
- Environment Variables Reference - All settings, OAuth, enterprise features
- Tool Configuration Guide - Available tools and parameters
🚨 Troubleshooting
Common Issues:
- "No GitHub token found" → Setup GitHub authentication
- Rate limiting → Configure rate limits
- Enterprise setup → Enterprise guide
📚 Documentation & Help
Resource | Purpose |
---|---|
🌐 octocode.ai | Tutorials, community & latest updates |
📚 Usage Guide | Examples and best practices |
🔐 Authentication | Setup for all auth methods |
🛠️ Tool Reference | Complete API reference |
🏗️ Architecture | System design overview |
Need help? GitHub Issues • Discord • octocode.ai