Skip to content

Learn

What is MCP (Model Context Protocol)?

MCP (Model Context Protocol) is an open standard for connecting AI applications to external systems. With MCP, an application such as Claude or ChatGPT can connect to data sources, tools and workflows. That is how the protocol's own website describes it.

Last reviewed on .

Host, client and server

MCP has a client-server architecture with three participants:

  • Host: the AI application, for example Claude Code. It creates one MCP client for each MCP server it connects to.
  • Client: keeps its own connection to its server.
  • Server: the program that provides context to the clients.

A server can run locally on the same computer or somewhere else. The architecture overview calls these local and remote servers.

What a server offers

The protocol defines three primitives that a server can offer:

  • Tools: functions the AI application can call to perform an action, for example an API call or a database query.
  • Resources: data sources that provide context, for example the contents of a file or records in a database.
  • Prompts: reusable templates that give structure to the interaction with the language model.

The client lists what is available with methods such as tools/list and calls a tool with tools/call.

Two transports

The messages follow JSON-RPC 2.0. The protocol has two transports:

  • Stdio: standard input and standard output between local processes on the same computer.
  • Streamable HTTP: HTTP POST from client to server, with Server-Sent Events as an optional path for streaming responses. It works with servers in other places.

AgentRoots as an MCP server

AgentRoots has an MCP server at /api/mcp that speaks Streamable HTTP. Every operation in the service is a tool. The command-line client can also run as an MCP server over stdio with the command mcp. How do you connect an MCP server to Claude Code?