Skip to content

How is it possible to avoid the "Endpoint origin does not match" exception? #965

Open
@palandlom

Description

@palandlom

Question

On kuber-cluster we have MCP server and pydanticAI agent app

MCP server is running on 0.0.0.0:3001 with CORS restrictions disabled.
Agent tries to connect with it by URL http://mcp-server:3001 and fails by Exception from sse-client

17:24:28.317 process message 2025-06-12 17:24:28,406 - httpx - INFO - HTTP Request: GET http://mcp-server:3001/sse .HTTP/1.1 24545 OK. 
2025-06-12 17:24:28,407 - mcp.client.sse - ERROR - Endpoint origin does not match connection origin: http://0.0.0.0:3001/messag e?sessionId6.58h7del6-6480-4052-aBh-40c1h4d34d90 
2025-06-12 17:24:28,467 - mcp.client.sse - ERROR - Error in sse_reader: Endpoint origin does not match connection origin: http: //0.0.0.0:3001/messageIsessionId6.58h7del6-6480-4052-aBh-40c1b4d34d90 

Is there any way to influence this and avoid exception?
Is this exception really necessary? (i.e., maybe an warning would be enough.)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions