---
title: "[BUG] 官方 github 插件无法完成 MCP 授权：connecto… - Angryecho"
description: "环境 项 值 IDE Trae CN 1.107.1 (stable) commit 11ec4a1cb1e8fe52bbfe5c40743c0aa2ee84f42e OS Windows 11 企业版 10.0.26300 (AMD64) 插件 trae-remote-official:github v0.1.2 …"
canonical_url: "https://www.angryecho.com/c/Traeba/p/P2TBBtL0umMXZEPeIPEhS"
meta:
  "og:description": "环境 项 值 IDE Trae CN 1.107.1 (stable) commit 11ec4a1cb1e8fe52bbfe5c40743c0aa2ee84f42e OS Windows 11 企业版 10.0.26300 (AMD64) 插件 trae-remote-official:github v0.1.2 …"
  "og:image": "https://www.angryecho.com/_og/d/c_Post%2Ctitle_~5ZCQ5qe9572R%2Cdescription_~5ZCQ5qe95LiA5LiL77yM5bCx5LiK5ZCQ5qe9572R44CC%2CpostId_P2TBBtL0umMXZEPeIPEhS%2Crevision_~MjAyNi0xMS0wMVQwMjo1NTo1Ny40MDAxNzda%2Cp_Ii9jL1RyYWViYS9wL1AyVEJCdEwwdW1NWFpFUGVJUEVoUyI%2Cs_fHwzWM5E7JMcGvOF.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "[BUG] 官方 github 插件无法完成 MCP 授权：connecto…"
---

