meridian-support-chat / app /mcp_client.py
patrickcmd's picture
Deploy: sync from local
ad6dc26 verified
raw
history blame contribute delete
650 Bytes
from agents.mcp import MCPServerStreamableHttp
def build_mcp_server(url: str) -> MCPServerStreamableHttp:
"""Construct (but do not connect) the Meridian MCP connector.
Caller is responsible for the lifecycle: either
async with build_mcp_server(url) as server: ...
or, for long-lived apps,
server = build_mcp_server(url)
await server.connect()
...
await server.cleanup()
"""
return MCPServerStreamableHttp(
name="meridian-order-mcp",
params={
"url": url,
"timeout": 15,
},
cache_tools_list=True,
max_retry_attempts=3,
)