gh-search-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GITHUB_PAT | No | GitHub personal access token, read from the environment when the server starts. Optional: without a token, search_repositories and get_file_contents work with lower GitHub rate limits, while search_code is refused with an explanatory error. | |
| GITHUB_TOKEN | No | Fallback GitHub token used when GITHUB_PAT is not set. Optional, with the same consequences as having no token. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Searches public GitHub data only. Build query with GitHub search qualifier
syntax (language:, stars:>N, topic:, repo:, user:, org:, in:path, and so on);
natural-language words are also accepted. Sort is relevance unless you ask otherwise.
After a search, get_file_contents opens what you found: a file by path, a directory
listing, or (with recursive) a repository's whole tree. All three serve public
repositories only.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_repositoriesB | Search public GitHub repositories by keyword and qualifiers. Results are always restricted to public repositories. |
| search_codeA | Search code in public GitHub repositories. Results from private repositories are never returned. |
| get_file_contentsA | Read a text file, list a directory, or show a repository's tree, in a public GitHub repository. Use it after a search to open what you found. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 3 tools
The three tools target clearly distinct operations: repository search, code search, and file/directory retrieval. There is no realistic way to confuse search_repositories with search_code, and get_file_contents is unambiguously the read/open step.
All names follow a consistent snake_case verb_noun pattern (search_repositories, search_code, get_file_contents). Verb choice is semantically accurate and uniform across the set.
Three tools is lean but each has a clear role in a search-then-read workflow. It sits at the thin end of the appropriate range, with no redundant tools.
The search-and-read loop is closed, but GitHub search spans issues, commits, users, and topics — none of which are exposed — and there is no way to fetch repository-level metadata (description, stars, default branch). Agents can work around this only by inferring from raw file listings.