mdskills
← Docs

What is MCP?

The Model Context Protocol gives AI agents the ability to use external tools, query data, and take action in the real world.

TL;DR: MCP is an open protocol that lets AI agents talk to external services. An MCP server exposes tools (functions the agent can call), resources (data the agent can read), and prompts (templates for common tasks). The agent discovers what’s available and uses them as needed.

The problem MCP solves

AI agents are great at reasoning, writing, and working with code. But on their own, they can’t check your Slack messages, query a database, create a Jira ticket, or search the web. They’re stuck in a sandbox.

Before MCP, every integration was custom. Each agent had its own plugin format, its own API, and its own way of connecting to tools. If you built a Slack integration for one agent, you had to rebuild it for another.

MCP standardizes this. Build one MCP server, and it works with every agent that supports the protocol.

How MCP works

MCP follows a client-server architecture. The AI agent is the client. The external service is the server. They communicate over a standardized protocol.

# The flow
Agent → discovers available tools → MCP Server
Agent → calls a tool with arguments → MCP Server
MCP Server → executes and returns results → Agent

When an agent connects to an MCP server, it asks: “What can you do?” The server responds with a list of tools, each with a name, description, and input schema. The agent can then decide when and how to use them.

The three primitives

MCP servers can expose three types of capabilities:

Tools

Functions the agent can call. Like API endpoints with typed inputs and outputs. Examples: search_emails, create_ticket, run_query.

Resources

Read-only data the agent can access. Like files or API responses the agent can pull in for context. Examples: config files, database schemas, documentation.

Prompts

Reusable templates for common interactions. The server provides structured prompts that the agent or user can invoke. Examples: “summarize this PR”, “explain this error”.

Most MCP servers focus on tools — they give the agent new abilities. Resources and prompts are useful but less commonly implemented.

What an MCP server looks like

Here’s a minimal MCP server in TypeScript that provides a single tool:

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: "weather",
  version: "1.0.0",
});

server.tool("get_weather",
  { city: z.string() },
  async ({ city }) => {
    const data = await fetch(
      `https://api.weather.com/v1/${city}`
    ).then(r => r.json());
    return {
      content: [{
        type: "text",
        text: `${city}: ${data.temp}°F, ${data.condition}`,
      }],
    };
  }
);

const transport = new StdioServerTransport();
await server.connect(transport);

That’s it. The agent can now ask for the weather in any city. It discovers the get_weather tool, sees it takes a city string, and calls it when relevant.

Connecting MCP servers to agents

Each agent has its own way of registering MCP servers. Here are the most common:

Claude Code

claude mcp add my-server -- npx -y my-mcp-server

Cursor

Add to .cursor/mcp.json:

{ "mcpServers": { "my-server": { "command": "npx", "args": ["-y", "my-mcp-server"] } } }

VS Code (Copilot)

Add to .vscode/mcp.json with the same format as Cursor.

Transport options

MCP servers communicate with agents through one of two transports:

stdio

The agent spawns the server as a child process and communicates via stdin/stdout. This is the most common transport for local development and CLI-based agents.

Streamable HTTP

The server runs as an HTTP endpoint. The agent sends requests over HTTP with optional Server-Sent Events for streaming. Used for remote and shared servers.

Which agents support MCP?

MCP adoption is growing rapidly. Agents with MCP support include:

Claude CodeClaude DesktopCursorVS Code (Copilot)WindsurfContinueGemini CLIAmpRoo CodeGoose

MCP vs Skills

MCP and Skills solve different problems. MCP gives agents new abilities (access to external systems). Skills give agents domain knowledge (how to do specific tasks well).

MCP ServersSkills
PurposeGive access to external systemsTeach how to do tasks well
FormatRunning server processMarkdown files
SetupInstall + configureDrop a file in your project
ExampleQuery a Postgres databaseWrite SQL following your team’s conventions
TogetherMCP provides the connection. Skills teach the agent how to use it well.

For a deeper comparison, see Skills vs MCP Servers.

Getting started

1. Browse MCP servers — Find servers for the tools you use on our MCP directory or the official MCP servers repo.

2. Install one — Most servers install with a single command. Try claude mcp add for Claude Code or add to your agent’s MCP config file.

3. Build your own — The MCP quickstart guide walks you through building a server in TypeScript or Python in under 15 minutes.