What is an MCP server and how does it work?

Also called Model Context Protocol server, MCP servers

Definition

An MCP server is a program that exposes tools, resources, and prompts to AI applications through the Model Context Protocol, running locally over stdio or remotely over Streamable HTTP.

An MCP server is a program that exposes capabilities to AI applications using the Model Context Protocol. A server typically wraps one system, such as a file system, a database, a ticketing tool, or a SaaS API, and describes what it offers in a machine-readable form. Any MCP-compatible host, such as an IDE, a chat app, or an AI agent, can connect to it without custom integration code.

How an MCP server works#

An MCP server works by answering JSON-RPC requests from an MCP client inside the host application. According to the MCP server concepts guide, a server can expose three kinds of primitives, each controlled by a different party:

Primitive What it is Controlled by Methods
Tools Functions with JSON Schema inputs, such as create_issue The model tools/list, tools/call
Resources Read-only data identified by a URI, such as a file or a schema The application resources/list, resources/read
Prompts Parameterized templates, often shown as slash commands The user prompts/list, prompts/get

Servers run in one of two ways. A local server runs on the user's machine as a subprocess, communicates over stdio, and typically serves one client. A remote server runs as a web service over Streamable HTTP, can serve many clients, and falls under the specification's authorization framework for HTTP. The official MCP Registry catalogs servers for discovery.

MCP server vs API#

An MCP server usually sits in front of an API rather than replacing it. A REST or GraphQL API is designed for developers, who read its documentation and write client code against it. An MCP server describes its tools in a self-describing format that a host can list at run time and pass to a model, so a new capability becomes available to every MCP-compatible application without new client code.

That design shapes the security model. Tool descriptions and tool outputs flow into the model's context, so a malicious or compromised server can attempt prompt injection. The specification says hosts must obtain explicit user consent before invoking any tool, and that tool annotations should be treated as untrusted unless they come from a trusted server. Teams running many servers can route them through an AI gateway or MCP gateway for central authentication and logging.

What is Model Context Protocol covers server design in depth, and tool calling explains how the model side of a tool call works.

Cite this definition

The AI Engineering Editors. "What is an MCP server and how does it work?" The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/mcp-server

Title
What is an MCP server and how does it work?
Author
The AI Engineering Editors
Publisher
The AI Engineering
Updated
View as Markdown

Part of the Model Context Protocol hub · Updated