Skip to main content
Dublin Library

The Publishing Project

MCPs and AI Agents

 

Model Context Protocols (MCPs) are an interesting adjacent technology to large language models (LLMs) and AI agents. They provide a standardized way for AI models to interact with external data sources, tools, and systems, enabling them to access real-time information and perform complex tasks that go beyond their initial training data.

This post explores what MCPs are, how they work, and how they can be used to enhance the capabilities of AI agents.

What Are Model Context Protocols? #

Model Context Protocols have emerged as a pivotal technology for enhancing the capabilities of AI agents. At its core, an MCP is a standardized framework that governs how AI models, particularly large language models (LLMs), interact with external data sources, tools, and systems.

Think of it as a universal translator and a set of instructions that allow an AI to access and utilize information beyond its initial training data. Before MCP, the problem was one of fragmentation; connecting an AI to a new data source required building custom integrations, a process that is slow, insecure, and difficult to scale.

Anthropic developed MCP and open-sourced the protocol to foster a more interconnected and capable AI ecosystem. MCP's primary goal is to break down the information silos that often isolate AI models, enabling them to work with real-time information and perform a wider range of complex, multi-step tasks.

Understanding the MCP Architecture: One Client, Many Servers #

A common point of confusion is how many clients and servers you need. The architecture is refreshingly straightforward: your AI agent uses a single MCP client to communicate with multiple, distinct MCP servers.

Think of it like a web browser, an analogy that holds up well to scrutiny:

  • Your AI Agent (with its MCP Client): This is your web browser (e.g., Chrome, Firefox). You only need one browser installed on your computer to access the entire internet. Just as a browser can handle various protocols (like HTTP for websites or FTP for files), the MCP client is designed to communicate with any compliant MCP server, regardless of the underlying service it represents.
  • External Services (each with an MCP Server): These are the countless websites on the internet. Each service—be it a calendar API, a corporate database, a code repository, or a local file system—runs its own dedicated MCP server. This server's job is to translate the service's specific functions into the universal MCP standard.

You don't need a special "Google browser" to visit Google and a separate "Wikipedia browser" to visit Wikipedia. In the same way, your AI agent's single MCP client can discover and interact with an MCP server for your calendar, another for your code editor, and a third for a weather API, all through one standardized interface.

Component Placement #

To implement this correctly, you should place the components in a logical, distributed manner:

MCP Client
Place this component directly inside your AI application or agent. If you're building a coding assistant in VS Code, the VS Code extension would host the MCP client. This client acts as the agent's universal gateway to talk to the outside world.
MCP Server
Place a dedicated MCP server alongside each individual tool, data source, or service you want to grant the AI access to. For example, a small, lightweight application running on your machine could act as the MCP server for your local file system, while another MCP server might be running on a company cloud instance to provide secure access to a Jira project.

How MCPs Are Used #

MCPs operate on this client-server architecture. An MCP client, integrated into an AI application, communicates with an MCP server, which exposes data and tools from an external system. This setup allows for a secure and standardized two-way communication channel, unlocking powerful new use cases.

Here are some key ways you can utilize MCPs:

  • Desktop Assistants: AI-powered desktop assistants can use a local MCP server to securely access user files, applications, and system tools. For example, a user could ask, "Summarize the key points from my meeting notes this morning and create a to-do list in my task manager." The assistant, via a local MCP server, would securely access the calendar to find the meeting, locate the notes file on the hard drive, read it, and then interact with a separate MCP server for the task manager application—all without the user's private data being sent to a third-party cloud.
  • Enterprise Solutions: In a business environment, MCPs can connect AI agents to internal knowledge bases, CRM systems, and other proprietary software. Imagine a financial analyst asking an AI agent, "What was our Q3 revenue for the Alpha project, and how does it compare to the initial forecast?" The agent's MCP client would connect to two different MCP servers: one for the accounting system to get the actual revenue, and another for the project management tool to retrieve the forecast data. The agent then synthesizes this information to provide a comprehensive answer, a task that would have previously required manual data pulling from multiple siloed systems.
  • Software Development: Integrating MCPs into IDEs gives AI coding assistants real-time access to a project's codebase and documentation. A developer could highlight a block of code and ask, "Find all usages of this function within the current repository and identify any potential race conditions." The AI assistant, using an MCP server integrated with the IDE's indexing and analysis tools, can perform a deep code analysis that goes far beyond simple text search, providing intelligent and actionable feedback. This also dramatically speeds up onboarding for new engineers, who can now query the codebase in natural language.

