Guide: MCP Server¶
For the full API reference and all code examples, see the feature page.
Feature: MCP Server — Tools, Resources, Prompts
examples/adapters-mcp¶
Demonstrates all three MCP primitives:
- Tools —
CalcToolwith codec-driveninputSchema; input validation errors surface to the LLM asIsError: trueresults; output codec failures are protocol-level errors - Resources —
ItemResourcewith URI templateitems://{id};BuildURIvalidates theidparameter before assembling the URI - Prompts —
SummaryPromptwith requiredcontentarg and optionalstyle;ValidateArgsreturnsMissingPromptArgErrorfor absent required args b.MCPSpec()— static JSON manifest listing all primitives with their codec-derived JSON Schemas- All three transport options: stdio, streamable HTTP (recommended), SSE over HTTP (legacy)