2. What is MCP?
3m

What is MCP?

The Model Context Protocol (MCP) is a standard way for language models and AI agents to interact with external data sources and backend systems.

Why MCP?

Simply put, MCP brings a set of standards for the tools we provide to agents. Before MCP, teams using would build tools that call GraphQL by a hashed id. This practice works great, but MCP adds a set of lifecycle events around those tools like a "tool list changed" notification from the server to the agent.

What do I use MCP for?

  • External use: Enable your customers to interact with your business through an agent
  • Internal use: Understand your org's APIs so you can:
    • Explore the data and capabilities available
    • Build new features faster
    • Write easily

Understanding the architecture

A diagram showing the MCP server positioned between AI-powered frontends and backend systems, facilitating communication and exchange of data

The MCP server is a server that sits between the AI agent and the backend systems.

To help the MCP server do its job, we equip it with MCP tools.

MCP Tools

An MCP tool is a function that the MCP server can invoke.

Basic tools will specify at least a name, description, and inputSchema. The inputSchema defines the JSON schema for any required inputs the assistant needs to provide when calling the tool.

A tool's name and description helps the AI agent understand its purpose. When powered by an LLM like Claude, the agent can use its broad understanding of language and semantics to determine which tool is most appropriate when responding to a user's question.

Using tool descriptions, the AI agent can determine which tool to invoke based on the user's request.

A diagram showing how the server executes the logic for the invoked tool, sending a query to the GraphQL API

After the user grants permission for the MCP server to invoke a tool, the MCP server will execute the tool request.

A diagram showing how the assistant accesses an interface of tools and can invoke them as needed

A note on tool annotation

Tool descriptions help AI agents understand what the tool does and how to best use it. 's declarative nature and typed schema makes this easy. You can also:

  • Provide verbose and clear (e.g. GetFiveRecentIssues vs GetIssues))
  • Add a comment above the (prefixed by #) that says exactly what the tool does and if it requires any parameters. This will override the auto-generated description from your schema.
  • Add comments about parameters above each value to describe valid values to pass.
  • Where needed names to a more verbose value. For example userId is more descriptive than id when providing context about your tool.

For more information on writing tool descriptions, check out the following resources:

  • Writing tools for agents
  • Best practices for tool definitions

The Apollo MCP Server

In the case of the Apollo MCP Server, the tool comes in the form of a . The server uses the self-documenting to tell the agent everything it needs to know about each tool's purpose.

With , we can write specific queries that request data from multiple backend services all at once. GraphQL does the heavy-lifting of for us.

It also helps ensure that authentication policies are enforced, that APIs are called in the right sequence, and that only the appropriate data is used and returned.

To use the Apollo MCP server, you need a API, a graph, that brings all your services behind one endpoint for the MCP server to call.

Server to API communication

On the other side of the equation, we need our MCP server to be able to communicate with our backend services. We can execute queries against the API by sending them to the local .

A diagram showing how the server executes the logic for the invoked tool, sending a query to the GraphQL API

The works by receiving queries, breaking them up across the responsible backend services, and returning the response.

A diagram looking closer at the local router, which uses the supergraph.yaml config file to define details about each service the router will fetch from

In the case of the Apollo MCP Server, the tool comes in the form of a .

Practice

Which of the following statements describes how the MCP server works with assistants and APIs?
Which of the following statements are true about MCP tools? Select all that apply.
Which of the following statements are true about the Apollo MCP server? Select all that apply.
Previous