github / github/copilot-cli

Authorization header length limit is too low to accomodate some Entra ID tokens

未關閉
#2,960 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:mcp area:networking
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the bug

I'm trying to use the Grafana MCP over an Azure Managed Grafana instance, which authenticates with my Entra account, but it fails upon invoking the MCP commands with the following error:
```
MCP server 'grafana': An error occurred invoking 'amgmcp_datasource_list': Authorization header length 11034 exceeds maximum allowed length of 8192.
```
The issue being that I have a few too many AD Groups (but not enough to trigger the overflow yet), which causes my token to be fairly huge and go past the current 8k limit.
My understanding is that this limit happens on the Copilot side, as this exact setup is working fine in Claude Code.

### Affected version

GitHub Copilot CLI 1.0.35.

### Steps to reproduce the behavior

The MCP is configured as such:
```json
"grafana": {
"type": "http",
"url": "https://.eus.grafana.azure.com/api/azure-mcp",
"headers": {
"Authorization": "Bearer ${GRAFANA_MCP_TOKEN}"
},
"tools": [
"*"
],
},
```

And upon opening Copilot, I'm setting the environment variable like so:
```
export GRAFANA_MCP_TOKEN=$(az account get-access-token --resource "ce34e7e5-485f-4d76-964f-b3d2b16d1e4f" --query accessToken -o tsv)
```
To get an authorization token for the managed grafana resource. The token is indeed around 11kB long.

### Expected behavior

The header length limit should be higher, to accomodate the authorization tokens that might be generated in practice by users, apparently especially users of Entra ID which can get fairly large tokens of ~11-12kB

### Additional context

_No response_

貢獻指南

開啟貢獻指南

研究方向

先定位 CLI 的 MCP 請求處理中對 8192 位元組授權標頭的驗證,然後使用此處所示的 Grafana 設定和權杖產生命令重現該問題。當大小約為 11–12 kB 的真實 Entra ID 權杖能在不出現所回報錯誤的情況下被接受,且相關限制行為由測試涵蓋時,即視為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, shell
領域
authentication, cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。