anthropics / anthropics/claude-code
HTTP MCP: "Error POSTing to endpoint" despite server returning a valid tools/list result (Google Docs MCP docsmcp.googleapis.com)
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
### Environment
- **Claude Code version:** 2.1.259 (native install)
- **OS:** Windows 11
- **MCP server:** `google-docs` → `https://docsmcp.googleapis.com/mcp/v1` (Google's official Docs MCP), configured in project `.mcp.json` as `"type": "http"` with an OAuth desktop client.
### What happens
1. OAuth completes successfully (browser flow, consent granted).
2. `/mcp` reports: **"Reconnected to google-docs, but fetching tools failed (detail withheld on this connection)."**
3. No `mcp__google-docs__*` tools are ever exposed. `claude mcp list` shows the server as `! Needs authentication` even right after a successful auth.
### Log evidence
From `~/AppData/Local/claude-cli-nodejs/Cache//mcp-logs-google-docs/*.jsonl`:
```
"debug": "Connection error: Error POSTing to endpoint: {"id":1,"jsonrpc":"2.0","result":{"tools":[ ... ]}}"
"error": "Failed to fetch tools: Error POSTing to endpoint: {"id":1,"jsonrpc":"2.0","result":{"tools":[{"name":"read_doc",...},{"name":"update_doc",...}]}}"
```
The payload attached to the error is a **complete, well-formed JSON-RPC `result`** containing the full tool catalog (`read_doc`, `update_doc`). The transport layer rejects the response anyway. Note there is **no `(HTTP nnn)`** in the error string, unlike the usual `StreamableHTTPError` path — so it does not look like a plain non-2xx rejection.
### Likely cause
The client appears to mishandle how Google's endpoint frames the `tools/list` response — e.g. an SSE-framed (`text/event-stream`) body where plain JSON is expected on that code path, or a 2xx response whose `Content-Type` the POST handler doesn't accept. The server side is clearly returning a valid result.
### Expected
Tools registered from `result.tools`; `mcp__google-docs__read_doc` / `mcp__google-docs__update_doc` available.
### Repro
1. Add Google's Docs MCP as an `http` server in `.mcp.json`.
2. Authenticate via `/mcp`.
3. Run `/mcp` again → "fetching tools failed".
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Reproduce the failure using the project .mcp.json entry for Google's HTTP server, then inspect the /mcp flow and the mcp-logs-google-docs/*.jsonl files under the stated cache path. Compare the successful tools/list JSON-RPC result with the response framing and content type; done means read_doc and update_doc are exposed as MCP tools after authentication.
索引モデルが issue の本文から書いたものです。
評価
- 領域
- api, cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 50/100