Learn how to connect CrewAI to remote MCP servers using the flexible Streamable HTTP transport.
MCPServerAdapter
Configuration: You’ll need to provide the server’s base URL for MCP communication and specify "streamable-http"
as the transport type.with
statement), which handles the connection’s setup and teardown automatically.
"http://localhost:8001/mcp"
with the actual URL of your Streamable HTTP MCP server.
MCPServerAdapter
connection manually.
mcp_server_adapter.stop()
when you are done to close the connection and free up resources. A try...finally
block is the safest way to ensure this.