Every agent needs tools, and for a while everyone built those tools in a different, incompatible way. The Model Context Protocol fixes that. It is a shared wire format for how an agent discovers and calls tools, reads resources, and uses prompts. Write an MCP server once and it works in any client that speaks MCP, the same way any browser can talk to any website over HTTP.
Think of it as a USB-C port for agents. The port is standard, so what you plug in, a database, a ticketing system, your internal docs, does not need a bespoke adapter for each agent.
A minimal server
An MCP server exposes capabilities. The most common is a tool: a named action with a typed input schema and a handler. Here is a complete server that offers one tool over stdio, using the TypeScript SDK.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
import { z } from 'zod'
const server = new McpServer({ name: 'changelog', version: '1.0.0' })
server.registerTool(
'get_release_notes',
{
title: 'Get release notes',
description: 'Return the changelog entry for a given version tag',
inputSchema: { version: z.string().describe('e.g. v2.4.0') },
},
async ({ version }) => ({
content: [{ type: 'text', text: `Release notes for ${version}...` }],
}),
)
// stdio is the transport a local agent launches and talks to over a pipe.
await server.connect(new StdioServerTransport())When an agent connects, it asks the server what it offers, sees get_release_notes and its input schema, and can then call it exactly like a built-in tool. The agent never needs to know how the changelog is stored.
Why it matters
- Write once, use everywhere. One server serves every MCP-aware agent, so integrations stop being N-times work.
- The agent stays lean. Capabilities live behind the protocol rather than baking into the harness, which keeps the context window and the toolset manageable.
- Clear boundaries. A server declares exactly what it exposes, which makes permissions and auditing far easier than ad-hoc integrations.
Related terms
Agent
An agent is a language model wrapped in a loop that lets it call tools, read the results, and decide what to do next. The model supplies the judgement; the loop and the tools give it hands.
Read definition →AI
In the coding-agent world, "AI" almost always means a large language model: a system that predicts the next chunk of text from everything it has been shown. It is not a mind and it is not a database. It is a very good pattern completer.
Read definition →Context window
The context window is the maximum amount of text, measured in tokens, that a model can consider for a single request. It is a hard ceiling, and it is the main resource you manage when working with an agent.
Read definition →