mcp-server-patterns

Build MCP servers with tool and resource registrations and transport configurations.

1|1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/PedroHBO/opencode-config-skills --skill mcp-server-patterns-pedrohbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/PedroHBO/opencode-config-skills/tree/main/skills/mcp-server-patterns
Command: npx skills add https://github.com/PedroHBO/opencode-config-skills --skill mcp-server-patterns-pedrohbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Provides a structured blueprint to build MCP servers with tool/resource/prompt registrations and transport configurations.

Core Features & Use Cases

  • Registers tools, resources, and prompts with Zod-based input validation.
  • Supports both stdio and Streamable HTTP transports for local and remote clients.
  • Includes evals, references, and templates to guide development and review.

Quick Start

Set up a new MCP server project with @modelcontextprotocol/sdk, define a basic tool and resource, validate inputs with Zod, and enable a transport (stdio or HTTP).

Frequently Asked Questions about mcp-server-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an MCP server with tool registration and transport configuration?

To build an MCP server, you use a structured blueprint to register tools, resources, and prompts with Zod input validation, and configure either stdio or Streamable HTTP transports for local and remote client communication.

What's the best way to validate MCP tool inputs in a Node TypeScript project?

The best way to validate MCP tool inputs in Node TypeScript is using Zod validation schemas during tool and resource registration to ensure structured, type-safe data handling before processing requests.

When should I use stdio transport versus Streamable HTTP for an MCP server?

Use stdio transport for local client communication and Streamable HTTP transport when your MCP server needs to handle remote clients, with both configurations supported through the model context protocol SDK.

Do I need the modelcontextprotocol SDK and Zod to set up MCP server patterns?

Yes, you need the modelcontextprotocol SDK and Zod to set up MCP server patterns, as they provide the foundational context protocol framework and input validation required for robust tool registrations.

Can I register resources and prompts alongside tools in a Model Context Protocol server?

Yes, you can register resources and prompts alongside tools in a Model Context Protocol server, creating a comprehensive interface that validates inputs with Zod and exposes them via configured transports.