MCP is all you need — Samuel Colvin, Pydantic

AI EngineerAbout 7 min readJul 19, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • MCP (Modular Code Platform): A protocol for agent-to-agent and agent-to-tool communication, enabling dynamic tool integration and features like logging, sampling, and tracing.
  • Tool Calling: A core MCP primitive that allows agents to utilize external tools without prior knowledge of their implementation.
  • Sampling: A mechanism within MCP where a server (acting as a tool) can request the client to make LLM calls on its behalf, effectively piggybacking on the client's LLM access.
  • Pydantic: A Python data validation library widely used in general Python development and GenAI.
  • Pydantic AI: An agent framework for Python built on the same principles as Pydantic.
  • Pydantic Logfire: An observability platform for Pydantic and Pydantic AI applications.
  • FastMCP: An implementation of MCP used to set up an MCP server.
  • Observability: The ability to monitor and understand the internal state of a system, often through logging, tracing, and metrics.

Main Topics and Key Points

Introduction to MCP and its Relevance

  • The speaker, creator of Pydantic, introduces MCP as a solution to over-complication in agent communication.
  • MCP is presented as a way to compose agents and tools without tight coupling, similar to how browsers interact with websites.
  • The talk focuses on autonomous agents and code, not the original "cursor-style" coding agents MCP was designed for.
  • Tool calling is highlighted as the most relevant MCP primitive for this use case.

Advantages of MCP Tool Calling over Open API

  • MCP offers dynamic tools that can appear and disappear during agent execution.
  • MCP supports logging, allowing tools to return data to the user while still executing.
  • MCP enables sampling, where tools can request the client to make LLM calls.
  • MCP's standard input/output operation is useful for various use cases.

The Problem of LLM Access in Multi-Agent Systems

  • In systems where multiple agents act as tools, each agent typically needs its own LLM access.
  • This leads to configuration overhead and concerns about cost, especially for remote MCP servers.
  • Sampling is introduced as a solution to allow tools to leverage the client's LLM access.

Sampling Explained

  • Sampling allows an MCP server (acting as a tool) to request the client to make LLM calls.
  • The client proxies the request to the LLM, receives the response, and sends it back to the server.
  • This enables tools to perform inference without needing their own LLM configuration.

Demo: Research Agent with Pippi Download Tool

  • A simplified research agent is presented as an example, focusing on a tool that queries BigQuery for Pippi download statistics.
  • The tool uses Pydantic AI for agent definition and validation.
  • The tool includes retry logic to handle incorrect SQL queries generated by the LLM.
  • MCP context is used to provide type-safe access to logging within the tool.

Code Walkthrough: Pippi Download Tool

  • The code demonstrates how to query BigQuery for Pippi download numbers.
  • It shows how to strip markdown block quotes from SQL queries and validate the table name.
  • The code uses context.log to send progress updates to the client.
  • The query results are formatted as XML for easier consumption by the LLM.

Code Walkthrough: MCP Server Setup

  • The code shows how to set up an MCP server using FastMCP.
  • The tool's docstring is used as the description for the tool in the MCP protocol.
  • The speaker emphasizes the benefit of performing inference within the tool to limit the context window of the main agent.
  • The MCP server runs over standard input/output by default.

Code Walkthrough: Main Application

  • The main application defines an agent that uses the Pippi MCP server as a tool.
  • The agent is given the current date to avoid LLM assumptions about the year.
  • The agent is run to answer the question of how many downloads Pydantic has had this year.

Observability with Logfire

  • The speaker briefly shows how the agent's execution can be observed in Logfire.
  • Logfire provides insights into the calls made to the LLM, the MCP client, and the MCP server.
  • The actual SQL query generated by the tool can be inspected in Logfire.

Important Examples, Case Studies, or Real-World Applications Discussed

  • Research Agent: A research agent that uses a tool to query BigQuery for Pippi download statistics. This example demonstrates how MCP can be used to build complex agents that can access external data sources.
  • Cursor-style Agents: The original use case for MCP, where agents assist developers in writing code. While the talk focuses on autonomous agents, the speaker acknowledges the relevance of MCP to this use case.

Step-by-Step Processes, Methodologies, or Frameworks Explained

  • Setting up an MCP server: The speaker walks through the code required to set up an MCP server using FastMCP, including registering tools and defining their descriptions.
  • Using sampling: The speaker explains the process of how an MCP server can request the client to make LLM calls on its behalf, including the steps involved in proxying the request and returning the response.
  • Integrating logging into tools: The speaker demonstrates how to use the MCP context to provide type-safe access to logging within tools, allowing them to send progress updates to the client.

Key Arguments or Perspectives Presented, with Their Supporting Evidence

  • MCP simplifies agent communication: The speaker argues that MCP provides a simpler and more flexible way to build multi-agent systems compared to other approaches. This is supported by the examples of dynamic tool integration, logging, and sampling.
  • Performing inference within tools reduces context window size: The speaker argues that performing inference within tools can help to limit the context window of the main agent, improving performance and reducing costs. This is supported by the example of the Pippi download tool, which generates SQL queries within the tool rather than in the main agent.

Notable Quotes or Significant Statements with Proper Attribution

  • "MCP is all you need is obviously a a play on Jason Lou's talks pantic is all you need... and it has the same basic idea that people are over complicating something that we can use a single tool for."
  • "Sampling is very powerful, not that widely supported at the moment."

Technical Terms, Concepts, or Specialized Vocabulary with Brief Explanations

  • LLM (Large Language Model): A type of artificial intelligence model that is trained on a large dataset of text and can be used to generate text, translate languages, and answer questions.
  • Context Window: The amount of text that an LLM can consider when generating a response.
  • Standard Input/Output (Standard IO): A standard way for programs to communicate with each other, where one program's output is used as the input to another program.
  • Type Safety: A programming language feature that prevents programs from performing operations on data of the wrong type.

Logical Connections Between Different Sections and Ideas

  • The talk starts by introducing MCP and its relevance to agent communication.
  • It then discusses the advantages of MCP tool calling over Open API.
  • The talk then moves on to the problem of LLM access in multi-agent systems and introduces sampling as a solution.
  • The speaker then presents a demo of a research agent that uses a Pippi download tool to illustrate how MCP can be used in practice.
  • The talk concludes with a brief overview of observability with Logfire.

Data, Research Findings, or Statistics Mentioned

  • Pydantic is downloaded about 360 million times a month (approximately 140 times a second).
  • The demo agent successfully retrieved the number of Pydantic downloads for the current year (1.6 billion).

Brief Synthesis/Conclusion of the Main Takeaways

The talk advocates for MCP as a powerful tool for building modular and scalable multi-agent systems. It highlights the benefits of MCP's tool calling mechanism, particularly when combined with sampling, for enabling agents to access external tools and LLMs without tight coupling or excessive configuration. The demo and code walkthrough provide a practical example of how MCP can be used to build a research agent that can access and process data from external sources. The speaker encourages the audience to explore MCP and its capabilities for building their own agent-based applications.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.