Agent Surface

Make your product agent-ready

MCP Servers

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

Last verified 2026-09-24

Summary

MCP Servers covers protocol-specific implementation for exposing tools, resources, and prompts through the Model Context Protocol. Use it when you are building, hosting, testing, authenticating, or distributing an MCP endpoint.

  • Owns: MCP architecture, transports, lifecycle, tool/resource/prompt exposure, annotations, auth integration, testing, Next.js hosting, generation, and examples.
  • Does not own: general tool definition quality; see Tool Design. HTTP/OpenAPI design before wrapping it in MCP; see API Surface.
  • Agent-ready means: clients can connect, inspect capabilities, call tools with schemas, receive structured results/errors, and enforce auth and safety at the server boundary.

Client or Server

A short decision rule for which side you're building: build an MCP client when your own agent needs to reach many third-party integrations and you want one protocol instead of one integration per vendor. Ship an MCP server when you want other agents - not just your own product's UI - to use your product's capabilities. The two are not mutually exclusive; a product can consume MCP servers as a client while also shipping its own.

Start Here

  1. Architecture - Design focused, testable MCP servers.
  2. Tool Best Practices - Implement MCP tools with clear schemas and recoverable output.
  3. Resources and Prompts - Expose context and reusable prompt templates.
  4. Transports - Choose stdio or streamable HTTP.
  5. Authentication - Protect remote servers and validate callers.
  6. Annotations - Declare read-only, destructive, and idempotent hints.
  7. Testing - Validate server behavior before shipping.
  8. Next.js Integration - Host MCP from a Next.js app.
  9. Auto-Generation - Generate servers from existing contracts where appropriate.
  10. Real-World Examples - Study production server patterns.
  11. Code Execution - How a code-executing agent consumes your server as an importable library, and what that implies for tool design.
  1. Tool Design - Framework-neutral tool naming, schemas, and curation.
  2. Authentication: MCP Authorization - OAuth discovery and client identity model.
  3. Discovery: Well-Known Endpoints - Advertise MCP metadata publicly.
  4. API Surface - Design the underlying HTTP contract before wrapping it.

On this page