The Interaction Between MCPs and AI Agents #

The interaction between MCPs and AI agents is fundamental to unlocking the next level of AI capabilities. It transforms the AI from a passive knowledge base into an active participant in digital workflows.

  • Discovery: An AI agent, through its MCP client, queries an MCP server to discover the available tools and data sources. This isn't just a simple list; the server provides a structured description of each tool, including its purpose, the parameters it accepts (e.g., a get_user_details tool might require a user_id), and the format of the data it returns. This allows the AI agent to understand how to use the tool correctly without prior hardcoding.
  • Execution: When a user gives the AI agent a task, the agent identifies the appropriate tool and executes it via the MCP server. This execution is governed by permissions set on the server, which acts as a gatekeeper. For example, an agent might have read-only access to a database but be denied write permissions, preventing accidental or malicious data modification and ensuring a secure-by-default environment.
  • Contextual Understanding: MCPs allow for the passing of rich contextual information. When an agent asks for a user's purchase history, the MCP server might return not just the list of orders, but also contextual metadata like "user_is_premium_member" or "last_login_date". This extra context allows the agent to provide a more personalized and intelligent response, such as offering a discount to a loyal customer.
  • Real-Time Data Access: This is a paradigm shift from models that rely solely on their static training data. With MCP, an AI agent interacting with a stock market API can provide up-to-the-second analysis, or a customer service bot can access the very latest support ticket information, ensuring its responses are always relevant and accurate.
  • Enhanced Reasoning: By interacting with multiple tools through a standardized protocol, AI agents can perform complex, multi-step "chain-of-thought" reasoning. Consider a request like, "Plan a marketing campaign for our new product launch." An AI agent could use MCP to:
    1. Connect to the product database to get product details.
    2. Access the CRM to identify the target customer segment.
    3. Query a market research tool for competitor analysis.
    4. Use a project management tool to draft a campaign timeline. This process, where the output of one tool becomes the input for the next, is powerfully enabled by MCP's standardized framework.

Implementing MCP: The Official Specification #

A natural next question for developers is, "How can I start building with this?" The power of MCP lies in its status as an open standard, which means there is a formal, public specification you can use to implement compliant agents and servers.

This detailed specification is the blueprint for the protocol. It outlines everything a developer needs to know, including:

  • The Core Architecture: A formal definition of the roles of the client and server.
  • The Communication Protocol: The specific details of the communication layer, which is based on JSON-RPC.
  • Message and Data Structures: The exact formats for requests, results, errors, and notifications, as well as the structure for defining tools and resources.

By adhering to this specification, you ensure true interoperability. An MCP client you build will be able to correctly communicate with any MCP server built by someone else, and vice-versa. This prevents vendor lock-in and fosters a rich, collaborative ecosystem of tools and agents.

You can find the official specification, along with developer documentation, Software Development Kits (SDKs) for popular languages like TypeScript and Python, and example implementations on the official Model Context Protocol website: modelcontextprotocol.io.

In essence, MCPs act as the crucial bridge that connects the powerful reasoning capabilities of AI agents with the vast and dynamic world of real-world data and functionality. This standardized approach simplifies development, enhances security, and ultimately makes AI agents more helpful, autonomous, and effective in a wide array of applications.

A sensible next step is to explore building your own MCP server or integrating an MCP client into an existing AI application. The open standard and available resources make it easier than ever to get started on this exciting frontier of AI development.

Edit on Github