mcp.connect_http¶
Connect to an MCP server over streamable HTTP. Raises on a connect failure or the handshake failing.
Parameters
spec:{url: string, headers: {[string]: string}?, max_retries: number?}url— The server endpoint URL.headers— Extra HTTP headers sent with every request (e.g. anAuthorizationheader).max_retries— How many times to retry a dropped event stream before giving up. Absent leaves rmcp's default of retrying indefinitely; set a bound so a server that stays down eventually surfaces a failure rather than reconnecting forever.
Returns