Configure the GitHub MCP Server
Updated 1 min read
Overview
GitHub operates an official hosted MCP server at api.githubcopilot.com for repositories, issues, pull requests, and Actions. Access is authorized through OAuth via a GitHub OAuth App you register yourself.
1. Configure GitHub
- In GitHub, go to Settings → Developer settings → OAuth Apps and register a new app for your Dtwo gateway. The Homepage URL is just shown to users on the consent screen — any public, non-sensitive URL (like your company’s website) works. Set the Authorization callback URL to your gateway’s OAuth callback URL — found in the Configuration section for your gateway in the Dtwo UI.
- If your organization restricts OAuth App access, go to Organization settings → Third-party Access → OAuth app policy (visible to organization owners only) and approve the app so member accounts can authorize it.
2. Add the MCP server to your gateway config
In the mcp_servers section of your gateway configuration add the following entry:
- name: github
description: "GitHub's official hosted MCP server for repositories, issues, pull requests, and Actions."
url: https://api.githubcopilot.com/mcp/
transport_type: streamablehttp
authentication:
type: oauth
grant_type: authorization_code
scopes:
- repo
- read:user
- read:org
client_id: "<CLIENT_ID>"
client_secret: "<CLIENT_SECRET>"
authorization_url: "https://github.com/login/oauth/authorize"
token_url: "https://github.com/login/oauth/access_token"
redirect_uri: "<CALLBACK_URL>"
Replace the placeholder values:
<CLIENT_ID>and<CLIENT_SECRET>— come from the OAuth App you created in step 1.<CALLBACK_URL>— the same OAuth callback URL you set in step 1, found in the Configuration section for your gateway in the Dtwo UI.
3. Deploy and verify
Save the configuration and deploy the gateway.
Then, in your AI client, ask it to authorize GitHub via the gateway. This opens the GitHub login screen — sign in as the user whose permissions the agent should inherit, and approve the consent prompt. Once authorized, confirm the server’s tools appear and run a quick call to make sure the connection works.
Having trouble? Email support@dtwo.ai.