The Github official MCP Server provides sufficient documentation on the tools that it exposes along with how to configure the same. You can pick your choice in terms of running it locally or remotely, since Gemini CLI supports remote MCP Servers too.
Once you have PAT, you will need to add the MCP Server object in the settings.json file. The complete settings.json file on my system is shown below. You might have additional settings, but the mcpServers object should be as given below:
{
"theme": "Default",
"selectedAuthType": "oauth-personal",
"mcpServers": {
"github": {
"httpUrl": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "GITHUB_PAT"
},
"timeout": 5000
}
}
}
You can either start Gemini CLI again or do a /mcp refresh command, once you have updated the settings.json with the Github MCP Server configuration. The screenshot below highlights the Github MCP Server that is configured on my machine and the various tools that are now available to the Gemini CLI to work with MCP.
An example question like this below
"Who am on GitHub?"
Notice that it will pick the correct tool from the Github MCP Server but as with other in-built Tools, this will also require that you provide explicit permission to invoke the tool. Go ahead and see what output you get.
You should now work with one of your Github projects. Give your queries in natural language like:
Describe the <repo-name> to me?
Clone the <repo-name> on my local machine.
Describe @<file-name> or @<directory-name>/
What are the different components of this repository?
I have made necessary changes. Can you push the changes to Github and use the Github MCP Server tools to do that.
No comments:
Post a Comment