Model Context Protocol (MCP)

  • MCP is an open-source standard protocol for connecting AI applications to external tools and data.
    • Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect electronic devices, MCP provides a standardized way to connect AI applications to external systems.

What is MCP? (A Quick Recap)

  • MCP (Model Context Protocol) is an open standard that lets AI applications, like Claude, use outside tools and data instead of relying only on what they were trained on.
  • Three participants work together:
    • Host: the AI application a person actually uses, like Claude Desktop.
    • Client: the part of the host that connects out to a server to get information for the AI.
    • Server: a program β€” often one you write yourself β€” that exposes tools the AI is allowed to call.

MCP Primitives: Tools, Resources, and Prompts:

  • Tool: Executable functions on the server that perform actions. Ultimately, this enables the AI to ask the server to do things.
    • Example: querying the database, calling APIs, performing calculations, etc.
  • Resource: Contextual, ready-only information for the AI. Utimately, this enables the AI to ask the server for information.
    • Example: File, database schemas, function document strings, etc.
  • Prompt: A reusable template designed to be selected and used by a user.

How Data is Transferred:

  • Data Layer: Defined as a JSON-RPC. Information formatted in JSON, designed to say, here’s the things that you can do on the server and client.
  • Transport Layer: Local (STDIO, IPC) or Remote (HTTP). This is how the data gets from the client to the server and back.

MCP Benefits:

  • Standardization: Provides a common framework for connecting AI applications to external tools and data, making it easier for developers to create and integrate AI applications.
  • Flexibility: Allows for a wide range of tools and resources to be connected to AI applications.
  • Reduce hallucinations: By providing the AI with access to external tools and data, it can reduce the likelihood of hallucinations and improve the accuracy of its responses.
    • MCP connects models to real data; current files and live information
  • Language Agnostic: Build once, use everywhere!