github / github/copilot-cli

copilot-cli ignores grant_types_supported and attempts authorization_code flow for client_credentials-only MCP servers

Aperta
#3,982 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:authentication area:mcp
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### Describe the bug

Hello. I am trying to set up an corporate MCP server in copilot. This MCP server is protected using an OAuth authorization server that advertises only client_credentials in `grant_types_supported`
Copilot-cli still attempts to initiate an interactive `authorization_code` flow instead.

Expected behavior:

copilot-cli should check [grant_types_supported] from the OAuth server metadata
If only client_credentials is listed, it should use that flow
It should NOT launch a browser for interactive auth

Actual behavior:

Launches a browser window for authorization code flow
This fails because the MCP server only permits client_credentials
Even when explicitly configured with "oauthGrantType": "client_credentials", oauthPublicClient": false, and "oauthClientId" in the config file as per https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#headless-oauth-client_credentials-grant, the browser still launches

### Affected version

_No response_

### Steps to reproduce the behavior

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start in the copilot-cli OAuth configuration and metadata-handling paths, focusing on grant_types_supported and the oauthGrantType, oauthPublicClient, and oauthClientId settings. Reproduce with an MCP server advertising only client_credentials, then verify that the CLI selects the supported flow and does not launch a browser.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
shell
Ambito
authentication, cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.