Skip to main content
Glama

Octocode MCP

by bgauryy

githubSearchCode

Search code across GitHub repositories using GitHub's API. Optimize queries with single terms, filters, and parallel searches for comprehensive results.

Instructions

Search code across GitHub repositories using GitHub's code search API via GitHub CLI.

SEARCH STRATEGY FOR BEST RESULTS:

ALWAYS START WITH BROAD QUERIES!

TERM OPTIMIZATION:

  • BEST: Single terms for maximum coverage
  • GOOD: 2-3 minimal terms with AND logic (all must be present in same file)
  • AVOID: Complex multi-term combinations - they're restrictive
  • Start broad, then narrow with filters or separate queries

MULTI-SEARCH STRATEGY:

  • Use separate searches for different aspects
  • Multiple simple queries > one complex query
  • Each search targets different code patterns or concepts
  • Parallel execution provides comprehensive coverage

Filter Usage:

  • Use filters to narrow scope after broad initial searches
  • Combine strategically: language + owner/repo for precision
  • Start without filters, then refine based on results

Input Schema

NameRequiredDescriptionDefault
queriesYesArray of up to 5 different search queries for parallel execution

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "queries": { "description": "Array of up to 5 different search queries for parallel execution", "items": { "additionalProperties": false, "properties": { "extension": { "description": "File extension filter", "type": "string" }, "filename": { "description": "Target specific filename or pattern", "type": "string" }, "id": { "description": "Optional identifier for the query", "type": "string" }, "language": { "description": "Programming language filter", "type": "string" }, "limit": { "description": "Maximum results per query (1-100)", "maximum": 100, "minimum": 1, "type": "integer" }, "match": { "description": "Search scope: file (content) or path (filenames)", "enum": [ "file", "path" ], "type": "string" }, "minify": { "default": true, "description": "Optimize content for token efficiency (enabled by default). Removes excessive whitespace and comments. Set to false only when exact formatting is required.", "type": "boolean" }, "owner": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "Repository owner/organization name" }, "queryTerms": { "description": "Search terms with AND logic - ALL terms must be present in same file. Use sparingly: single terms get broader results, multiple terms are restrictive.", "items": { "type": "string" }, "type": "array" }, "repo": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "Repository name (use with owner for specific repo)" }, "sanitize": { "default": true, "description": "Sanitize content for security (enabled by default). Removes potential secrets and malicious content. Set to false only when raw content is required.", "type": "boolean" }, "size": { "description": "File size filter in KB", "pattern": "^(>=?\\d+|<=?\\d+|\\d+\\.\\.\\d+|\\d+)$", "type": "string" }, "visibility": { "description": "Repository visibility", "enum": [ "public", "private", "internal" ], "type": "string" } }, "type": "object" }, "maxItems": 5, "minItems": 1, "type": "array" } }, "required": [ "queries" ], "type": "object" }
Install Server

Other Tools from Octocode MCP

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bgauryy/octocode-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server