GuMCP server implementation for interacting with GitHub using OAuth authentication.
- Python 3.11+
- A GitHub OAuth App created at GitHub Developer Settings
- A local OAuth config file with your GitHub
client_id,client_secret, andredirect_uri
Create a file named oauth.json:
{
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"redirect_uri": "http://localhost:8080"
}.gitignore.
Before running the server, you need to authenticate and store your OAuth token:
python main.py authThis will:
- Print a GitHub OAuth URL for you to open in your browser.
- Prompt you to paste the
codeafter granting access. - Store the token securely using your
auth_client.
You only need to do this once per user.
This server exposes the following tools for interacting with GitHub:
create_repositoryβ Create a new repositorysearch_repositoriesβ Search for repositorieslist_public_user_repositoriesβ List all public repositories for the given user usernamelist_organization_repositoriesβ List all repositories for the given organization nameget_contentsβ Get the contents of a file or in a repositorylist_repository_languagesβ List all languages used in a repositoryadd_file_to_repository- Add a file to a repository with a commit messagelist_commitsβ List all commits for a repository by branchget_commitβ The api provides commit content with read accessstar_repositoryβ Star a repository for the authenticated userlist_stargazersβ List all stargazers for a repositoryget_stargazers_countβ Get the number of stargazers for a repositorylist_starred_repos_by_userβ List all repositories starred by the userlist_issuesβ List all issues for a repositoryget_issueβ Get a specific issue for a repositorycreate_issueβ Create a new issue for a repositoryupdate_issueβ Update a specific issue for a repositoryadd_comment_to_issueβ Add a comment to a specific issue for a repositorylist_branchesβ List all branches for a repositorylist_pull_requestsβ List all pull requests for a repositoryget_pull_requestβ Get a specific pull request for a repositorycreate_pull_requestβ Create a new pull request for a repository
You can launch the server for local development using:
./start_remote_dev_server.shThis will start the GuMCP server and make it available for integration and testing.
If you have a local client for testing, you can run it like:
python RemoteMCPTestClient.py --endpoint http://localhost:8000/github/localAdjust the endpoint path as needed based on your deployment setup.
- This implementation uses OAuth instead of a static token for improved security and multi-user support.
- Each user's OAuth access token is securely stored via your
auth_client. - The
github_oauth_client.jsonfile contains your app's secret credentials and should never be committed to version control. - This server integrates with GuMCP agents for tool-based LLM workflows.
- Make sure you've set the Anthropic API key in your
.envif you're using LLM toolchains.