What Is an MCP Server? Model Context Protocol Explained
An MCP server is a small service that exposes tools, data sources, and contextual information to AI models using Anthropic's open Model Context Protocol (MCP). Any AI host that speaks MCP -- Claude, a custom agent, an IDE plugin -- can call that server to read files, query databases, trigger APIs, or take actions, without custom glue code for every connection.
The Problem MCP Solves
Before MCP, wiring an AI model to external systems meant writing one-off integrations for every combination of model and tool. A team building a Claude-powered assistant that also needed a database connection, a CRM lookup, and a code executor had to build three separate, model-specific bridges. Multiply that by every model update or new tool, and the maintenance load compounded fast.
MCP defines a single, model-agnostic contract between a host (the AI application), a client (the protocol layer inside the host), and a server (the service exposing tools or data). Once you build one MCP server for your database, any MCP-compatible host can use it.
MCP is to AI tools what USB-C is to devices -- a universal connector that replaces a drawer full of proprietary cables.
How MCP Works: The Core Architecture
Hosts, Clients, and Servers
Three roles define an MCP interaction:
The host orchestrates which servers to call and when. The model itself never directly touches the server -- it sees the results as context in its prompt or as tool call returns.
Transport Layers
MCP supports two transport modes:
The Three Primitives
Every MCP server exposes some combination of three primitives:
| Primitive | What It Is | Example |
|---|---|---|
| Tools | Functions the model can call to take action or fetch data | search_crm(query), run_sql(query) |
| Resources | Readable data the model can retrieve as context | File contents, database rows, API responses |
| Prompts | Templated prompt fragments the host can inject | A reusable system prompt with company context |
What Happens During an MCP Call
The sequence is straightforward:
- On startup, the host asks each connected server for its capability list (tools, resources, prompts).
- The model receives a tool list in its context window -- names, descriptions, and JSON schemas for parameters.
- The model decides to call a tool and emits a structured tool-call response.
- The client routes that call to the correct MCP server.
- The server executes the action (queries a DB, calls an API, reads a file) and returns a result.
- The result lands back in the model's context as a tool result.
- The model continues reasoning with the new information.
The model never sees your database credentials or API keys. Authentication stays inside the MCP server process, which is a meaningful security boundary.
Real-World MCP Server Examples
Developer Tooling
IDE integrations (Cursor, VS Code extensions, JetBrains) use MCP servers to give AI coding assistants live access to:
- The local file system (read, write, search)
- Git history and diffs
- Running terminal processes
- Test runners and build output
Enterprise Data Access
A company's internal MCP server might expose:
- A read-only SQL tool over their data warehouse
- A document search tool over a SharePoint index
- A CRM lookup that returns account context for a given email
External API Wrappers
Public MCP servers already exist for Stripe, GitHub, Slack, Brave Search, Google Maps, and dozens of other services. A developer can wire five of these into a Claude agent in under an hour, getting a multi-tool assistant without writing protocol glue.
Browse the official MCP server registry at modelcontextprotocol.io before building from scratch. Hundreds of community and vendor-maintained servers are already available.
Building a Custom MCP Server: When It Makes Sense
You should build a custom MCP server when:
- Your data or API is internal and no public server exists
- You need to enforce access controls, rate limits, or audit logging at the tool layer
- You want a single server reusable across multiple AI applications or teams
- You are wrapping a legacy system (SOAP API, mainframe SFTP, proprietary DB driver) that no generic integration covers
Implementation Options
Anthropic ships official SDKs for Python and TypeScript. A minimal server in TypeScript looks like 30-80 lines of code: import the SDK, define a tool with a name, description, and Zod schema for parameters, write the handler, and call server.run(). Packaging options include:
- Local npm/PyPI package (stdio, developer machines)
- Docker container behind an internal endpoint (HTTP/SSE, team-wide)
- Cloudflare Worker or similar edge function (HTTP/SSE, low-latency global)
Never expose an MCP server directly to the public internet without authentication. Unauthenticated MCP endpoints let anyone call your tools. Use an API key header, OAuth, or network-level controls.
MCP vs. Other Integration Approaches
If you are deciding between MCP and other patterns:
Key Takeaways
- MCP is an open protocol -- any model host that implements it can use any MCP server.
- Servers expose three primitives: tools (actions), resources (data), and prompts (templates).
- Security stays inside the server process; models never see raw credentials.
- Building a server takes hours, not weeks, with the official SDKs.
- The ecosystem is growing fast; check existing servers before building your own.
Frequently Asked Questions
What does MCP stand for?
MCP stands for Model Context Protocol. It is an open standard published by Anthropic in late 2024 to create a universal interface between AI models and the external tools, APIs, and data sources they need to act on the world.Is MCP only for Claude?
No. MCP is an open protocol. While Anthropic created it, any AI host -- OpenAI-compatible agents, open-source frameworks, IDE plugins -- can implement MCP clients and connect to MCP servers. Several non-Anthropic products already support it.How is an MCP server different from a REST API?
A REST API is a general-purpose HTTP interface. An MCP server is a REST API (or stdio process) that also publishes a machine-readable capability manifest -- tool names, descriptions, and parameter schemas -- so an AI model can discover what the server can do and decide when to call it without human instruction.Can one MCP server expose multiple tools?
Yes. A single MCP server can expose any number of tools, resources, and prompts. It is common to build one server per domain -- for example, one CRM server with tools like lookup_contact, create_task, and list_recent_deals.What language should I use to build an MCP server?
Anthropic's official SDKs support Python and TypeScript. Both are mature and cover stdio and HTTP/SSE transports. Community SDKs also exist for Go, Rust, Java, and C#. Choose based on your team's existing stack.How long does it take to build a production MCP server?
A simple read-only tool wrapping an existing API takes a competent developer 2-8 hours to build and deploy. A server with multiple tools, authentication, rate limiting, and observability instrumentation typically takes 2-5 days to build and 1-2 days to harden for production.Frequently Asked Questions
What does MCP stand for?
MCP stands for Model Context Protocol. It is an open standard published by Anthropic in late 2024 to create a universal interface between AI models and the external tools, APIs, and data sources they need to act on the world.
Is MCP only for Claude?
No. MCP is an open protocol. While Anthropic created it, any AI host -- OpenAI-compatible agents, open-source frameworks, IDE plugins -- can implement MCP clients and connect to MCP servers. Several non-Anthropic products already support it.
How is an MCP server different from a REST API?
A REST API is a general-purpose HTTP interface. An MCP server is a REST API (or stdio process) that also publishes a machine-readable capability manifest -- tool names, descriptions, and parameter schemas -- so an AI model can discover what the server can do and decide when to call it without human instruction.
Can one MCP server expose multiple tools?
Yes. A single MCP server can expose any number of tools, resources, and prompts. It is common to build one server per domain -- for example, one CRM server with tools like lookup_contact, create_task, and list_recent_deals.
What language should I use to build an MCP server?
Anthropic's official SDKs support Python and TypeScript. Both are mature and cover stdio and HTTP/SSE transports. Community SDKs also exist for Go, Rust, Java, and C#. Choose based on your team's existing stack.
How long does it take to build a production MCP server?
A simple read-only tool wrapping an existing API takes a competent developer 2-8 hours to build and deploy. A server with multiple tools, authentication, rate limiting, and observability instrumentation typically takes 2-5 days to build and 1-2 days to harden for production.