Cookee24/GithubFetcher
3.2
If you are the rightful owner of GithubFetcher and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project provides a streamlined way for large models to access specific code files and metadata from GitHub, minimizing unnecessary data retrieval.
Tools
7
Resources
0
Prompts
0
GitHub Fetcher
This project aims to provide a simple way for large models to access code files in GitHub and to minimize noise in the context.
An MCP server that surfaces a focused set of GitHub-read endpoints (repos, tags, branches, trees, files, stats, search) over stdio so agents can fetch just the code and metadata they need.
Quick start
- Install Rust (edition 2024) and ensure
cargois available. - Export a GitHub token (recommended to avoid rate limits):
export GITHUB_AUTH_TOKEN=ghp_yourtoken. - Run the server:
cargo run -- --token-env GITHUB_AUTH_TOKEN. - Point your MCP client at the stdio transport; by default all tools are enabled. Limit exposure with
--tools get_repo,list_repos,tree(comma-separated).
CLI flags
--api-base(https://api.github.comdefault): override for GitHub Enterprise or testing.--token: personal access token; if omitted,--token-envis used.--token-env(GITHUB_AUTH_TOKENdefault): env var name to read the token from; set to an empty string to skip env lookup.--tools: restrict which tools are exposed (get_repo,list_tags,list_branches,tree,get_file,list_repos,search,get_stats).
Notes on responses
treeandget_statsemittypevalues:file,dir,symlink, orsubmodule.get_filecan trim content byline_rangeormax_chars(UTF-8 safe). Ranges are 1-based and inclusive; strings like1..200,1...200,..200,1..,1:200,1:,:200, or a single numberNmeaning lines1..=N.list_repostransparently tries both user and org scopes.
Tools, inputs, and outputs
get_repo
- Input:
owner(string),repo(string) - Output:
repo(nullable) withdescription(string?),stars(u64),forks(u64),license(object? withkey,name,spdx_id,url)
list_tags
- Input:
owner(string),repo(string) - Output:
tags(array of tag names)
list_branches
- Input:
owner(string),repo(string) - Output:
branches(array of branch names)
list_repos
- Input:
owner(string),page(usize?, optional),per_page(usize?, optional) - Output:
repos(array) withname,full_name,private(bool),description(string?),html_url
tree
- Input:
owner(string),repo(string),path(string?, defaults to root),depth(usize, defaults to1, minimum1),ref(string?, git ref) - Output:
entries(array of tree nodes) each withtype,name,size(u64?),target(string? for symlink),submodule_git_url(string?),children(nested entries)
get_file
- Input:
owner(string),repo(string),path(string),ref(string?, git ref),line_range(string formats like1..200,1...200,..200,1..,1:200,1:,:200, or a numberN),max_chars(usize?) - Output:
content(string, decoded and optionally trimmed)
search
- Input:
query(string, supports GitHub code search qualifiers),page(usize?, optional),per_page(usize?, optional) - Output:
results(array) withname,path,repository(fullowner/repo)
get_stats
- Input:
owner(string),repo(string),path(string),ref(string?, git ref) - Output:
itemwithtype,name,path,size(u64?),target(string?),submodule_git_url(string?)
Development
- Format is handled by
rustfmt; run tests withcargo test. - The server speaks MCP over stdio using
rmcp; no HTTP server is exposed.