---
title: "MCP Servers"
description: "Implementing Model Context Protocol servers that expose your capabilities to AI agents"
url: "https://agentsurface.dev/docs/mcp-servers"
lastVerified: 2026-09-24
lastModified: 2026-09-25T09:56:33.000Z
---



## Summary [#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](/docs/tool-design). HTTP/OpenAPI design before wrapping it in MCP; see [API Surface](/docs/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 [#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 [#start-here]

* [Architecture](/docs/mcp-servers/architecture) - Design focused, testable MCP servers.
* [Tool Best Practices](/docs/mcp-servers/tool-best-practices) - Implement MCP tools with clear schemas and recoverable output.
* [Resources and Prompts](/docs/mcp-servers/resources-prompts) - Expose context and reusable prompt templates.
* [Transports](/docs/mcp-servers/transports) - Choose stdio or streamable HTTP.
* [Authentication](/docs/mcp-servers/authentication) - Protect remote servers and validate callers.
* [Annotations](/docs/mcp-servers/annotations) - Declare read-only, destructive, and idempotent hints.
* [Testing](/docs/mcp-servers/testing) - Validate server behavior before shipping.
* [Next.js Integration](/docs/mcp-servers/nextjs-integration) - Host MCP from a Next.js app.
* [Auto-Generation](/docs/mcp-servers/auto-generation) - Generate servers from existing contracts where appropriate.
* [Real-World Examples](/docs/mcp-servers/real-world-examples) - Study production server patterns.
* [Code Execution](/docs/mcp-servers/code-execution) - How a code-executing agent consumes your server as an importable library, and what that implies for tool design.

## Related [#related]

* [Tool Design](/docs/tool-design) - Framework-neutral tool naming, schemas, and curation.
* [Authentication: MCP Authorization](/docs/authentication/mcp-auth-model) - OAuth discovery and client identity model.
* [Discovery: Well-Known Endpoints](/docs/discovery/well-known-endpoints) - Advertise MCP metadata publicly.
* [API Surface](/docs/api-surface) - Design the underlying HTTP contract before wrapping it.
