Examples

MCP server examples

Every MCP server exposes some combination of three primitives: Resources, Tools, and Prompts. The wire shape is JSON-RPC 2.0. The contract for inputs is JSON Schema. Reading a few real servers is the fastest route to fluency.

The three primitives, by example

Each primitive maps to a distinct interaction shape. A single server can expose any combination of the three; reference servers typically lead with one and add the others as the use case demands.

Tools

A server advertises a verb (e.g. create_issue) with a JSON Schema describing required arguments. The client lists it via tools/list, formats a call against the schema, and invokes tools/call. The server executes the function and returns a structured result or an error flag.

Resources

A server exposes URIs (e.g. file:///repo/README.md or postgres://schema/users) with content-type metadata. The client reads them via resources/read and streams the content into the model's context window. Resources are read-only by spec.

Prompts

A server provides parameterized message templates the client can offer to the user. The client calls prompts/list to discover them and prompts/get with arguments to materialize a prompt. The server returns the assembled message structure for the model.

Reference servers worth reading

These are public implementations with source available. Each one demonstrates a different cut through the protocol.

  • Anthropic reference servers The modelcontextprotocol/servers repo on GitHub. Includes filesystem, git, fetch, memory, and time servers. Idiomatic Python SDK and TypeScript SDK usage.
  • GitHub MCP server Official server from GitHub. Exposes repositories, issues, and pull requests as Tools with structured JSON Schema inputs. Authenticates via OAuth or personal access token.
  • Slack MCP server Channels, messages, and users surfaced as Tools. Demonstrates the OAuth flow for hosted SaaS integrations and the standard pattern for paginated list endpoints.
  • Block's Goose reference The agent framework Block donated to the Linux Foundation Agentic AI Foundation in December 2025. Ships its own reference MCP integrations as part of the framework.
  • n8n MCP server Exposes n8n workflows as Tools the agent can invoke. Useful pattern for wrapping an existing automation surface behind the protocol.

The shape of a minimal server

Any MCP server, regardless of language, follows the same three-step lifecycle on connect:

  1. Initialize handshake. The client sends initialize with its protocol version and supported client capabilities (Roots, Sampling, Elicitation). The server replies with its protocol version and server capabilities.
  2. Capability negotiation. Both sides advertise what they support. Server declares which primitives it exposes (Resources, Tools, Prompts). Client declares which inversions of control it allows.
  3. Respond to list and call methods. Implement tools/list and tools/call (plus the resources and prompts equivalents if applicable). Each method returns JSON-RPC 2.0 responses keyed by request id.

The Python SDK and TypeScript SDK both wrap this lifecycle. A working server in either language is typically under 50 lines once the SDK handles the transport (stdio for local, HTTP+SSE for remote).

Where the spec lives

The canonical JSON-RPC method definitions, capability flags, and message schemas are published at modelcontextprotocol.io. The spec covers the exact shape of tools/list, the JSON Schema fields a tool definition must include, and the error codes (-32601 Method Not Found, -32700 Parse Error) inherited from JSON-RPC 2.0. Read the spec when implementing; read the reference servers when learning.