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 for Code Research & Discovery

What is Octocode?
Octocode transforms your AI assistant into a code research expert. Instead of just writing code, your AI can now:
- ๐ Search millions of repositories for real implementations
- ๐ Analyze code patterns from production codebases
- ๐ Extract knowledge from commits, PRs, and issues
- ๐ข Access private repositories for organizational intelligence
- ๐ Connect packages to their source code automatically
Built on the Model Context Protocol (MCP), Octocode provides AI assistants with 8 specialized tools for GitHub repository analysis, code discovery, and package exploration.
The Problem: AI assistants are great at writing code but struggle with understanding existing codebases and finding proven patterns.
The Solution: Octocode makes any codebase instantly accessible and comprehensible to AI assistants.
๐ Documentation
Quick Links
- ๐ Usage Guide - Complete guide with examples and best practices
- ๐๏ธ Technical Architecture - Detailed system architecture and implementation
- ๐ ๏ธ Tool Schemas - Complete API reference and tool specifications
- ๐ Octocode Ecosystem - Explore the complete Octocode suite
๐ก Pro Tip: Understanding the tool schemas will significantly improve your Octocode effectiveness.
โก Quick Start
Prerequisites
- Node.js v20+ (check with
node --version
) - GitHub Authentication (Personal Access Token or GitHub CLI)
- NPM (Optional, enhances package research capabilities)
- AI Assistant (Claude Desktop, or any MCP-compatible assistant)
Authentication Options
Octocode supports flexible GitHub authentication with smart fallback:
- GitHub CLI (Recommended for local development) - Run
gh auth login
for seamless authentication - Personal Access Token (Recommended for Windows & hosted environments) - Set
GITHUB_TOKEN
orGH_TOKEN
environment variable - Authorization Header (For API integrations) - Set
Authorization
environment variable withBearer {{token}}
format
Performance Optimizations
NPM Integration: Automatically enhances package research when NPM is available
For CI/CD environments:
# As environment variable export NPM_TOKEN=your_token_here # Then in .npmrc: //registry.npmjs.org/:_authToken=${NPM_TOKEN}
PyPI Integration: Discovers Python package repository URLs for comprehensive analysis
๐ Installation
๐ Quick Configuration
Option 1: GitHub CLI Authentication ๐ข Recommended
Best for Mac and local development
Install and authenticate with GitHub CLI:
# Install GitHub CLI (if not already installed) # macOS: brew install gh # Windows: winget install GitHub.cli # Authenticate gh auth login
Add to your MCP configuration:
{ "octocode": { "command": "npx", "args": ["octocode-mcp"] } }
๐ก Tip: This method provides seamless, secure access to your GitHub resources without managing tokens.
Option 2: Personal Access Token
Best for Windows, CI/CD, or hosted environments
Create a GitHub token:
- Go to GitHub Settings โ Personal Access Tokens
- Generate a new token with appropriate permissions
Add to your MCP configuration:
{ "octocode": { "command": "npx", "args": ["octocode-mcp"], "env": { "GITHUB_TOKEN": "your_github_token_here" } } }
Option 3: Authorization Header Format
Best for API integrations and templated configurations
{
"octocode": {
"command": "npx",
"args": ["octocode-mcp"],
"env": {
"Authorization": "Bearer your_github_token_here"
}
}
}
๐ก Note: Supports template formats like
Bearer {{GH_TOKEN}}
for dynamic token injection.
Authentication Fallback Chain
Octocode uses an intelligent authentication system that tries multiple methods in priority order:
GITHUB_TOKEN
- Primary GitHub token environment variableGH_TOKEN
- Alternative GitHub token environment variable- GitHub CLI Token - Automatically extracted from
gh auth login
session Authorization
Header - Extracts token from Bearer format (Bearer {{token}}
), supporting template variables
๐ฆ DXT Extension
Desktop Extension (DXT) for one-click installation in Claude Desktop.
yarn install && yarn dxt:pack
Install the generated octocode-mcp.dxt
file by clicking on it in Claude Desktop.
Enterprise/Production Deployment
Ideal for: Team environments, Docker containers, CI/CD pipelines, hosted AI services
Feature | Details |
---|---|
Authentication | GitHub Personal Access Tokens or GitHub App tokens |
Rate Limits | 5,000 requests/hour (higher with GitHub Apps) |
Access Control | Managed by token scope and permissions |
Setup | Configure GITHUB_TOKEN environment variable |
๐ณ Docker Support
Run Octocode MCP in a containerized environment with full GitHub authentication support. Perfect for consistent deployments and team environments.
โ Complete Docker Setup Guide
๐ก๏ธ Security & Privacy
Enterprise-Grade Security
- ๐ก๏ธ Advanced Content Protection - Multi-layer input validation and intelligent content sanitization
- ๐ Comprehensive Secret Detection - Automatic detection and redaction of API keys, tokens, and credentials
- โช Safe Commands Only - Pre-approved GitHub CLI and NPM commands with parameter validation
- ๐งน Malicious Content Filtering - Automatic detection and sanitization of harmful code patterns
- ๐ Security Pattern Analysis - Built-in vulnerability and compliance issue identification
๐ License
MIT License - See LICENSE for details.
Made with โค๏ธ by the Octocode team