> Index of every page on this site: [llms.txt](https://www.angryecho.com/llms.txt)

# **\[BUG] 官方 github 插件无法完成 MCP 授权：connecto…**

## 环境

| 项 | 值 |
| --- | --- |
| IDE | Trae CN 1.107.1 (stable) |
| commit | 11ec4a1cb1e8fe52bbfe5c40743c0aa2ee84f42e |
| OS | Windows 11 企业版 10.0.26300 (AMD64) |
| 插件 | `trae-remote-official:github` v0.1.2 (marketplace\_plugin\_id: `b679bee3-4ce9-423b-af9e-5186dfb47834`) |
| MCP serverId | `mcp.config.plugin.global.trae-remote-official:github.github` |
| MCP url | `https://api.githubcopilot.com/mcp/` |

## 问题描述

安装并连接官方 `github` 插件后，GitHub 连接器可以完成 OAuth（回调 `trae-cn://trae.ai-ide/connector-oauth?provider=github&status=success`），但该插件提供的 MCP 始终处于「未授权」状态，无法调用任何工具。**反复重新授权、清除授权、重启 IDE 均无效。**

## 复现步骤

1. 安装 `trae-remote-official:github` 插件，按提示连接 GitHub 账号（OAuth 回调返回 `status=success`）。
2. 在对话中调用该插件 MCP 的工具（例如 `get_me`）。
3. 观察 `/mcp` 状态与日志（ `%APPDATA%\Trae CN\logs\\`）。

## 实际结果

工具调用失败：

```
[info]  McpService callTool github get_me {}
[error] McpService callTool Extension github not found
```

`mcp-servers-main.log`：

```text
[info] MCPOauthService Getting tokens for serverId: mcp.config.plugin.global.trae-remote-official:github.github, serverUrl: https://api.githubcopilot.com/mcp/
[info] MCPOauthProvider [...] No token data found
...
[info] MCPOauthProvider [...] Saving discovery state (authServer: https://github.com/login/oauth)
[info] MCPOauthProvider [...] Get client metadata: {"client_name":"Trae","redirect_uris":["http://localhost:56507/callback"],"grant_types":["authorization_code","refresh_token"],"response_types":["code"],"token_endpoint_auth_method":"none"}
[info] MCPOauthProvider [...] No client info found
[error] MCPOauthService Error during auth completion: Incompatible auth server: does not support dynamic client registration
```

`mcp-servers-render.log`（注意解析后的 headers 为空）：

```text
[info] McpService resolve plugin connector config succeeded {"pluginId":"trae-remote-official:github","marketplaceName":"trae-remote-official","serverName":"github","headerKeys":[],"envKeys":[]}
[info] McpClientService startExtension: mcp.config.plugin.global.trae-remote-official:github.github {"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{}}
```

另一次会话中表现为：

```text
[info] MCPOauthProvider [...] Token expired without refresh token
```

## 期望结果

连接器授权成功后，插件 MCP 的请求头应被正确注入 `connector.github.ACCESS_TOKEN`，从而能够调用 GitHub MCP；或至少允许为该 MCP 手动配置静态 header / PAT。

## 根因分析

存在两个叠加问题，任一都足以导致该 MCP 永久不可用：

1. **插件声明的 token 未注入到 MCP 请求头。** 插件 `.mcp.json` 中声明：

   ```json
    { "mcpServers": { "github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/",
      "headers": { "Authorization": "Bearer ${connector.github.ACCESS_TOKEN}" } } } }
   ```

   但 Trae 解析结果为 `headerKeys: []`、 `headers: {}`，即 `${connector.github.ACCESS_TOKEN}` 占位符没有被替换， `Authorization` 头为空。
2. **Trae 于是在 MCP 层改用自带 OAuth 流程，而 GitHub 不支持动态客户端注册（RFC 7591 / DCR）。** Trae 向 `https://api.githubcopilot.com/mcp/` 做 RFC 8414 发现后，得到授权服务器 `https://github.com/login/oauth`，随后尝试动态注册客户端，因 GitHub 不支持 dynamic client registration 而失败，报 `Incompatible auth server: does not support dynamic client registration`，因此永远无法拿到 token。

由于第 2 点是协议层的确定性失败，因此**清缓存 / 重新授权 / 重启都不会改变结果**。

## 影响范围

Trae CN 1.107.1 下，官方 `trae-remote-official:github` 插件完全不可用；同类「连接器提供静态 Bearer token + 目标服务不支持 DCR」的插件预计同样受影响。

## 建议修复方向

1. 修复插件连接器 token 到 MCP 请求头的注入（让 `${connector..ACCESS_TOKEN}` 在 `.mcp.json` 的 `headers` 中正确解析）。
2. MCP OAuth 流程在服务端不支持 DCR 时，应支持降级为静态 header / 预注册 client id / 手动 PAT，而不是直接判定授权失败。

## 临时规避

改用本地 stdio MCP（不涉及 OAuth/DCR）：

```json
{
  "mcpServers": {
    "github-pat": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "" }
    }
  }
}
```

---

*Issue 由用户手动排查后提交，日志来自* *`%APPDATA%\Trae CN\logs\\mcp-servers-main.log`** 与* *`mcp-servers-render.log`**。*

排序方式 :

### **成为第一条评论！**

Nobody's responded to this post yet. Add your thoughts and get the conversation going.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://www.angryecho.com/c/Traeba/p/P2TBBtL0umMXZEPeIPEhS#post","@type":"DiscussionForumPosting","commentCount":0,"dateModified":"2026-11-01T02:55:57.400Z","datePublished":"2026-10-08T05:57:34.000Z","description":"环境 项 值 IDE Trae CN 1.107.1 (stable) commit 11ec4a1cb1e8fe52bbfe5c40743c0aa2ee84f42e OS Windows 11 企业版 10.0.26300 (AMD64) 插件 trae-remote-official:github v0.1.2 …","headline":"[BUG] 官方 github 插件无法完成 MCP 授权：connecto…","isPartOf":"https://www.angryecho.com/c/Traeba","mainEntityOfPage":"https://www.angryecho.com/c/Traeba/p/P2TBBtL0umMXZEPeIPEhS","text":"环境\n\n\n\n\n\n\n\n项\n\n\n\n值\n\n\n\n\n\nIDE\n\n\n\nTrae CN 1.107.1 (stable)\n\n\n\n\n\ncommit\n\n\n\n11ec4a1cb1e8fe52bbfe5c40743c0aa2ee84f42e\n\n\n\n\n\nOS\n\n\n\nWindows 11 企业版 10.0.26300 (AMD64)\n\n\n\n\n\n插件\n\n\n\ntrae-remote-official:github v0.1.2 (marketplace_plugin_id: b679bee3-4ce9-423b-af9e-5186dfb47834)\n\n\n\n\n\nMCP serverId\n\n\n\nmcp.config.plugin.global.trae-remote-official:github.github\n\n\n\n\n\nMCP url\n\n\n\nhttps://api.githubcopilot.com/mcp/\n\n问题描述\n\n安装并连接官方 github 插件后，GitHub 连接器可以完成 OAuth（回调 trae-cn://trae.ai-ide/connector-oauth?provider=github&status=success），但该插件提供的 MCP 始终处于「未授权」状态，无法调用任何工具。反复重新授权、清除授权、重启 IDE 均无效。\n\n复现步骤\n\n\n\n\n\n安装 trae-remote-official:github 插件，按提示连接 GitHub 账号（OAuth 回调返回 status=success）。\n\n\n\n在对话中调用该插件 MCP 的工具（例如 get_me）。\n\n\n\n观察 /mcp 状态与日志（%APPDATA%\\Trae CN\\logs\\\\）。\n\n实际结果\n\n工具调用失败：\n\n[info]  McpService callTool github get_me {}\n[error] McpService callTool Extension github not found\n\nmcp-servers-main.log：\n\n[info] MCPOauthService Getting tokens for serverId: mcp.config.plugin.global.trae-remote-official:github.github, serverUrl: https://api.githubcopilot.com/mcp/\n[info] MCPOauthProvider [...] No token data found\n...\n[info] MCPOauthProvider [...] Saving discovery state (authServer: https://github.com/login/oauth)\n[info] MCPOauthProvider [...] Get client metadata: {\"client_name\":\"Trae\",\"redirect_uris\":[\"http://localhost:56507/callback\"],\"grant_types\":[\"authorization_code\",\"refresh_token\"],\"response_types\":[\"code\"],\"token_endpoint_auth_method\":\"none\"}\n[info] MCPOauthProvider [...] No client info found\n[error] MCPOauthService Error during auth completion: Incompatible auth server: does not support dynamic client registration\n\nmcp-servers-render.log（注意解析后的 headers 为空）：\n\n[info] McpService resolve plugin connector config succeeded {\"pluginId\":\"trae-remote-official:github\",\"marketplaceName\":\"trae-remote-official\",\"serverName\":\"github\",\"headerKeys\":[],\"envKeys\":[]}\n[info] McpClientService startExtension: mcp.config.plugin.global.trae-remote-official:github.github {\"type\":\"http\",\"url\":\"https://api.githubcopilot.com/mcp\",\"headers\":{}}\n\n另一次会话中表现为：\n\n[info] MCPOauthProvider [...] Token expired without refresh token\n\n期望结果\n\n连接器授权成功后，插件 MCP 的请求头应被正确注入 connector.github.ACCESS_TOKEN，从而能够调用 GitHub MCP；或至少允许为该 MCP 手动配置静态 header / PAT。\n\n根因分析\n\n存在两个叠加问题，任一都足以导致该 MCP 永久不可用：\n\n\n\n\n\n插件声明的 token 未注入到 MCP 请求头。\n 插件 .mcp.json 中声明：\n\n { \"mcpServers\": { \"github\": { \"type\": \"http\", \"url\": \"https://api.githubcopilot.com/mcp/\",\n   \"headers\": { \"Authorization\": \"Bearer ${connector.github.ACCESS_TOKEN}\" } } } }\n\n 但 Trae 解析结果为 headerKeys: []、headers: {}，即 ${connector.github.ACCESS_TOKEN} 占位符没有被替换，Authorization 头为空。\n\n\n\nTrae 于是在 MCP 层改用自带 OAuth 流程，而 GitHub 不支持动态客户端注册（RFC 7591 / DCR）。\n Trae 向 https://api.githubcopilot.com/mcp/ 做 RFC 8414 发现后，得到授权服务器 https://github.com/login/oauth，随后尝试动态注册客户端，因 GitHub 不支持 dynamic client registration 而失败，报 Incompatible auth server: does not support dynamic client registration，因此永远无法拿到 token。\n\n由于第 2 点是协议层的确定性失败，因此清缓存 / 重新授权 / 重启都不会改变结果。\n\n影响范围\n\nTrae CN 1.107.1 下，官方 trae-remote-official:github 插件完全不可用；同类「连接器提供静态 Bearer token + 目标服务不支持 DCR」的插件预计同样受影响。\n\n建议修复方向\n\n\n\n\n\n修复插件连接器 token 到 MCP 请求头的注入（让 ${connector..ACCESS_TOKEN} 在 .mcp.json 的 headers 中正确解析）。\n\n\n\nMCP OAuth 流程在服务端不支持 DCR 时，应支持降级为静态 header / 预注册 client id / 手动 PAT，而不是直接判定授权失败。\n\n临时规避\n\n改用本地 stdio MCP（不涉及 OAuth/DCR）：\n\n{\n  \"mcpServers\": {\n    \"github-pat\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-github\"],\n      \"env\": { \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"\" }\n    }\n  }\n}\n\n\n\nIssue 由用户手动排查后提交，日志来自 %APPDATA%\\Trae CN\\logs\\\\mcp-servers-main.log 与 mcp-servers-render.log。","url":"https://www.angryecho.com/c/Traeba/p/P2TBBtL0umMXZEPeIPEhS","author":{"@type":"Person","name":"vxxholic","url":"https://www.angryecho.com/u/V2Xvxxholic"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":0},{"@type":"InteractionCounter","interactionType":"https://schema.org/DislikeAction","userInteractionCount":0},{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":28},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":0}]}]}
```

## Sitemap

See the full [sitemap](https://www.angryecho.com/sitemap.md) for all pages.
