/ Каталог / Песочница / octocode-mcp
● Сообщество bgauryy ⚡ Сразу

octocode-mcp

автор bgauryy · bgauryy/octocode-mcp

Semantic code research MCP — search across public and private repos using natural language, with LSP-powered go-to-definition and call hierarchy.

Octocode is an MCP server that gives your AI assistant senior-engineer-level code research skills. It combines GitHub and GitLab integration with local LSP intelligence (go-to-definition, find-references, call hierarchy) to search, understand, and generate context from any accessible codebase. Comes with 9 specialized skills for research, PR review, RFC generation, and more.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

octocode.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "octocode": {
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "octocode",
      "command": "npx",
      "args": [
        "-y",
        "octocode-mcp"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "octocode": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "octocode-mcp"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add octocode -- npx -y octocode-mcp

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: octocode-mcp

How to find real implementation patterns across repos with Octocode

👤 Developers looking for how others solved a specific problem ⏱ ~20 min intermediate

Когда использовать: You need to implement something (auth, caching, rate limiting) and want to see how real codebases do it, not just docs.

Предварительные требования
  • Octocode MCP installed — npx octocode-cli (interactive wizard) or add octocode-mcp to your MCP config
  • GitHub authentication — Follow the authentication setup guide in the repo docs
Поток
  1. Search for implementations
    Search across popular TypeScript repos for real implementations of rate limiting middleware. Show me the top 3 most-starred examples.✓ Скопировано
    → Code snippets from real repos with file paths and context
  2. Drill into the best one
    For the best example, use go-to-definition to trace how the rate limiter is configured and where it's applied in the middleware chain.✓ Скопировано
    → Full call chain from entry point to implementation
  3. Adapt for your project
    Based on that pattern, write a rate limiter for my Express app that uses Redis. Follow the same structure.✓ Скопировано
    → Production-ready code following verified patterns

Итог: A well-researched implementation based on real-world patterns, not hallucinated API calls.

Подводные камни
  • Searching too broadly returns noise — Scope to specific orgs or repos, and filter by language
Сочетать с: github · filesystem

Review a PR with full codebase context using Octocode

👤 Code reviewers who need to understand impact beyond the diff ⏱ ~15 min intermediate

Когда использовать: A PR touches a function you're not familiar with, and you need to understand all callers before approving.

Поток
  1. Analyze the changed function
    Use Octocode's find-references to show me every caller of the function modified in PR #42. Are any of them in hot paths?✓ Скопировано
    → Complete list of callers with context on criticality
  2. Check for breaking changes
    Does this signature change break any of those callers? Check the types.✓ Скопировано
    → Specific yes/no per caller with type analysis
  3. Generate review comments
    Draft 3 review comments: one about the breaking risk, one about test coverage, one about the naming choice.✓ Скопировано
    → Specific, line-level comments ready to post

Итог: A thorough PR review grounded in actual usage data, not guesswork.

Подводные камни
  • LSP not initialized for the language — Ensure the relevant language server is installed locally (e.g., tsserver for TypeScript)
Сочетать с: github

Onboard to an unfamiliar codebase in 30 minutes

👤 New team members or contractors ramping on a project ⏱ ~30 min beginner

Когда использовать: Day one on a new repo — you need the architecture in your head, fast.

Поток
  1. Get the high-level map
    Use Octocode to analyze this repo's structure. What are the main modules, entry points, and data flow?✓ Скопировано
    → Architecture overview with module boundaries
  2. Trace a key flow
    Trace the request flow from the API handler for POST /users to the database layer. Show me every function in the chain.✓ Скопировано
    → End-to-end call chain with file locations
  3. Identify conventions
    What patterns does this codebase use? Error handling style, logging, dependency injection, test structure.✓ Скопировано
    → Conventions list with code examples

Итог: A mental model of the codebase architecture, key flows, and conventions — enough to start contributing.

Подводные камни
  • Repo too large for a single analysis pass — Start with one module (e.g., 'just the API layer') and expand
Сочетать с: filesystem

Комбинации

Сочетайте с другими MCP — эффект x10

octocode + github

Octocode finds the pattern across repos, GitHub MCP creates the PR implementing it

Use Octocode to find how other repos handle JWT refresh tokens, then use GitHub MCP to create a PR implementing the best pattern in our repo.✓ Скопировано
octocode + filesystem

Octocode analyzes remote repos for patterns, filesystem MCP applies them to your local codebase

Research how nf-core handles CI configuration via Octocode, then write a similar .github/workflows/ci.yml for my project.✓ Скопировано
octocode + sentry

Sentry identifies the error, Octocode traces all callers to assess blast radius

Sentry shows an error in parseConfig(). Use Octocode to find all callers of parseConfig and assess which user flows are affected.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
search_code query: str, org?: str, repo?: str, language?: str Find code patterns across repos using natural language 1 GitHub API call
go_to_definition file: str, line: int, symbol: str Jump to where a function/class/type is defined Local LSP call
find_references file: str, line: int, symbol: str Find all callers of a function or users of a type Local LSP call
call_hierarchy file: str, line: int, symbol: str Understand the full call chain around a function Local LSP call
browse_directory path: str Explore repo structure Local file read
search_local query: str, path?: str Grep-like search in a local codebase Local file scan

Стоимость и лимиты

Во что обходится

Квота API
Inherits GitHub API limits: 5000 req/h for PAT, 30/min for code search. LSP calls are local and free.
Токенов на вызов
200-2000 tokens per tool response; large call hierarchies can hit 5k
Деньги
Free and open-source (MIT). You pay for your GitHub API usage and Claude tokens.
Совет
Use local tools (browse_directory, search_local) when possible — they're free and fast. Save GitHub API calls for cross-repo searches.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: repo:read (GitHub PAT)
Хранение учётных данных: GitHub PAT in environment variable. Configured during octocode-cli wizard.
Исходящий трафик: GitHub/GitLab API for remote searches. LSP and local tools stay on your machine.
Никогда не давайте: repo:write admin:org

Устранение неполадок

Частые ошибки и исправления

GitHub authentication failed

Re-run npx octocode-cli to reconfigure auth, or manually set your GitHub PAT in the environment

Проверить: curl -H 'Authorization: Bearer $GITHUB_TOKEN' https://api.github.com/user
LSP features (go-to-definition) not working

Ensure the relevant language server is installed: tsserver for TypeScript, pyright/pylsp for Python, gopls for Go

Проверить: Check that the language server binary is on your PATH
Search returns no results for private repos

Your GitHub PAT needs repo:read scope and must include the specific repo in its access list (fine-grained PAT)

npx octocode-mcp hangs on startup

Check Node.js version (18+ required). Clear npx cache: npx clear-npx-cache

Проверить: node --version

Альтернативы

octocode-mcp в сравнении

АльтернативаКогда использоватьКомпромисс
GitHub MCP (official)You only need basic code search and PR/issue management, not LSP intelligenceNo go-to-definition, no call hierarchy, no local codebase tools
SourcegraphYou need enterprise-grade code intelligence with a web UINot MCP-native; heavier setup; paid for private repos

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills