MCP Server
A program that exposes Tools, Resources, and Prompts to MCP Clients over JSON-RPC.
Last updated: April 26, 2026
Definition
An MCP Server is a standalone program that provides context to MCP Clients. The spec defines three primitives a Server can expose: Tools (model-controlled executable functions like API calls or file writes), Resources (application-controlled data such as file contents or database rows), and Prompts (user-controlled templates triggered by slash commands or menus). Servers communicate over one of two transports: stdio for local processes (typically a single Client) or Streamable HTTP for remote services (often serving many Clients across many Hosts).
A well-built MCP Server is how you make your data, your APIs, or your internal tooling accessible to any AI agent without writing per-vendor integrations. Concrete production examples: the official Filesystem Server (local stdio, exposes file read/write Tools), the Sentry MCP Server (remote HTTP, exposes issue lookup and resolution Tools), the GitHub MCP Server (HTTP, exposes repository search and PR Tools). The server's capability declaration during the initialize handshake tells the Client which primitives are available, so a Server can choose to expose only Tools, only Resources, or any combination.
Code Example
// Server exposes one Tool primitive
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
const server = new Server(
{ name: "github-issues", version: "1.0.0" },
{ capabilities: { tools: {} } }, // declare we expose Tools
);
server.setRequestHandler({ method: "tools/call" }, async (req) => {
if (req.params.name === "search_issues") {
return { content: [{ type: "text", text: await searchGithub(req.params.arguments) }] };
}
});The Server declares which primitives it exposes during initialize, then handles JSON-RPC requests.
When To Use
You build an MCP Server when you want any AI Host to be able to use your data or tools. This is the highest-leverage MCP component to build, since one Server unlocks every existing Host.
Common Questions
What is the difference between a Tool, a Resource, and a Prompt in MCP?
Tools are model-controlled: the LLM decides when to call them. Resources are application-controlled: the Host attaches them to the model context. Prompts are user-controlled: triggered by a user action like a slash command. All three are exposed by Servers, but they have different control flows.
When do I use stdio versus Streamable HTTP transport?
Use stdio for local Servers that ship alongside the Host on the user's machine. Use Streamable HTTP for remote Servers that need to be shared across many users or run as a managed service. A single MCP Server codebase can support both transports.
Related Terms
Building with MCP Server?
I've shipped this pattern in real production systems. If you want a second pair of eyes on your architecture, that's what I do.