claude-code - 💡(How to fix) Fix HTTP MCP servers returning 405 on GET health check fail to load tools at session startup [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51721Fetched 2026-04-22 07:54:37
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

HTTP MCP servers that return 405 Method Not Allowed on GET requests have their tools silently skipped during session initialization. The health check failure (cosmetic per docs) is actually blocking tool loading entirely.

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

None currently. claude mcp add has no --skip-health-check flag.

Code Example

claude mcp add --transport http datadog-mcp "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=all" \
     -H "DD-API-KEY: <key>" -H "DD-APPLICATION-KEY: <app-key>"

---

HTTP/1.1 200 OK
mcp-session-id: mcp-session-1cb3828c-2381-448b-b175-7859318d3323
content-type: application/json

{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true}},...}}
RAW_BUFFERClick to expand / collapse

Summary

HTTP MCP servers that return 405 Method Not Allowed on GET requests have their tools silently skipped during session initialization. The health check failure (cosmetic per docs) is actually blocking tool loading entirely.

Environment

  • Claude Code version: 2.1.104
  • Transport: HTTP (type: http)
  • MCP server: Datadog (https://mcp.datadoghq.com/api/unstable/mcp-server/mcp)

Steps to Reproduce

  1. Add an HTTP MCP server that only accepts POST (not GET) — e.g. the official Datadog MCP server:
    claude mcp add --transport http datadog-mcp "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=all" \
      -H "DD-API-KEY: <key>" -H "DD-APPLICATION-KEY: <app-key>"
  2. Run claude mcp list — shows ✗ Failed to connect
  3. Start a fresh claude session
  4. The Datadog MCP tools are not available in the session

Expected Behavior

The health check result should be cosmetic only. Session startup should independently attempt MCP initialization via POST, and if that succeeds (200 OK + mcp-session-id), tools should be loaded.

Actual Behavior

Tools from the server are not loaded into the session. The health check failure (GET → 405) appears to gate tool initialization entirely.

Evidence the Server Works

A manual POST initialize request to the Datadog MCP server returns 200 OK with a valid MCP response and session ID:

HTTP/1.1 200 OK
mcp-session-id: mcp-session-1cb3828c-2381-448b-b175-7859318d3323
content-type: application/json

{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true}},...}}

The server is fully compliant with the MCP Streamable HTTP transport spec — it just doesn't respond to GET (which is not required by the spec).

Root Cause Hypothesis

Claude Code's session startup either:

  1. Uses the health check result to decide whether to attempt initialization, OR
  2. Uses GET for the initialization request itself (same as the health check)

Either way, a server that is spec-compliant but GET-unfriendly never gets its tools loaded.

Workaround

None currently. claude mcp add has no --skip-health-check flag.

extent analysis

TL;DR

The issue can be resolved by modifying Claude Code to skip the health check or use POST for initialization requests when adding an HTTP MCP server that only accepts POST requests.

Guidance

  • Verify that the MCP server is correctly configured and responding to POST requests by manually sending a POST initialize request, as shown in the Evidence the Server Works section.
  • Investigate the Claude Code source code to determine whether it uses the health check result to decide whether to attempt initialization or uses GET for the initialization request itself.
  • Consider adding a --skip-health-check flag to claude mcp add to allow users to bypass the health check for servers that do not support GET requests.
  • Test the workaround by adding the MCP server with the proposed flag (if implemented) and verifying that the tools are loaded correctly.

Example

No code snippet is provided as it would require modifying the Claude Code source code, which is not explicitly mentioned in the issue.

Notes

The provided workaround is not currently available, and modifying the Claude Code source code may be necessary to resolve the issue. The Root Cause Hypothesis suggests that the issue is due to the health check result or the use of GET for initialization requests.

Recommendation

Apply a workaround by modifying the Claude Code source code to skip the health check or use POST for initialization requests when adding an HTTP MCP server that only accepts POST requests, as this would allow the tools to be loaded correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix HTTP MCP servers returning 405 on GET health check fail to load tools at session startup [1 comments, 2 participants]