Agent Surface
MCP Servers

MCP Servers

Implementing Model Context Protocol servers that expose your capabilities to AI agents

Summary

MCP is the standard protocol for agents to discover and invoke external tools. This section covers server architecture, tool design, resource and prompt templates, transport selection, authentication, testing patterns, MCP Apps, Agent Skills, and real-world examples from GitHub, Stripe, and Vercel. MCP enables agents to use your APIs safely with proper error handling and granular control.

  • Architecture: single-responsibility servers, testable factories
  • Tool design: clear names, descriptions as prompts, JSON Schema
  • Resources and prompts: contextual data and reusable patterns
  • Transports: stdio (simplest), SSE, HTTP with proper lifecycle
  • Authentication: bearer tokens, OAuth 2.1 for public servers
  • Testing: unit tests, in-memory integration, MCP Inspector
  • Distribution: registry entries, server cards, app surfaces, and skill packages

The Model Context Protocol (MCP) is becoming the standard way for AI agents to discover and invoke external tools. An MCP server wraps your existing API or functionality into a protocol that agents can connect to natively.

What This Section Covers

  • MCP fundamentals — the protocol architecture, transport layers (stdio, SSE, streamable HTTP), and capability negotiation
  • Tool design — defining tools with precise names, descriptions, and JSON Schema input parameters that agents can reason about
  • Resource exposure — serving contextual data (files, database records, configurations) that agents can read to inform their decisions
  • Prompt templates — pre-built prompt patterns that help agents use your tools effectively
  • Server lifecycle — initialization, capability declaration, graceful shutdown, and connection management
  • Error semantics — returning structured errors through MCP that give agents enough information to recover or report clearly
  • Testing MCP servers — validating tool definitions, input handling, and response shapes with automated tests
  • Distribution and packaging — publishing MCP endpoints, advertising metadata, and pairing servers with Agent Skills where procedural guidance matters

See also

On this page