Skip to content

bug: route mcp server sse is not work #12138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kenneth-bro opened this issue Apr 14, 2025 · 4 comments
Open

bug: route mcp server sse is not work #12138

kenneth-bro opened this issue Apr 14, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@kenneth-bro
Copy link

Current Behavior

I have an MCP server that works fine when configured within the intranet environment. However, when I configure it for external access via APISIX, it reports an error. Our current forwarding flow is:

Cloud Load Balancer (with HTTPS certificate) → APISIX (HTTP, internal network) → MCP Server (HTTP, internal network)

The access example is: https://std.test.mcp.net/mcp/common/sse, but an error occurs:
It seems the protocol is automatically downgraded to HTTP. How should I handle this issue?

Image

Image

Expected Behavior

connect mcp server is right

Error Logs

SSE transport: url=https://std.test.mcp.net/mcp/common/sse, headers=Accept
Error in /sse route: Error: Endpoint origin does not match connection origin: http://std.test.mcp.net/mcp/common/sse
at EventSource. (file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:82:31)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
at EventSource.dispatchEvent (node:internal/event_target:721:26)
at file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/eventsource/dist/index.js:106:150
at dispatchEvent (file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/eventsource-parser/dist/index.js:70:24)
at parseLine (file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/eventsource-parser/dist/index.js:23:7)
at Object.feed (file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/eventsource-parser/dist/index.js:18:7)
at file:///Users/kenneth/.npm/_npx/5a9d879542beca3a/node_modules/eventsource/dist/index.js:95:46
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to Reproduce

1、build a mcp server
2、apisix config route

Environment

  • APISIX version (run apisix version): 3.9.1
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V): nginx
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.5.0
  • APISIX Dashboard version, if relevant: 3.0.1
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@dosubot dosubot bot added the bug Something isn't working label Apr 14, 2025
@darkSheep404
Copy link
Contributor

darkSheep404 commented Apr 14, 2025

@kenneth-bro
Copy link
Author

https://www.apiseven.com/blog/what-is-sse https://www.cnblogs.com/lori/p/18757609

need config SSE related plugin ?

is not work

@bfyxzls
Copy link

bfyxzls commented Apr 24, 2025

https://www.apiseven.com/blog/what-is-sse https://www.cnblogs.com/lori/p/18757609
need config SSE related plugin ?

is not work

ok ,I try and test,my plugin sure not work.

@Baoyuantop
Copy link
Contributor

Hi @kenneth-bro, it looks like you're using APISIX version 3.9.1 and dashboard, there's no verification that they work together at this point, can you try configuring it using the admin api?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants