github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

Github MCP tool doesnt work with Gemini CLI in codespaces

Open snerajan opened this issue 1 month ago • 4 comments

Followed the installation guide here.Method 1: Gemini Extension (Recommended) The simplest way is to use GitHub's hosted MCP server via our gemini extension.

gemini extensions install https://github.com/github/github-mcp-server

Note

You will still need to have a personal access token with the appropriate scopes called GITHUB_MCP_PAT in your environment.

Despite all these setup steos above , while launching Gemini CLI , MCP server for github says cannot connect✕ Could not configure OAuth for 'github' - please authenticate manually with /mcp auth github

✕ Error during discovery for server 'github': Failed to handle automatic OAuth for server 'github'.

Then i tried to install manually /mcp auth github but still it fails with following error ✕ Failed to authenticate with MCP server 'github': Failed to fetch authorization server metadata for client registration (attempted issuers: https://github.com, https://github.com/login)

snerajan avatar Nov 11 '25 14:11 snerajan

Same issue. You can't have OAuth enabled for both gemini and github atm. Changing gemini's auth method for API key works. So delete the previous security code in settings.json and start gemini again then choose auth via api key. "security": { "auth": { "selectedType": "gemini-api-key" } }

Ubuntu WSL

WillScarlettOhara avatar Nov 13 '25 03:11 WillScarlettOhara

Running Gemini CLI after installing the GitHub extension yields the following error in Gemini CLI:

"✕ Error during discovery for server 'github': Connection failed for 'github': Error POSTing to endpoint (HTTP 400): bad request: Authorization header is badly formatted"

dweekly avatar Nov 18 '25 18:11 dweekly

I changed my auth to an API key and i still get.

✕ Error during discovery for server 'github': Connection failed for 'github': Error POSTing to endpoint (HTTP 400): bad request: Authorization header is badly formatted

SuperPauly avatar Nov 19 '25 00:11 SuperPauly

Curious to learn if you're still seeing this-- I'm not able to repro. If I don't have the GITHUB_MCP_PAT environment variable I get the "Authorization header is badly formatted" error, however once that's set it's working for me with both oauth and API key for gemini CLI

chrstnb avatar Nov 19 '25 15:11 chrstnb