GitHub Code MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GITHUB_REPO | No | Default repository name. | nexpose |
| MAX_FILE_KB | No | Maximum file size in KB that can be fetched. | 500 |
| GITHUB_OWNER | No | Default owner for repository operations. | anands-bounteous |
| GITHUB_TOKEN | No | GitHub personal access token. Optional for reading public repos, required for search_code. | |
| HTTP_TIMEOUT | No | HTTP timeout in seconds. | 30 |
| MCP_HTTP_HOST | No | Host for HTTP transport. | 127.0.0.1 |
| MCP_HTTP_PORT | No | Port for HTTP transport. | 8082 |
| FRAGMENT_BACKEND | No | Fragment backend: tree-sitter, regex, or auto. | auto |
| HTTP_MAX_RETRIES | No | Maximum number of HTTP retries on rate limit or 5xx. | 4 |
| GITHUB_DEFAULT_REF | No | Default git ref (branch or SHA) to use when none specified. | |
| GITHUB_API_BASE_URL | No | Base URL for GitHub API, overridable for GitHub Enterprise Server. | https://api.github.com |
| FRAGMENT_CONTEXT_LINES | No | Number of context lines around a match when falling back to context window. | 20 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
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
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_codeA | Search code in the repo for a query string; returns matching files with highlighted fragments showing exactly where the match occurs. Requires GITHUB_TOKEN. |
| get_file_contentsB | Fetch a file's contents, or a 1-indexed inclusive line range of it. |
| list_symbolsA | List the classes/interfaces/enums/records/methods/constructors declared in a Java file, with their line ranges — use this to find a symbol name to pass to get_code_fragment. |
| get_code_fragmentB | Extract one named class/method/constructor body from a Java file. Uses AST-accurate parsing when tree-sitter-java is installed, else a regex-based heuristic; falls back to a plain text-context window (match_type="context_window") if the symbol isn't a recognisable Java declaration. |
| list_directoryB | List the files and subdirectories at a path in the repo (default: repo root). |
| get_repository_infoC | Fetch repository metadata: description, default branch, language, topics. |
| get_readmeA | Fetch the repository's README as plain text. |
| list_branchesB | List branches with their latest commit sha. |
| list_commitsA | List recent commits, optionally scoped to a single file path. |
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 9 tools
Each tool targets a distinct resource and action: search_code queries, get_file_contents retrieves file content, list_symbols lists declarations, get_code_fragment extracts a symbol body, list_directory navigates, get_repository_info and get_readme provide different repo overview types, and list_branches/list_commits cover history. The related pairs (list_symbols/get_code_fragment, get_repository_info/get_readme) are clearly complementary with no functional overlap.
All tool names follow the same snake_case verb_noun pattern with a predictable verb choice: get_* for fetching single items, list_* for enumerating collections, and search_code for querying. This consistent structure makes the tool set easy to navigate.
Nine tools is well within the ideal 3-15 range for a focused code exploration server. Each tool has a clear purpose and collectively they cover the core aspects of reading and navigating a repository without redundancy.
The surface covers search, file contents, symbol extraction, directory listing, repo metadata, README, branches, and commits. Minor gaps exist, such as no direct diff viewing or fetching a file at a specific commit, but these are not critical blockers for typical code navigation workflows.