What is MCP (Model Context Protocol)? A Developer's Guide

MCP lets AI agents interact with external tools through a standard protocol. Here's how it works and why it matters for developers.

· · 7 min read

Last updated: February 28, 2026

mcp ai-agents developer-tools protocol

MCP (Model Context Protocol) is an open standard created by Anthropic that lets AI assistants connect to external tools and data sources through a single, unified interface. Instead of building custom integrations for every AI tool, you build one MCP server and it works across Claude Code, Cursor, Windsurf, and any other client that supports the protocol.

The Problem MCP Solves

Every AI coding assistant has its own way of talking to external services. Cursor has its own plugin system. GitHub Copilot extensions work differently. Claude Code has its own tool interface. If you want your tool to work with all of them, you’re building the same integration three or four times.

MCP fixes this by defining a standard protocol. Build one server, and any MCP-compatible client can use it. Think of it like LSP (Language Server Protocol) did for code editors. Before LSP, every editor needed its own language integration. After LSP, you build one language server and it works in VS Code, Neovim, Emacs, and everywhere else.

How the Architecture Works

MCP has three layers:

  • Hosts are the AI applications users interact with directly. Claude Code, Claude Desktop, Cursor, and Windsurf are all hosts.
  • Clients live inside the host. Each client maintains a 1:1 connection with a single MCP server. The host manages multiple clients.
  • Servers expose tools, resources, and prompts to clients. A server might give an AI assistant the ability to query a database, read files, or publish documents.

The communication happens over JSON-RPC 2.0. Servers can run locally (as a subprocess using stdio transport) or remotely (over HTTP with Server-Sent Events).

Host (Claude Code)
├── MCP Client → MCP Server (filesystem)
├── MCP Client → MCP Server (postgres)
└── MCP Client → MCP Server (mdtolink)

Each server declares what it can do. A file system server might expose read_file and write_file tools. A database server might expose query and list_tables. The AI assistant sees these tools and can call them when they’re relevant to your request.

What an MCP Server Looks Like

An MCP server is a program that implements the protocol. Here’s the basic structure 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: "my-tool",
version: "1.0.0",
});
server.tool(
"hello",
"Says hello to a name",
{ name: z.string() },
async ({ name }) => ({
content: [{ type: "text", text: `Hello, ${name}!` }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);

That’s a complete MCP server. It exposes one tool called hello. When an AI assistant calls it, it returns a text response. Real servers do more interesting things, but the structure stays the same: create a server, register tools, connect a transport.

The ecosystem has grown quickly. Some servers you’ll want to know about:

  • Filesystem reads and writes files on your local machine. Useful for letting AI assistants manage project files.
  • PostgreSQL / MySQL lets AI assistants query your databases directly. Good for exploring data or generating reports.
  • GitHub exposes repository operations: creating issues, reading PRs, managing branches.
  • Slack sends messages and reads channels.
  • MDtoLink publishes markdown to shareable URLs. Your AI assistant generates a report or document, then publishes it with one tool call.

You can find a full directory at mcp.so and on the MCP GitHub org.

Setting Up MCP Servers with Claude Code

Adding an MCP server to Claude Code takes one command:

Terminal window
claude mcp add mdtolink \
-e MDTOLINK_API_KEY=mdtolink_xxxxxxxxxxxx \
-- npx -y -p mdtolink mdtolink-mcp

This tells Claude Code to start the MDtoLink MCP server as a subprocess, passing your API key as an environment variable. Once added, Claude Code can publish markdown documents on your behalf.

You can add multiple servers:

Terminal window
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir
claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

List your configured servers with:

Terminal window
claude mcp list

Each server runs as its own process. Claude Code manages the lifecycle, starting servers when needed and shutting them down when you exit.

Why This Matters for Developer Workflows

MCP turns AI assistants from text generators into agents that can act on your behalf. A few concrete examples:

Automated reporting. An AI assistant queries your database, formats the results as markdown, and publishes it to a URL your team can bookmark. The whole chain happens through MCP tools. No copy-pasting, no manual steps.

Documentation updates. Your AI reads the codebase through the filesystem server, generates updated API docs, and publishes them through MDtoLink. You review the output at a URL instead of reading a diff.

Cross-tool workflows. An AI reads a GitHub issue, writes a fix, runs tests, and posts a summary to Slack. Each step uses a different MCP server, but the AI orchestrates them in a single conversation.

The protocol is still young. New servers appear weekly. The spec is evolving with features like sampling (letting servers request AI completions) and resource subscriptions (live updates when data changes).

Getting Started

If you want to try MCP with MDtoLink:

  1. Install the CLI: npm install -g mdtolink
  2. Authenticate: mdtolink login
  3. Add the MCP server to your AI tool of choice (see MCP setup guide)

Once connected, ask your AI assistant to “publish this document to MDtoLink” and it will use the MCP tool automatically.

For the full list of available tools and configuration options, check the MCP server documentation. To see real-world workflows with AI agents, read the AI agent reports use case.


David Schemm
David Schemm

Founder, MDtoLink

David builds developer tools and writes about markdown workflows, documentation, and AI-assisted publishing.

Publish your markdown to a shareable URL

One command. Free to start. No credit card.