When configuring an Agent with multiple MCP endpoints, such as:
agent = Agent(
role=“Research Analyst”,
goal=“Research and analyze information”,
backstory=“Expert researcher with access to external tools”,
mcps=[
“https://mcp.exa.ai/mcp?api_key=your_key”, # External MCP server
“https://api.weather.com/mcp#get_forecast”, # Specific tool from server
“crewai-amp:financial-data”, # CrewAI AMP marketplace
“crewai-amp:research-tools#pubmed_search” # Specific AMP tool
]
)
CrewAI may exhibit several inefficiencies:
-
MCP server restarted for every agent instance
Each Agent creation spawns a new MCPServerStdio (e.g., runningnpx), creating unnecessary process overhead. -
No connection reuse
Each task re-establishes connections to all MCP endpoints, leading to repeated network calls and latency. -
High tool-discovery overhead
Without explicit filtering, the agent enumerates every available tool across each MCP server (sometimes 50+ tools). -
Resource and process leaks
Local MCP processes may not close cleanly if the agent is created repeatedly. -
Inefficient tool execution flow
The agent attempts tools sequentially until one succeeds, generating unnecessary calls and delays.
These behaviors can significantly impact performance, especially in workflows involving multiple agents or frequent task execution.
Can we use lazy-loaded MCP connections and reuse them across agents, or is there a better recommended approach?