← Back to directory
O

Octocode MCP - AI Context Platform

Community
Evidence-first code research for AI agents
GitHub source repository ↗
★ 898 Stars Category · Dev Tools Very popular
64FMRS · C
Reliability
10/20
Security and permissions
14/20
Maintenance
12/20
Documentation
15/20
Setup experience
13/20

The supplied materials describe an active stdio MCP server at version 16.2.0 under the MIT license, providing GitHub, local filesystem, npm, LSP, and OQL code-research capabilities.

Read the FMRS scoring method →

Octocode MCP exposes code research tools to AI assistants over stdio. It supports GitHub and local code search, repository structure browsing, precise file reads, AST structural matching, LSP semantic navigation, npm package search, pull request history research, and OQL queries. The MCP server and CLI share a Rust-backed engine for minification, structural extraction, pagination, and secret scanning.

Tools

ghSearchCode
Search GitHub code and paths by owner, repository, path, filename, extension, and match filters.
ghGetFileContent
Read a GitHub file or region, including full files, line ranges, match slices, and paginated content.
ghViewRepoStructure
Browse a GitHub repository directory tree.
ghSearchRepos
Discover repositories by keywords, owner, topic, language, stars, forks, size, dates, license, and visibility.
ghHistoryResearch
Search pull request history or deeply read one pull request's files, patches, comments, reviews, and commits.
localSearchCode
Search local code or text and run AST structural queries.
localViewStructure
Browse a local directory tree with depth, filters, and pagination.
localFindFiles
Find local files and directories by name, path, regular expression, extension, size, time, permissions, or type.
localGetFileContent
Read a local file or region by exact slice, match string, line range, or pagination.
npmSearch
Look up npm packages and return metadata plus their GitHub source repository.
lspGetSemantics
Use LSP to retrieve definitions, references, callers, callees, call hierarchy, hover data, symbols, and type relationships.
oqlSearch
Run OQL queries across code, content, structure, files, semantics, repositories, packages, pull requests, commits, diffs, and research targets.

Setup

Start the server with npx octocode-mcp@latest using stdio and add the supplied JSON configuration to an MCP client. GitHub tools require authentication through npx octocode auth login, GitHub CLI, or OCTOCODE_TOKEN, GH_TOKEN, or GITHUB_TOKEN. Repository cloning is disabled by default for MCP and requires ENABLE_CLONE=true.

claude_desktop_config.json
{"octocode":{"command":"npx","type":"stdio","args":["octocode-mcp@latest"]}}

Fit and risk

Best for

  • AI agents and developers conducting evidence-first code research.
  • Teams analyzing both local workspaces and GitHub repositories.
  • Code review, refactoring, and architecture work requiring semantic navigation, structural search, and compact context.

Not for

  • Users seeking browser automation, cloud storage, collaboration, or database operations.
  • Environments that cannot grant local workspace or GitHub access.
  • Clients requiring a transport other than stdio.

Required permissions

  • Local tools can access paths permitted by configuration; local tools are enabled by default.
  • GitHub tools require GitHub authentication; personal access tokens support repo, read:user, and read:org scopes.
  • When cloning is enabled, the server accesses GitHub repositories and uses a local cache.

Risks and side effects

  • Local tools may read code and files within permitted paths; the server blocks many sensitive files and directories.
  • GitHub tokens are sensitive credentials and should be supplied through environment variables or secure credential management, never committed to version control.
  • Secret scanning and automatic redaction may reduce returned-content completeness.
  • Enabling repository cloning expands local caching and external repository data handling.

Troubleshooting

  1. Run npx octocode status to check authentication and setup.
  2. If GitHub queries fail, check Octocode login status, GitHub CLI authentication, or token environment variables.
  3. For local-read failures, check WORKSPACE_ROOT, ALLOWED_PATHS, and path permissions.
  4. If cloning is unavailable, check whether ENABLE_CLONE=true is set.
  5. For Node.js issues, run npx node-doctor check --json.

Use cases

Verify local or GitHub code evidence before making changes.
Trace definitions, references, call relationships, and code structure with AST and LSP tools.
Research pull requests, commits, npm packages, and implementation patterns across repositories.
Create minified, skeletonized, or paginated context for large files.

Supported clients

CursorFull support
VS CodeFull support
VS Code InsidersFull support
WindsurfFull support
KiroFull support
GooseFull support
LM StudioFull support
Claude CodeFull support