mcp/examples pairs LangChain, CrewAI, Google ADK, and the OpenAI Agents SDK with the hosted MCP server, one agent.py each. Two of those already default to Claude models under the hood, but nothing shows Claude's own SDK talking to e2a directly, no framework, no local MCP client, which is the Anthropic-side equivalent of what openai-agents/ is for OpenAI. The Messages API's MCP connector (a mcp_servers entry plus an mcp_toolset tool, beta mcp-client-2025-11-20) does exactly that: point it at the hosted endpoint and Claude calls the tools itself in one messages.create call.
I put together mcp/examples/anthropic/ in that shape (agent.py, requirements.txt, README) and extended the existing contract test with an Anthropic case. No live keys here, so what I can show is the wiring: the existing five-test suite plus my addition, and a stub that intercepts the SDK call and checks the request shape without hitting the network.
$ python3 -m unittest test_framework_examples.py -v
test_all_frameworks_support_self_hosted_mcp_and_email_safety ... ok
test_anthropic_uses_current_mcp_connector ... ok
test_crewai_uses_current_native_mcp_configuration ... ok
test_langchain_uses_current_agent_and_http_transport ... ok
test_openai_agents_uses_current_remote_mcp_resilience_options ... ok
Ran 5 tests in 0.001s
OK
$ python3 verify_anthropic_example.py
ALL ASSERTIONS PASSED
captured request kwargs: {'model': 'claude-sonnet-4-6', 'max_tokens': 1024,
'mcp_servers': [{'type': 'url', 'url': 'https://api.e2a.dev/mcp', 'name': 'e2a',
'authorization_token': 'e2a_test_key'}],
'tools': [{'type': 'mcp_toolset', 'mcp_server_name': 'e2a'}],
'betas': ['mcp-client-2025-11-20']}
printed output: 'You have 2 unread messages.'
Not run against a live Anthropic key or the hosted MCP server, same as the other four don't ship a live run in CI either.
One thing I'm not sure about: I pinned anthropic>=1.0,<2 in requirements.txt since that's the version I tested against, but I don't know the actual floor where mcp_servers landed on beta.messages.create. Do you have a narrower minimum you'd rather pin?
Happy to open a PR with this.
mcp/examples pairs LangChain, CrewAI, Google ADK, and the OpenAI Agents SDK with the hosted MCP server, one agent.py each. Two of those already default to Claude models under the hood, but nothing shows Claude's own SDK talking to e2a directly, no framework, no local MCP client, which is the Anthropic-side equivalent of what openai-agents/ is for OpenAI. The Messages API's MCP connector (a
mcp_serversentry plus anmcp_toolsettool, betamcp-client-2025-11-20) does exactly that: point it at the hosted endpoint and Claude calls the tools itself in onemessages.createcall.I put together
mcp/examples/anthropic/in that shape (agent.py, requirements.txt, README) and extended the existing contract test with an Anthropic case. No live keys here, so what I can show is the wiring: the existing five-test suite plus my addition, and a stub that intercepts the SDK call and checks the request shape without hitting the network.Not run against a live Anthropic key or the hosted MCP server, same as the other four don't ship a live run in CI either.
One thing I'm not sure about: I pinned
anthropic>=1.0,<2in requirements.txt since that's the version I tested against, but I don't know the actual floor wheremcp_serverslanded onbeta.messages.create. Do you have a narrower minimum you'd rather pin?Happy to open a PR with this.