hermes - 💡(How to fix) Fix MCP Servers amap (http) — SSE discovery mechanism not supported [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
NousResearch/hermes-agent#17244Fetched 2026-04-30 06:48:53
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1

Error Message

  • 500 Internal Server Error for https://mcp.amap.com/mcp

Root Cause

The amap MCP server uses an SSE-based discovery mechanism:

  1. Client must first connect to https://mcp.amap.com/sse?key=... (SSE endpoint)
  2. Server returns session endpoint via SSE: /mcp/message?sessionId=xxx
  3. Client must then use the returned session endpoint for MCP communication

Current hermes-agent MCP implementation (tools/mcp_tool.py) directly connects to the HTTP endpoint without SSE discovery.

Fix Action

Workaround

Set enabled: false in config.yaml for amap MCP.

Code Example

# SSE endpoint returns session info correctly:
$ curl -s "https://mcp.amap.com/sse?key=YOUR_KEY" -H "Accept: text/event-stream"
event:endpoint
data:/mcp/message?sessionId=<session_id>

# Direct /mcp endpoint without session → 502 Bad Gateway
RAW_BUFFERClick to expand / collapse

Problem

The amap (高德地图) MCP server fails to connect with errors:

  • Session terminated
  • 500 Internal Server Error for https://mcp.amap.com/mcp

Root Cause

The amap MCP server uses an SSE-based discovery mechanism:

  1. Client must first connect to https://mcp.amap.com/sse?key=... (SSE endpoint)
  2. Server returns session endpoint via SSE: /mcp/message?sessionId=xxx
  3. Client must then use the returned session endpoint for MCP communication

Current hermes-agent MCP implementation (tools/mcp_tool.py) directly connects to the HTTP endpoint without SSE discovery.

Evidence

# SSE endpoint returns session info correctly:
$ curl -s "https://mcp.amap.com/sse?key=YOUR_KEY" -H "Accept: text/event-stream"
event:endpoint
data:/mcp/message?sessionId=<session_id>

# Direct /mcp endpoint without session → 502 Bad Gateway

Expected Behavior

Hermes-agent should support MCP servers requiring SSE-based discovery.

Workaround

Set enabled: false in config.yaml for amap MCP.

extent analysis

TL;DR

Modify the hermes-agent MCP implementation to use the SSE-based discovery mechanism before connecting to the amap MCP server.

Guidance

  • Update the tools/mcp_tool.py to first connect to the SSE endpoint (https://mcp.amap.com/sse?key=...) and retrieve the session endpoint.
  • Use the returned session endpoint (/mcp/message?sessionId=xxx) for subsequent MCP communication.
  • Verify the SSE endpoint returns the correct session information using a tool like curl.
  • Consider implementing a fallback or retry mechanism in case of SSE connection failures.

Example

import requests

# Replace with your actual API key
key = "YOUR_KEY"

# Connect to SSE endpoint and retrieve session endpoint
sse_url = f"https://mcp.amap.com/sse?key={key}"
response = requests.get(sse_url, headers={"Accept": "text/event-stream"})

# Parse the session endpoint from the SSE response
session_endpoint = None
for line in response.text.splitlines():
    if line.startswith("data:"):
        session_endpoint = line.split(":")[1].strip()
        break

# Use the session endpoint for MCP communication
if session_endpoint:
    mcp_url = f"https://mcp.amap.com{session_endpoint}"
    # Proceed with MCP communication using the mcp_url

Notes

The provided example is a basic illustration and may require modifications to fit the actual implementation. Additionally, error handling and potential edge cases should be considered when integrating the SSE-based discovery mechanism.

Recommendation

Apply workaround by modifying the hermes-agent MCP implementation to use the SSE-based discovery mechanism, as the current implementation does not support this required feature.

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