anthropics / anthropics/claude-ai-mcp

Custom MCP connector fails with INVALID_RESULT dialing error despite provably healthy server

Aperta
#1,003 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Nessun dato sulla lingua
Stelle
471
Fork
77
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### What happened?

Connecting to our custom MCP server (Moodle webservice_mcp plugin, Streamable HTTP transport) fails every time with an SdkError while dialing the server, even though the server has been verified to respond correctly to all MCP protocol calls via direct testing.

Server URL: https://akademie.conbus.de/webservice/mcp/server.php

During investigation we found and fixed two real server-side bugs:
1. Apache (mod_proxy_fcgi -> PHP-FPM) was not forwarding the Authorization header - fixed with CGIPassAuth On.
2. The plugin returned HTTP 200 with a non-JSON-RPC body on GET requests instead of 405 - patched to return 405/Allow: POST.

After both fixes, direct curl testing confirms the server responds correctly to initialize and tools/list, and authenticates correctly via both the ?wstoken= query parameter and the Authorization: Bearer header.

Despite this, the identical INVALID_RESULT dialing error persists across:
- The original connector (before and after both fixes)
- A fully deleted and recreated connector (different name, query-string auth method)
- A completely separate, fresh chat session

This closely resembles issue #479 (closed as "not planned") - a cached negative verdict not cleared by remove+re-add, despite a server that is provably healthy.

### What did you expect to happen?

The connector should successfully dial the server and load its tools, since the server responds correctly to all MCP protocol calls (verified via curl for initialize and tools/list, with both supported auth methods).

### Steps to reproduce

1. Add a custom MCP connector pointing to https://akademie.conbus.de/webservice/mcp/server.php (auth via ?wstoken= in the URL, or Authorization: Bearer header)
2. Connector shows as connected
3. Attempt to use/refresh the connector's tools
4. See error: SdkError dialing https://api.anthropic.com/v2/ccr-sessions//mcp?mcp_server_id=...&mcp_url=...&toolbox_mcp_server_id=... (INVALID_RESULT)

### Area

Session / Connection Management

### MCP Server (if applicable)

Custom server - Moodle webservice_mcp plugin (Streamable HTTP), self-hosted at akademie.conbus.de

### Error messages or logs

```shell
SdkError dialing https://api.anthropic.com/v2/ccr-sessions//mcp?mcp_server_id=...&mcp_url=...&toolbox_mcp_server_id=... (INVALID_RESULT)
```

### Additional context

Related issue: #479 (closed as "not planned") describes the same symptom - a cached negative verdict not cleared by remove+re-add.

Server-side fixes applied (for reference):
- Apache: added CGIPassAuth On (in a block) so Authorization headers reach PHP-FPM
- Plugin: patched GET handler to return HTTP 405 instead of a non-compliant 200 status blob

Happy to provide further logs or test with new tokens on request.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the custom Streamable HTTP connector flow against the provided Moodle MCP server and inspect the Session / Connection Management path around the INVALID_RESULT dialing error. Compare the behavior with related issue #479; done means a recreated connector can dial the server and load its tools without the error.

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

Valutazione

Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.