Skip to content

Allow MCP transport configuration #10

@xOxD

Description

@xOxD

MCP is an evolving protocol and now supports additional transports beyond stdio (the current FastMCP default).

The most recent of these transports, Streamable HTTP allows the mcp process to run with a separate lifecycle than the caller. This makes client integration much simpler in non-desktop environments, as the client application no longer needs to launch a python runtime itself. Instead, a local HTTP port can be used for mcp communication.

I propose adding a simple way to configure the MCP transport for mcp_polygon at runtime to take advantage of this:

  • upgrade MCP SDK to latest (1.9+) for the new transport
  • add an env var (MCP_TRANSPORT) which defaults to stdio but can take any valid transport value. Current options are Literal['stdio', 'sse', 'streamable-http'].

There's room the add in authentication in the future but it isn't required for simple deployments. My particular use case is to launch a kubernetes pod with the polygon MCP as a sidecar container to the main application; localhost without auth works fine for this.

I'm happy to open a PR. The required changes are fairly minor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions