docs(examples): add CrewAI MCP example#170
Merged
Merged
Conversation
Mirrors the LangChain / ADK / OpenAI Agents examples: a single-agent CrewAI crew wired to the e2a MCP surface via `crewai-tools`' MCPServerAdapter, in both stdio and hosted Streamable HTTP variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verified via dry run that the bare deps don't pull the right extras: - `crewai-tools[mcp]` is required for the `mcpadapt` bridge (otherwise `MCPServerAdapter` reports `MCP_AVAILABLE = False`). - `crewai[anthropic]` is required for the native Anthropic provider used by `"anthropic/claude-sonnet-4-6"`. - `email-validator` is needed at runtime because the e2a tool schemas carry email-typed fields that crewai-tools wires through pydantic. With these, both `agent.py` and `agent_hosted.py` cleanly load all 18 e2a tools and reach the LLM call (verified end-to-end against a dummy Anthropic key, which 401s as expected). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp/examples/crewai/mirroring the shape of the LangChain / ADK / OpenAI Agents examples.crewai-tools'MCPServerAdapter.agent.py(stdio vianpx -y @e2a/mcp-server) andagent_hosted.py(Streamable HTTP tohttps://mcp.e2a.dev/mcp).mcp/examples/README.mdindex gets a CrewAI row.Why
We have working examples + upstream docs PRs for ADK (merged, google/adk-docs#1793) and LangChain (open, langchain-ai/docs#4150). CrewAI is the next-most-trafficked Python agent framework with a third-party tools integration index — adding the example here unblocks the corresponding upstream docs PR.
Test plan
cd mcp/examples/crewai && pip install -r requirements.txtpython agent.py "what's in my inbox?"against a test account (stdio)python agent_hosted.py "what's in my inbox?"against a test account (hosted)MCPServerAdapterloads all 18 e2a tools (the script prints the count + names at startup)streamable-httptransport key against the currentcrewai-toolsrelease before merging🤖 Generated with Claude Code