Is it possible to integrate multiple MCP servers?
I found the example that integrates a single MCP server here: MCP Servers as Tools in CrewAI - CrewAI. However, I need to integrate multiple MCP servers, preferably using “Option 1: Fully Managed Connection”.
Hey Nahum, welcome!
Taking a look at the official Python documentation, you should be able to nest the with
statements, maybe something like this:
with MCPServerAdapter1(server_params1) as tools1, MCPServerAdapter2(server_params2) as tools2:
# Combine the tools from both adapters
all_tools = [*tools1, *tools2]
agent = Agent(
role="Role",
goal="Goal",
backstory="Backstory",
tools=all_tools, # 👈 Pass the combined list of tools here
verbose=True
)
Full disclosure, I haven’t tested this exact approach, but I’ve used something similar to mix MCP tools with standard CrewAI tools over in this other thread.
yes it’s possible. adding more detailed examples in docs this week plus streamable_http finally!
@Max_Moura Thanks! I shall try it and update here whether it worked.
@tonykipkemboi Thanks. Looking forward to studying both examples.