Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To connect an MCP server to CrewAI, install the MCP extra for crewai-tools, describe the server with StdioServerParameters or an SSE URL, create an MCPServerAdapter, and pass its tools to an Agent. Use the adapter as a context manager for normal runs, or call stop() in a finally block when you need manual lifecycle control.
What the integration does
Model Context Protocol (MCP) supplies tools from an external server; CrewAI supplies the agent, task and orchestration. The documented MCPServerAdapter in crewai-tools discovers the server’s tools and exposes them in the format a CrewAI agent can use. Your crew still decides what work to perform, while the MCP server performs the external operations.
The examples below follow the current crewAI tools README and CrewAI annotation documentation. Repository and documentation APIs can change, so check the syntax against the versions you install.
1. Install the MCP dependencies
Install the optional extra in the same virtual environment as your CrewAI application:
#1 Best Overall
pip install 'crewai-tools[mcp]'
If you use uv:
uv add crewai-tools --extra mcp
The extra supplies the MCP client dependencies used by MCPServerAdapter. Keep the package versions in your lockfile so deployments use the same adapter behavior you tested.
2. Connect a local STDIO server
STDIO starts a local MCP process and communicates with it over standard input and output. The server command, arguments and environment variables are supplied with StdioServerParameters.
Complete context-managed example
import os
from crewai import Agent, Crew, Task
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
server_params = StdioServerParameters(
command="uvx",
args=["--quiet", "your-mcp-server"],
env={
"API_KEY": os.environ["MCP_API_KEY"],
},
)
with MCPServerAdapter(server_params) as tools:
researcher = Agent(
role="Research assistant",
goal="Answer questions using the connected MCP tools",
backstory="You use only the tools that are useful for the assigned task.",
tools=tools,
verbose=True,
)
task = Task(
description="Use the available MCP tools to gather the requested facts and cite the returned results.",
expected_output="A concise, evidence-based answer.",
agent=researcher,
)
crew = Crew(agents=[researcher], tasks=[task], verbose=True)
result = crew.kickoff()
print(result)
When the with block begins, the adapter starts the MCP connection and obtains the available tools. The agent receives those tools through tools=tools. Exiting the block closes the adapter, including after normal completion.
Recommended Free Tools
Passing server configuration safely
- Put secrets in environment variables rather than source control.
- Use an absolute executable or a reproducible launcher when your production environment has a different
PATH. - Keep the MCP server’s arguments explicit; they are part of the process you are executing.
3. Connect a remote SSE server
For a server that exposes an SSE endpoint, the README shows a parameter dictionary containing the server URL:
from crewai import Agent, Crew, Task
from crewai_tools import MCPServerAdapter
server_params = {"url": "http://localhost:8000/sse"}
with MCPServerAdapter(server_params) as tools:
agent = Agent(
role="Operations assistant",
goal="Complete the task with the remote MCP tools",
backstory="You verify tool results before responding.",
tools=tools,
)
task = Task(
description="Inspect the available data and report the requested status.",
expected_output="A status report based on tool output.",
agent=agent,
)
Crew(agents=[agent], tasks=[task]).kickoff()
The URL is illustrative, not a recommendation for a public service. Confirm that your installed crewai-tools version supports the transport and parameter shape you intend to use. Treat a remote endpoint as an external trust boundary and use the endpoint’s documented authentication and network controls.
4. Choose the adapter lifecycle
| Approach | Use it when | Cleanup | Trade-off |
|---|---|---|---|
| Context manager | A script or crew has one straightforward run | Automatic when the block exits | Less control over connection duration |
| Manual adapter | A service needs explicit startup and shutdown | Your code calls stop() |
More control, but cleanup is your responsibility |
Manual management with guaranteed cleanup
from crewai import Agent, Crew, Task
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
params = StdioServerParameters(
command="uvx",
args=["--quiet", "your-mcp-server"],
)
adapter = MCPServerAdapter(params)
try:
adapter.start()
agent = Agent(
role="Tool user",
goal="Complete the assigned operation",
backstory="You inspect tool responses for errors.",
tools=adapter.tools,
)
task = Task(
description="Perform the operation exposed by the MCP server.",
expected_output="A clear result from the operation.",
agent=agent,
)
Crew(agents=[agent], tasks=[task]).kickoff()
finally:
adapter.stop()
Use the finally block even when kickoff() raises an exception. A process that remains alive can leak resources, hold ports, or leave a child MCP server running.
Rank #2
5. Use MCP in a CrewBase project
The CrewAI annotation guide documents another pattern: define mcp_server_params on a @CrewBase class and retrieve tools with get_mcp_tools(). The guide describes lazy adapter startup and an internal after-kickoff hook that stops it. Because this API is tied to the installed CrewAI version, verify the current guide and generated project template before adopting it.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
from crewai.project import CrewBase, agent, crew, task
from crewai import Agent, Crew, Task
from mcp import StdioServerParameters
@CrewBase
class ResearchCrew:
mcp_server_params = [
StdioServerParameters(
command="uvx",
args=["--quiet", "your-mcp-server"],
)
]
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config["researcher"],
tools=self.get_mcp_tools(),
)
@task
def research_task(self) -> Task:
return Task(config=self.tasks_config["research_task"])
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
verbose=True,
)
Use the project’s actual decorator and configuration conventions if they differ. The important integration point is that get_mcp_tools() supplies the server tools to the agent.
6. Decide between a Crew and a Flow
CrewAI describes Crews as suited to autonomous collaboration among agents, while Flows provide structured, event-driven orchestration with more precise control. MCP does not replace either abstraction: it supplies external capabilities.
- Choose a Crew when agents should decide how to collaborate and which connected tools to use.
- Choose a Flow when you need explicit stages, branching, state transitions or predictable sequencing around MCP calls.
Security and capability boundaries
STDIO runs code locally
A STDIO integration launches a process on the machine running your CrewAI application. Review the server source, executable, arguments and environment before connecting it. Run it with the least operating-system permissions practical.
Remote SSE is not automatically trustworthy
A remote MCP server can return malicious instructions or manipulated data. Use only endpoints you trust, authenticate them according to their documentation, and treat tool descriptions and outputs as untrusted input to the agent.
Expose only required tools
Least privilege is a practical safeguard: connect a server that offers the smallest useful capability set, and avoid giving an agent write, deletion or credential-bearing tools when read-only access is enough.
Know what the adapter returns
The referenced README describes support for MCP server tools rather than prompts and resources, and says the adapter returns only the first text output from a tool result. These behaviors may be version-dependent. If your application needs structured, binary or multiple-result responses, validate the installed adapter before designing around that output.
Performance, reliability and operating costs
- Start the adapter once per logical run rather than reconnecting for every tool call.
- For long-lived services, monitor child-process exit, SSE disconnects and timeouts, and implement application-level retry rules appropriate to each operation.
- Keep tool descriptions and task instructions specific; fewer irrelevant tools reduce agent deliberation and accidental calls.
- Log connection failures and tool names, but redact API keys, cookies and sensitive arguments.
- Measure the MCP server separately from CrewAI: startup time, network latency, tool execution time and model latency are different failure domains.
The packages themselves do not establish a universal request price. Any model, hosting, API or MCP-provider charges depend on the services you connect and their own terms.
Common errors and fixes
“No module named mcp” or adapter import errors
Install the extra in the active environment (pip install 'crewai-tools[mcp]'), then confirm your shell, IDE and deployment process use that same environment.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallThe local command cannot be found
Check the executable with which uvx (or the equivalent on your operating system), use an absolute path, and ensure the service account has permission to execute it.
The server exits immediately
Run the command manually with the same arguments and environment. A missing secret, invalid argument or server-side startup exception usually appears in its stderr output.
SSE connection fails or hangs
Verify the URL path, DNS, firewall and proxy settings. Confirm that the endpoint is actually an MCP SSE endpoint and that your installed adapter supports its current protocol version.
The agent never calls the tool
Inspect the adapter’s discovered tools, make the task explicitly require the relevant operation, and remove unrelated tools that may confuse tool selection.
Results are incomplete
Check whether the server returned multiple content items or non-text content. The documented adapter behavior may expose only the first text output; handle richer result formats at the protocol or server layer if your version permits it.
Resources remain after a failed run
Use a context manager or put adapter.stop() in finally. Do not rely on garbage collection to terminate a child process.
Or skip the browser setup
If your CrewAI agent needs website screenshots, ScreenshotNeo provides an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. It can also be called directly with one HTTP request; see the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Before capture, cookie banners, newsletter popups and chat widgets are removed. Bot checks, blank pages, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result. ScreenshotNeo also supports an MCP workflow for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Can one CrewAI agent use tools from more than one MCP server?
The adapter accepts server configuration and exposes the resulting tools; consult your installed version’s API for the supported multi-server configuration shape before combining servers.
Should I use STDIO or SSE in production?
Use STDIO when you intentionally operate a local process; use SSE when the server is separately hosted and its network and trust controls are acceptable. Neither choice removes the need to validate the server.
Best Value
Does this integration provide MCP prompts and resources?
The referenced README describes tool support and first-text-output behavior, not general prompt or resource integration. Verify current package capabilities if those primitives are required.
Frequently Asked Questions
Can one CrewAI agent use tools from more than one MCP server?
The adapter exposes configured server tools; verify the installed version’s multi-server configuration API before combining servers.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Should I use STDIO or SSE in production?
Use STDIO for an intentionally local process and SSE for a separately hosted server with acceptable network and trust controls.
Does the adapter support MCP prompts and resources?
The cited README documents tool support and first-text-output behavior; check your installed version for any broader primitive support.
The Bottom Line
Install the MCP extra, configure a trusted STDIO or SSE server, pass MCPServerAdapter tools to your CrewAI agent, and guarantee cleanup with a context manager or finally.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

