How to build AI agents with MCP: 12 framework comparison (2025)
Twelve agent SDKs now support the Model Context Protocol: Claude Agent SDK, OpenAI Agents SDK, Microsoft Agent Framework, Google ADK, CrewAI, Upsonic, mcp-agent, Agno, DSPy, LangChain, LlamaIndex and PydanticAI. Each is shown connecting to the ClickHouse MCP Server against a public SQL playground, with Python code for every framework. Differences covered include Claude Agent SDK's required tool allowlist, OpenAI's handoff and streaming patterns, and Microsoft's preview status and Azure ties. Choosing among them comes down to language support, ecosystem and how much abstraction you want.
Related posts
- Integrating with ClickHouse MCP
ClickHouse mediumAdept
The open-source mcp-clickhouse server can be wired into five Python agent frameworks: Agno, DSPy, LangChain, LlamaIndex and PydanticAI. Each example uses uv to launch the server over stdio, points it at the public ClickHouse SQL Playground, and uses Anthropic Claude models. The frameworks differ mainly in ceremony. PydanticAI and Agno take the server directly, while DSPy needs a Signature class and manual conversion of MCP tools. LlamaIndex's default max_function_calls of 5 was too low to answer questions and had to be raised to 10. ClickHouse also plans a remote MCP server built into ClickHouse Cloud.
- Tiny Agents in Python: a MCP-powered agent in ~70 lines of code
Hugging Face mediumAdeptHugging Face's huggingface_hub Python SDK now includes an MCP client and a minimal Agent class, letting an LLM pull tools from MCP servers (stdio, SSE or streamable HTTP) and call them during inference. Install it with `pip install "huggingface_hub[mcp]"`, then run agents from the `tiny-agents` CLI, configured by an agent.json that sets model, inference provider and MCP servers, plus an optional PROMPT.md. The MCPClient connects to servers, converts their tool schemas into OpenAI-style function definitions, and streams chat completions while rebuilding tool calls. It then routes each call to the right MCP session. The Agent is essentially a while loop on top of the client, with special exit-loop tools to end a turn.
- How we built the Microsoft Learn MCP Server
Engineering@Microsoft mediumAdeptMicrosoft Learn's MCP Server is a remote Model Context Protocol endpoint, built with the official C# MCP SDK on Azure App Service, that exposes three agent tools (docs search, docs fetch, code sample search) over Streamable HTTP. It sits on the same vector-store knowledge service that powers Ask Learn. The team's lessons: design tools around the agent's search-and-read workflow rather than mirroring internal retrieval parameters, and treat the server as a stateless multi-region distributed service. They also found that tool descriptions measurably change activation rates, so they tune them with automated evals, and that some clients hardcode schemas anyway: renaming a parameter from question to query broke 2–5% of requests until both names were accepted during a deprecation window.
- Tiny Agents: an MCP-powered agent in 50 lines of code
Hugging Face mediumAdeptAn LLM agent built on the Model Context Protocol reduces to a simple while loop around an MCP-aware inference client: connect to MCP servers, convert their tools into OpenAI-style function definitions, pass them to the chat-completion call, execute returned tool calls via the MCP SDK, and feed results back. The TypeScript implementation in huggingface.js extends InferenceClient into an McpClient that holds one session per server and maps tool names to sessions. An Agent class adds a system prompt plus two control-flow tools (task_complete, ask_question). The loop alternates tool calls and results until an exit tool is called, the model answers twice without tools, or a turn limit is reached. The default setup uses Qwen2.5-72B on Nebius, and the model, provider and MCP servers can be swapped.
- What’s MCP all about? Comparing MCP with LLM function calling
Neon mediumAdept
The Model Context Protocol (MCP) builds on LLM function calling by moving tool definitions and execution out of individual LLM applications into standalone servers that any MCP-compatible client can discover and invoke. A Home Assistant light-control function is implemented both ways. The first version uses OpenAI tool definitions in JSON, with the app parsing tool_calls and executing them itself. The second is an MCP server built with the TypeScript SDK, a Zod schema and stdio transport, registered in Cursor. The takeaway is that function calling leaves discovery and execution to each app, while MCP standardizes them so tools can be reused across agents like Cursor, Windsurf and Claude Desktop.