Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add SSL Certificate Verification Options to FastMCP Client #870

Copy link
Copy link
@iDataist

Description

@iDataist
Issue body actions

Is your feature request related to a problem? Please describe.

When connecting to an MCP server over HTTPS with self-signed or internal certificates, the FastMCP Client fails with SSL certificate verification errors. Currently, there's no straightforward way to disable SSL verification or provide custom certificates when using the Client class.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

Describe the solution you'd like
Please add one or more of the following options to the FastMCP Client:

A verify parameter to disable SSL verification or to provide a custom certificate:

client = Client(MCP_URL, verify=False)
client = Client(MCP_URL, verify="/path/to/certificate.pem")

This is needed when working with internal or development environments that use self-signed certificates or private certificate authorities.

Describe alternatives you've considered
Users need to resort to insecure workarounds like patching Python's SSL module.

Additional context

The issue appears to be in how the transport is inferred and created from the URL string. When a URL is provided, the infer_transport function creates a StreamableHttpTransport for HTTPS URLs, but there's no way to configure the SSL verification options for this transport.

According to FastMCP requirements, streamable-http transport is required for web deployments, and the client needs to connect to the /mcp path. The current implementation doesn't provide a way to handle SSL verification for these connections.

This would align with how other HTTP client libraries (like requests) handle SSL verification, making the API more intuitive and flexible for enterprise environments.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on

    Type

    No type

    Projects

    Status

    Done
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.