JSPM

  • Created
  • Published
  • Downloads 1666
  • Score
    100M100P100Q108994F
  • License MIT

Model Context Protocol (MCP) server for advanced GitHub repository analysis and code discovery. Provides AI assistants with powerful tools to search, analyze, and understand codebases across GitHub.

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 with the Model Context Protocol (MCP)

Octocode Logo

Version License Node.js Version Ask DeepWiki Trust Score

🤖 What is MCP?

Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. Octocode MCP is an official community server that gives your AI assistant superpowers for code research to add quality context for your AI agents.

🚀 Quick Start

Get up and running in 2 minutes with your preferred authentication method:

Perfect for developers who already use GitHub CLI

# 1. Install GitHub CLI (if not already installed)
# macOS: brew install gh
# Windows: winget install --id GitHub.cli
# Linux: See https://github.com/cli/cli#installation

# 2. Authenticate with GitHub
gh auth login

# 3. Add to your MCP configuration
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": ["octocode-mcp@latest"]
    }
  }
}

Option 2: GitHub Personal Access Token

Great for CI/CD, Windows users, or when you prefer token-based auth

  1. Create a token: Go to GitHub Settings → Developer settings → Personal access tokens
  2. Select scopes: repo, read:user, read:org (see detailed scope guide)
  3. Configure MCP:
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": ["octocode-mcp@latest"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    }
  }
}

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

🔗 MCP Assistant Integration

Octocode MCP works with any MCP-compatible AI assistant:

🏢 Enterprise & Advanced Setup

Advanced Configuration Options

export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"              # GitHub token
export TOOLS_TO_RUN="githubSearchCode,githubSearchPullRequests" # 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.

🔒 Security & Privacy

Octocode MCP is built with security-first principles:

  • Content Sanitization: Automatically detects and redacts API keys, tokens, and sensitive data
  • Smart File Filtering: Ignores sensitive paths, binaries, and non-searchable files for cleaner results

🚀 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
githubSearchPullRequests Search GitHub pull requests and code reviews ❌ No History

Default tools are automatically enabled and provide core GitHub research functionality. Non-default tools can be enabled using the configuration options below.

📚 Complete Documentation

🚀 Getting Started

Resource Description
🌐 octocode.ai Interactive tutorials and community
🔐 Authentication Guide Complete setup for GitHub CLI, tokens, OAuth, and enterprise
📚 Usage Guide Examples, best practices, and prompt templates

🛠️ Technical Reference

Resource Description
🔧 Tool Schemas Complete API reference for all 7 tools with parameters
🏗️ Architecture Overview System design, security, and performance details

🚨 Troubleshooting

Need help? GitHub Issues