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 |
Capabilities
Features and capabilities supported by this server
| 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 | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/hareeshbounteous/github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server