Set Up GitHub OAuth Provider and MCP Server
This tutorial shows how to connect Redpanda Agentic Data Plane to GitHub using OAuth, so users can authenticate with their own GitHub credentials when calling GitHub MCP tools.
After completing this tutorial, you will be able to:
-
Create a GitHub OAuth app and register it as an OAuth provider in Agentic Data Plane
-
Test the OAuth connection proactively on the Connections page
-
Configure a GitHub managed MCP server with user-delegated OAuth
Before you begin
-
You need a GitHub account with permission to create OAuth apps (personal account or organization with appropriate role).
-
You need Agentic Data Plane administrator permissions to create OAuth providers and MCP servers.
-
You should understand the difference between user-delegated OAuth (each user authenticates as themselves) and service-account OAuth (all users share one identity). This tutorial covers user-delegated OAuth.
|
GitHub recommends considering GitHub Apps instead of OAuth Apps for production use, as they offer fine-grained permissions and short-lived tokens. However, OAuth Apps work well for getting started with Redpanda Agentic Data Plane’s AI Gateway integration. |
Create a GitHub OAuth app
Register an OAuth application in GitHub to obtain the client ID and client secret.
|
Throughout this tutorial, fields marked with * are required. |
-
Sign in to GitHub and navigate to Settings → Developer settings → OAuth Apps.
-
Click New OAuth App (or Register a new application if this is your first OAuth app).
-
Fill in the application details:
Field Value Application name
Agentic Data Plane AI Gateway(or your preferred name)Homepage URL
https://aigw.<cluster-id>.clusters.rdpa.co
Replace<cluster-id>with your actual cluster ID, such ashttps://aigw.d6kjl4h19241bg3ek3t0.clusters.rdpa.co.Application description
Optional. For example: "Redpanda AI Gateway GitHub integration".
Authorization callback URL
https://aigw.<cluster-id>.clusters.rdpa.co/oauth/v1/callback
This must match exactly. Replace<cluster-id>with your actual cluster ID, such ashttps://aigw.d6kjl4h19241bg3ek3t0.clusters.rdpa.co/oauth/v1/callback. -
Click Register application.
-
On the application page, note your Client ID. Copy it for later.
-
Click Generate a new client secret and copy it immediately (you won’t see it again).
| Store your client secret securely. GitHub will not show it again after you navigate away. |
Create the GitHub OAuth provider in Agentic Data Plane
Register GitHub as an OAuth provider in Agentic Data Plane.
-
Open Integrations setup in the sidebar and click the Outbound providers tab.
-
Click Add provider and click GitHub in the catalog.
-
Fill in the provider details:
Provider details
| Field | Value | Notes |
|---|---|---|
Name * |
A name for this OAuth provider, for example, |
Lowercase letters, numbers, and hyphens only. This is the machine identifier used when attaching the provider to an MCP server. Immutable after creation. |
Client ID * |
The client ID from your GitHub OAuth app, for example, |
This is found in GitHub Settings → Developer settings → OAuth Apps → [Your App]. |
Display name * |
|
Human-readable name shown in Agentic Data Plane. |
Authorization endpoint * |
|
GitHub’s OAuth authorization URL where users are redirected to grant permission. |
Token endpoint * |
|
GitHub’s OAuth token exchange endpoint where authorization codes are exchanged for access tokens. |
Revocation endpoint |
Leave empty |
GitHub doesn’t provide a standard RFC 7009 token revocation endpoint. Agentic Data Plane will handle token lifecycle without this. |
Client secret reference * |
|
Click New. Enter |
Scopes
The GitHub preset fills in one scope field for each of repo, read:user, user:email, read:org, and workflow. The GitHub (Read) MCP server in this tutorial only reads, so remove the field that holds workflow, a scope that grants the ability to add and update GitHub Actions workflow files. Keep repo, which a read-only server still needs for private repositories.
|
Common GitHub OAuth scopes:
See the GitHub OAuth scopes documentation for the complete list. Scope management: Include every scope any MCP server attached to this provider might need. Users must re-consent when scopes are added later, so it’s better to include all necessary scopes upfront. |
Grant types
-
Browser consent ✓ (checked) - OAuth 2.0 Authorization Code flow. This is the standard flow for user-delegated OAuth.
-
Token exchange ☐ (unchecked) - RFC 8693 token exchange. Leave unchecked unless you’re implementing advanced token exchange scenarios.
Token endpoint authentication method
Select Client Secret (Basic)
This sends credentials as client_id:client_secret in the HTTP Basic Authorization header. The GitHub preset selects this method.
| Method | When to use |
|---|---|
Client Secret (Basic) |
Most common, and what the GitHub preset uses. Credentials sent in Authorization header. |
Client Secret (POST) |
Credentials sent in the POST body. Use only if the provider requires it. |
None (PKCE only) |
For public clients with no client secret. Not applicable for GitHub OAuth Apps. |
Require PKCE
Turn on Require PKCE. The GitHub preset leaves it off.
Proof Key for Code Exchange (PKCE) adds an extra layer of security to the OAuth flow.
|
PKCE (RFC 7636) protects against authorization code interception attacks. When enabled, the gateway generates a code challenge before redirecting the user to GitHub and verifies it when exchanging the authorization code for a token. |
Test the connection on the Connections page
Before creating an MCP server, proactively test the OAuth flow to verify your provider configuration is correct.
-
Open Connections in the sidebar.
-
Find GitHub in the connections rail, under Available to connect.
-
Click Connect.
-
You’ll be redirected to GitHub’s authorization page.
-
Review the requested permissions (scopes) and click Authorize [Your App Name].
-
GitHub redirects you back to Agentic Data Plane.
-
GitHub now shows status "Connected".
|
If the connection fails:
See Troubleshooting for more debugging tips. |
Create the GitHub MCP server
Now create an MCP server that uses the GitHub OAuth provider for user-delegated authentication.
-
Open MCP servers in the sidebar.
-
Click Add MCP server.
-
Use the search bar or browse the catalog to find GitHub (Read), and click it.
GitHub (Read) is a managed MCP server, meaning Redpanda provides and maintains the implementation. It is read-only: its tools read repositories, pull requests, commits, and code, and none of them write to GitHub. You only need to configure authentication.
Configure the GitHub MCP server
Fill in the basic server details:
| Field | Example value | Notes |
|---|---|---|
Name * |
|
Unique identifier. Lowercase letters, numbers, and hyphens only. |
Description |
|
Optional human-readable description. |
Code mode |
Toggle on/off |
Adds |
Restrict to org |
|
GitHub-specific field. If set, confines this MCP to the named GitHub org (for example, "redpanda-data"). Leave empty for unrestricted access to all repositories the user can access. |
Configure authentication
-
In the
Auth Methoddropdown, selectUser OAuth.This enables user-delegated authentication where each user authenticates with their own GitHub credentials.
-
In the User OAuth section that appears:
| Field | Value | Notes |
|---|---|---|
Provider name * |
|
Select the GitHub OAuth provider you created earlier from the dropdown. If "Not set" appears, you haven’t created a provider yet or it’s not visible. |
Required scopes |
Click + Add required scopes |
Add the same scopes you defined in the OAuth provider, adding each scope to a new line. If a user’s stored connection has fewer scopes than specified here, they’ll be prompted to re-consent with upgraded scopes. |
Token injection (advanced)
The Injection section controls how the resolved OAuth token is placed on upstream requests:
| Field | Default value | Notes |
|---|---|---|
Header name |
|
HTTP header name for the token. GitHub expects |
Header prefix |
|
Value prefix before the token. GitHub expects |
|
How to authenticate to GitHub link explains GitHub’s expected authentication format. For standard GitHub OAuth, the defaults ( |
Complete creation
-
Review all fields.
-
Click Create server.
The server’s detail page shows a Managed badge next to its name. Its tools read the signed-in user’s profile, organizations, repositories, pull requests, commits, and code.
|
User OAuth vs service account OAuth:
For most scenarios where users need to access their own repositories or respect GitHub’s per-user permissions, choose User OAuth. |
Verify the MCP server works
Test that the MCP server is correctly configured and can authenticate users.
-
In Agentic Data Plane, find your GitHub MCP server in the MCP servers list.
-
Click it to view details.
-
If you tested the connection in Connections, you’re already connected and can test immediately.
-
If you skipped the Connections test, the first time you call a tool from this server, you’ll be prompted to authorize GitHub.
The flow is:
-
Call a tool (for example, through a Claude Desktop integration pointing to this MCP server).
-
The tool call fails with a message that carries an authorization URL.
-
Open the URL to connect to GitHub.
-
You authorize in GitHub.
-
Call the tool again. It now succeeds.
-
-
After successful authorization, subsequent tool calls use your stored GitHub token with no additional prompts (until the token expires or scopes change).
What you accomplished
You have now:
-
Created a GitHub OAuth app with the correct callback URL
-
Registered GitHub as an OAuth provider in Agentic Data Plane
-
Tested the OAuth connection proactively
-
Created a GitHub managed MCP server with user-delegated OAuth
-
Verified that users can authenticate and call GitHub tools
You could next create an agent using this GitHub MCP server. Each user who calls tools from this MCP server will authenticate with their own GitHub account. User tokens are stored securely in Agentic Data Plane’s token vault and automatically refreshed before expiry.
Troubleshooting
| Symptom | Solution |
|---|---|
|
The callback URL in your GitHub OAuth app doesn’t match Agentic Data Plane’s callback. Go to GitHub Settings → Developer settings → OAuth Apps → [Your App] and verify the Authorization callback URL is exactly |
|
The Client ID or Client secret is incorrect, or the authentication method doesn’t match. Verify the Client ID in the OAuth provider matches GitHub, and that |
|
One of the scopes you requested isn’t valid for GitHub OAuth apps. Check the GitHub OAuth scopes documentation and remove or rename invalid scopes. |
"OAuth provider not found" when creating MCP server |
The provider name doesn’t match. Verify you created the provider with name |
Connection works in Connections but fails in MCP server |
The MCP server’s required scopes might be different from what you consented to in Connections. Edit the OAuth provider to include all necessary scopes, then re-consent in Connections. |
Token expired or |
GitHub tokens eventually expire or can be revoked. The user needs to re-authorize in Connections or by triggering the consent flow again on the next tool call. |
Permission denied when attaching provider to MCP server |
You need the |