Describe the bug
Copilot CLI ignores the oauth.clientId configured in ~/.copilot/mcp-config.json for remote HTTP MCP servers. Instead, it always performs Dynamic Client Registration (DCR) and uses a server-assigned client ID, even when a static clientId is explicitly provided.
Affected version
GitHub Copilot CLI 1.0.26
Steps to reproduce the behavior
- Configure remote HTTP MCP servers in
~/.copilot/mcp-config.json with an explicit oauth.clientId:
{
"mcpServers": {
"WorkIQ-Calendar-MCP-Server": {
"url": "https://agent365.svc.cloud.microsoft/.../mcp_CalendarTools",
"type": "http",
"oauth": {
"clientId": "ba081686-5d24-4bc6-a0d6-d034ecffed87",
"callbackPort": 8080
}
}
}
}
- Clear any cached OAuth state:
Remove-Item ~/.copilot/mcp-oauth-config/* -Force
- Start Copilot CLI:
copilot
- Observe the browser OAuth redirect URL — the
client_id parameter is a DCR-assigned ID (aebc6443-996d-45c2-90f0-388ff96faa56), not the configured one (ba081686-...)
- Inspect cached OAuth state in
~/.copilot/mcp-oauth-config/ — all entries show "isStatic": false and the DCR-assigned client ID
Expected behavior
When oauth.clientId is explicitly set in the MCP server config, the CLI should use that static client ID for the OAuth flow instead of performing Dynamic Client Registration (DCR).
This is important because:
- Organizations may have pre-registered OAuth applications with specific client IDs
- The DCR-assigned client ID may not have the correct permissions or consent grants
- Admin consent is typically granted to a specific client ID, not a dynamically registered one
Additional context
Browser redirect URL (showing wrong client_id):
https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?...&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&...
Cached OAuth state (showing DCR was used):
{
"clientId": "aebc6443-996d-45c2-90f0-388ff96faa56",
"isStatic": false
}
Related issues:
Proposed fix: When oauth.clientId is present in the server config, skip DCR and use the provided client ID directly with "isStatic": true. The oauth.callbackPort should also be respected to avoid the random port issue described in #1491.
Describe the bug
Copilot CLI ignores the
oauth.clientIdconfigured in~/.copilot/mcp-config.jsonfor remote HTTP MCP servers. Instead, it always performs Dynamic Client Registration (DCR) and uses a server-assigned client ID, even when a staticclientIdis explicitly provided.Affected version
GitHub Copilot CLI 1.0.26
Steps to reproduce the behavior
~/.copilot/mcp-config.jsonwith an explicitoauth.clientId:{ "mcpServers": { "WorkIQ-Calendar-MCP-Server": { "url": "https://agent365.svc.cloud.microsoft/.../mcp_CalendarTools", "type": "http", "oauth": { "clientId": "ba081686-5d24-4bc6-a0d6-d034ecffed87", "callbackPort": 8080 } } } }Remove-Item ~/.copilot/mcp-oauth-config/* -Forcecopilotclient_idparameter is a DCR-assigned ID (aebc6443-996d-45c2-90f0-388ff96faa56), not the configured one (ba081686-...)~/.copilot/mcp-oauth-config/— all entries show"isStatic": falseand the DCR-assigned client IDExpected behavior
When
oauth.clientIdis explicitly set in the MCP server config, the CLI should use that static client ID for the OAuth flow instead of performing Dynamic Client Registration (DCR).This is important because:
Additional context
Browser redirect URL (showing wrong client_id):
Cached OAuth state (showing DCR was used):
{ "clientId": "aebc6443-996d-45c2-90f0-388ff96faa56", "isStatic": false }Related issues:
clientIdcauses N auth prompts)Proposed fix: When
oauth.clientIdis present in the server config, skip DCR and use the provided client ID directly with"isStatic": true. Theoauth.callbackPortshould also be respected to avoid the random port issue described in #1491.