What Is MCP?
The Model Context Protocol (MCP) is an open standard by Anthropic for connecting AI assistants to external data sources and tools. Think of it as USB-C for AI — one protocol that works everywhere.
Why MCP Matters
Before MCP, every AI integration was custom. Each tool needed its own plugin, API wrapper, and configuration. MCP standardizes this.
Architecture
- MCP Host: The AI application (e.g., Claude Desktop, Cursor).
- MCP Server: Exposes tools and resources via the protocol.
- MCP Client: Connects the host to servers.
Key Concepts
- Tools: Functions the AI can call (search, create file, query database).
- Resources: Data the AI can read (files, database records, API responses).
- Prompts: Reusable prompt templates shared between applications.
Building an MCP Server
1. Define your tools with JSON schemas.
2. Implement the MCP protocol (REST or stdio transport).
3. Register capabilities (tools, resources, prompts).
4. Test with MCP Inspector or Claude Desktop.
Ecosystem
- GitHub: MCP server for repositories and issues.
- PostgreSQL: MCP server for database queries.
- Slack: MCP server for messaging and channels.
- Filesystem: MCP server for local file access.
For Developers
- MCP SDKs available in TypeScript and Python.
- Follow the specification at modelcontextprotocol.io.
- Community servers growing rapidly — hundreds available.
Building Your First MCP Server
Here’s a minimal example using the TypeScript SDK:
The older helper still exists but is deprecated, so use the current entry point:
- `npm install @modelcontextprotocol/sdk zod`
- `import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";`
- `import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";`
- `const server = new McpServer({ name: "my-tool", version: "1.0.0" });`
- `server.registerTool("search", { inputSchema: { query: z.string() } }, async ({ query }) => ({ content: [{ type: "text", text: JSON.stringify(await searchDatabase(query)) }] }));`
- `await server.connect(new StdioServerTransport());`
Source: the @modelcontextprotocol/sdk package on npm, version 1.32.2, checked 2026-11-10. The earlier text imported @mcp/sdk, which does not exist on npm.
Security Considerations
- Authentication: MCP servers should require API keys or OAuth tokens. Never expose servers publicly without auth.
- Input validation: Validate all tool inputs against schemas. MCP doesn’t sanitize inputs automatically.
- Rate limiting: Implement rate limits to prevent abuse. A typical limit is 100 requests/minute per client.
- Audit logging: Log all tool invocations for debugging and compliance.
MCP vs Traditional APIs
MCP adds semantic understanding—the AI knows what each tool does and when to use it. Unlike REST APIs where the developer hardcodes integration logic, MCP lets the AI decide which tools to call based on context. This makes MCP ideal for agentic workflows where the AI needs to dynamically choose actions.
The Integration Surface Is the Tool Schema
When people evaluate MCP they usually compare transports and forget that the part other systems depend on is the tool definition: its name, its description, and the shape of its arguments and result. A tool whose description is vague will be called at the wrong time by every client, and a result that returns unstructured prose cannot be composed with anything downstream. Spend your effort on the schema and the description, because the transport is a solved problem and the interface is not.
Descriptions are prompts. Write them for a model deciding whether to call this tool at all, including when not to. Naming arguments clearly matters more than abbreviating them, and a result that is a small typed object beats a paragraph of text every time.
Local Servers Are the Low-Friction Starting Point
A stdio server running on the user's own machine avoids the hardest problems at once: no hosting, no authentication infrastructure, and a natural trust boundary because the process runs with the user's permissions on the user's data. Start there. Move to a remote HTTP server only when the capability genuinely needs to be shared across machines or users, and accept that doing so means you now own authentication, authorisation, and multi-tenancy.
Where Integrations Break in Practice
Servers that write to stdout. On stdio, stdout is the protocol channel, so a stray print statement corrupts the stream and the failure looks like a client bug. Log to stderr, and test by running the server and watching for non-JSON bytes. That one check saves hours of confusing debugging.
A Reasonable First Server
Wrap one existing internal tool, expose it with a precise schema and an honest description, and use it yourself for a week before shipping it to anyone else.