Skip to content

Harcoded Content-Type in the client cannot be overriden #2375

@lvalladares

Description

@lvalladares

Initial Checks

Description

The StreamableHTTPTransport class used hardcodes the Content-Type to application/json which prevents overriding it to include, for example, custom charsets

The faulty code is on this line

"content-type": "application/json",

Example Code

StreamableHTTPConnectionParams(
            url="....",
            headers={"Content-Type": "application/json; charset=utf-8"},
        ),

Python & MCP Python SDK

1.26.0

I can try to provide a PR but want to confirm first if this is considered an issue by the maintainers or they want to have strict control over the Content-Type header

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions