Skip to content

docs(examples): add CrewAI MCP example#170

Merged
jiashuoz merged 2 commits into
mainfrom
feat/crewai-mcp-example
May 28, 2026
Merged

docs(examples): add CrewAI MCP example#170
jiashuoz merged 2 commits into
mainfrom
feat/crewai-mcp-example

Conversation

@jiashuoz
Copy link
Copy Markdown
Member

Summary

  • New runnable example at mcp/examples/crewai/ mirroring the shape of the LangChain / ADK / OpenAI Agents examples.
  • Single-agent CrewAI crew wired to the e2a MCP surface via crewai-tools' MCPServerAdapter.
  • Two transport variants: agent.py (stdio via npx -y @e2a/mcp-server) and agent_hosted.py (Streamable HTTP to https://mcp.e2a.dev/mcp).
  • mcp/examples/README.md index 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.txt
  • python 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)
  • Confirm MCPServerAdapter loads all 18 e2a tools (the script prints the count + names at startup)
  • Sanity-check the streamable-http transport key against the current crewai-tools release before merging

🤖 Generated with Claude Code

jiashuoz and others added 2 commits May 27, 2026 18:52
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>
@jiashuoz jiashuoz merged commit ff34f10 into main May 28, 2026
10 checks passed
@jiashuoz jiashuoz deleted the feat/crewai-mcp-example branch May 28, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant