-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featurebugSomething isn't workingSomething isn't workingneeds maintainer actionPotentially serious issue - needs proactive fix and maintainer attentionPotentially serious issue - needs proactive fix and maintainer attention
Description
Description
I am currently using the mcp-python-sdk to set up an MCP client with Streamable HTTP as the transport layer protocol. However, since I'm working in an internal network environment, I encounter the following HTTPS error:
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1002)
the code of me is:
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async def main():
# Connect to a streamable HTTP server
#the url of my mcp server can't avail
async with streamablehttp_client("https://mcp.higress.ai/mcp-ip-query/cmfdmaly") as (
read_stream,
write_stream,
_,
):
# Create a session using the client streams
async with ClientSession(read_stream, write_stream) as session:
# Initialize the connection
await session.initialize()
# List available tools
tools = await session.list_tools()
print(f"Available tools: {[tool.name for tool in tools.tools]}")
if __name__ == "__main__":
asyncio.run(main())
To temporarily resolve this issue, I modified /.venv/Lib/site-packages/mcp/shared/_httpx_utils.py by adding "verify": False after line 66.
My request is to support passing a verify parameter when constructing the streamablehttp_client, allowing users to configure certificate verification flexibly without modifying the source code.
References
No response
Metadata
Metadata
Assignees
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featurebugSomething isn't workingSomething isn't workingneeds maintainer actionPotentially serious issue - needs proactive fix and maintainer attentionPotentially serious issue - needs proactive fix and maintainer attention