-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Labels
Description
Description
The ToolHive MCP HTTP proxy (/mcp) lacks CORS support, blocking web-based clients (e.g., MCP Inspector). The server returns 405 Method Not Allowed on OPTIONS preflight and misses Access-Control-Allow-Origin.
Steps to Reproduce
- Add an MCP to thv.
- Configure a client, e.g. OpenCode.
- Get the proxy MCP URL from the client config, e.g.
http://localhost:43969/mcpand paste it in MCP inspector. - Attempt to connect.
- Connection fails due to 405 error and CORS.
Request URL http://localhost:43969/mcp
Request Method OPTIONS
Status Code 405 Method Not Allowed
Remote Address 127.0.0.1:43969
Referrer Policy strict-origin-when-cross-origin
GET http://localhost:43969/mcp net::ERR_FAILED
Access to fetch at 'http://localhost:43969/mcp' from origin 'http://localhost:6274' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Expected Behavior
OPTIONShandles preflight with200/204.- Proper
Access-Control-Allow-*headers present on the/mcproute.
Actual Behavior
OPTIONSrequest:405 Method Not Allowed.- Console error:
net::ERR_FAILED(missingAccess-Control-Allow-Origin).
Environment
- OS: macOS M4.
- ToolHive: Version 0.24.0 (0.24.0)
Reactions are currently unavailable