---
title: "What is an MCP server and how does it work?"
description: "An MCP server exposes tools, resources, and prompts to AI apps over the Model Context Protocol. Learn how MCP servers work and how they differ from APIs."
type: "glossary-term"
canonical_url: "https://theaiengineering.com/glossary/mcp-server"
markdown_url: "https://theaiengineering.com/glossary/mcp-server.md"
topic: "Model Context Protocol"
author: "The AI Engineering Editors"
publisher: "The AI Engineering"
updated: "2026-11-06"
keywords: ["MCP server","Model Context Protocol server","MCP servers"]
citation: "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"
---

# What is an MCP server and how does it work?

Also called Model Context Protocol server, MCP servers.

> **Definition of MCP server:** 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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/ai-agent), can connect to it without custom integration code.

## How an MCP server works

An MCP server works by answering [JSON-RPC](https://theaiengineering.com/glossary/json-rpc) requests from an MCP client inside the host application. According to the [MCP server concepts guide](https://modelcontextprotocol.io/docs/learn/server-concepts), 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](https://registry.modelcontextprotocol.io/) 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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/ai-gateway) or [MCP gateway](https://theaiengineering.com/glossary/mcp-gateway) for central authentication and logging.

[What is Model Context Protocol](https://theaiengineering.com/articles/what-is-model-context-protocol) covers server design in depth, and [tool calling](https://theaiengineering.com/articles/tool-calling) explains how the model side of a tool call works.

## Related terms

- [Model Context Protocol (MCP)](https://theaiengineering.com/glossary/model-context-protocol): Model Context Protocol (MCP) is an open protocol, introduced by Anthropic in November 2024, that standardizes how AI applications connect to external tools, data sources, and prompts through MCP servers.
- [Tool calling](https://theaiengineering.com/glossary/tool-calling): Tool calling is an LLM capability in which the model, given a list of tool definitions, outputs a structured request naming a tool and its arguments, which the application executes and returns.
- [AI agent](https://theaiengineering.com/glossary/ai-agent): An AI agent is a software system in which a large language model runs in a loop, calling tools, reading their results, and repeating until the task is complete or a stop condition is reached.
- [Prompt injection](https://theaiengineering.com/glossary/prompt-injection): Prompt injection is an attack in which text supplied to a large language model, typed by a user or hidden in content the model reads, alters the application's intended behavior or output.
- [AI gateway](https://theaiengineering.com/glossary/ai-gateway): An AI gateway is a proxy layer between applications and model providers that exposes one API for many models and centralizes routing, failover, access control, cost tracking, caching, and logging.
- [MCP transport](https://theaiengineering.com/glossary/mcp-transport): An MCP transport is the binding that carries Model Context Protocol messages between a client and a server; the specification defines stdio for local subprocesses and Streamable HTTP for remote servers.
- [Tool poisoning](https://theaiengineering.com/glossary/tool-poisoning): Tool poisoning is an attack in which a malicious or compromised MCP server hides instructions in a tool's description or schema, which the model reads as trusted context and may follow.

## Guides that cover mcp server

- [What is the Model Context Protocol (MCP)? How it works](https://theaiengineering.com/articles/what-is-model-context-protocol): The Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. Learn its architecture, transports, tool calls, and security.
- [How to build an MCP server: a Python and TypeScript tutorial](https://theaiengineering.com/articles/how-to-build-an-mcp-server): Learn how to build an MCP server with the official Python and TypeScript SDKs: tools, resources, transports, testing, client config, and production security.
- [What is tool calling? How LLM function calling works](https://theaiengineering.com/articles/tool-calling): Tool calling lets an LLM request actions from your code through structured calls. Learn the request loop, parallel calls, structured outputs, security, and MCP.
- [Claude Code vs Cursor: how the two coding agents differ](https://theaiengineering.com/articles/claude-code-vs-cursor): Claude Code vs Cursor compared: terminal agent vs AI editor, models, subagents, hooks, rules files, code review, CI use, pricing, and enterprise controls.
- [AI coding agents: how they work and how the major tools compare](https://theaiengineering.com/articles/ai-coding-agents): AI coding agents compared: how they differ from autocomplete, the four main categories, a comparison table of major tools, and how to evaluate and secure them.
- [What is context engineering? A practical guide for AI agents](https://theaiengineering.com/articles/context-engineering): Context engineering is the practice of choosing what fills an LLM context window. Learn its components, why context rot happens, and how to measure results.
- [What is an AI gateway? How it works and when you need one](https://theaiengineering.com/articles/what-is-an-ai-gateway): An AI gateway is a proxy between your apps and model providers. Learn how it works, its core features, AI gateway vs API gateway, and open source options.
- [A2A protocol vs MCP: differences and when to use each](https://theaiengineering.com/articles/a2a-vs-mcp): A2A protocol vs MCP: A2A connects AI agents to other agents, and MCP connects an agent to tools and data. Compare agent cards, tasks, transports, and security.

Part of the [Model Context Protocol](https://theaiengineering.com/topics/mcp) topic hub.

## 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: 2026-11-06
- URL: https://theaiengineering.com/glossary/mcp-server
- Markdown: https://theaiengineering.com/glossary/mcp-server.md
