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?
Related questions
How do you connect an MCP server to Claude Code?
An MCP server is added with the command claude mcp add. A server over HTTP is given with --transport http, a name and a URL. A local server that runs as a process is given with the name followed by two hyphens and the command that starts it.
Read the answerHow do AI agents share memory between sessions?
An agent session starts with no memory of earlier sessions. Memory is shared by writing the knowledge down outside the session, in files that are loaded at start or in a service that the sessions call. Files in a repository reach the sessions in that repository. A service reaches sessions in different projects and on different computers.
Read the answer