Remote MCP OAuth + Gemini CLI Errors Out
Describe the bug
Unable to use remote MCP with OAuth. I just get: [Error: Could not parse tool response]
Affected version
Using the remote MCP config:
"mcpServers": {
"github-remote": {
"httpUrl": "https://api.githubcopilot.com/mcp/",
"oauth": {
"enabled": true,
"clientId": "<Client ID from OAuth app>",
"clientSecret": "<Client secret from OAuth app>"
}
},
I have also confirmed I can see the tools list and are authenticated with OAuth: 🟢 github-remote - Ready (OAuth authenticated) (91 tools, 2 prompts)
Steps to reproduce the behavior
- Type this 'Create a repository called "detection-as-code" and initialize it with a README'
- See error above.
Expected vs actual behavior
I would expect it to use the MCP tool create_repository to create a new repo in my Github.
Logs
I have also seen it output:
MCP tool `create_repository` reported tool error for function call: {"name": "create_repository", "args":{"name": "detection-as-code"}} with response: https://api.github.com/user/repos: 404 Not Found []"}],"isError":true}}}}]
Hi 👋 Can you share some additional info on your app:
- Is it Oauth App or GitHub App?
- What are the scopes/permissions granted to your app?
- If it is a GitHub App - is it installed on the org/user that you're trying to create repository in?
My tocken
Hi 👋 Can you share some additional info on your app:
- Is it Oauth App or GitHub App?
- What are the scopes/permissions granted to your app?
- If it is a GitHub App - is it installed on the org/user that you're trying to create repository in?
- OAuth App
- None are defined or unable to define within the OAuth App. The only sense of ownership/permissions I see are that I am the owner of the application
- N/A - not a GitHub App
Thanks for the details. I think the problem here is in the lacking scopes. In order to create a private repo your token needs to have a repo scope, and public_repo - to create a public repo, see https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-for-the-authenticated-user
Oauth is not officially supported for GitHub MCP in Gemini CLI and I'm not sure whether if there's a way in this configuration to define scopes that need to be requested.
I'd advise to use personal access tokens for now.
This issue is stale because it has been open for 30 days with no activity. Leave a comment to avoid closing this issue in 60 days.
This issue was closed because it has been inactive for 60 days since being marked as stale.