mcp-server-patterns

Guide Node/TypeScript MCP server builds with Zod validation and stdio or Streamable HTTP transports.

Updated May 4, 2026
One-click install
npx skills add https://github.com/gganbukim1/myskills --skill mcp-server-patterns-gganbukim1
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/gganbukim1/myskills/tree/main/mcp-server-patterns
Command: npx skills add https://github.com/gganbukim1/myskills --skill mcp-server-patterns-gganbukim1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the confusion and breakage that happens when building or upgrading MCP servers, especially when tool/resource/prompt registration APIs and transport choices (stdio vs HTTP) change across SDK versions.

Core Features & Use Cases

  • MCP server architecture patterns: Practical guidance for implementing tools, resources, and prompts in the Node/TypeScript SDK.
  • Transport selection: Clear direction for using stdio for local clients and Streamable HTTP for remote clients (with legacy HTTP/SSE only when needed).
  • Schema-first validation with Zod: Input validation patterns to keep tool interfaces reliable and consistent.

Quick Start

Use the mcp-server-patterns skill to design an MCP Node/TypeScript server with tools, resources, Zod-validated inputs, and the correct stdio or Streamable HTTP transport for your client.

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 in Node.js and TypeScript?▼

To build an MCP server in Node.js and TypeScript, define tools, resources, and prompts using a schema-first approach with Zod validation, then register them using current MCP SDK APIs for client exposure.

When should I use stdio vs Streamable HTTP for MCP server transport?▼

Use stdio transport for local MCP clients and Streamable HTTP for remote clients. Legacy HTTP/SSE transport should only be used when specifically needed for older client compatibility.

Why did my MCP tool registration break after an SDK upgrade?▼

MCP tool registration breaks during SDK upgrades because tool, resource, and prompt registration APIs change across versions. Align your implementation with current MCP SDK signatures using official documentation.

Do I need Zod validation for MCP server tool definitions?▼

Zod validation is required for MCP server tool definitions to enforce schema-first input validation. This pattern keeps tool interfaces reliable and consistent across AI client interactions.

What's the best way to debug MCP server connection issues?▼

Debug MCP server connection issues by verifying transport selection matches your client type, checking SDK API alignment, and confirming Zod schemas validate inputs correctly for registered tools and resources.

Can I expose resources and prompts to AI clients using MCP?▼

You can expose resources and prompts to AI clients using MCP by registering them alongside tools in your Node/TypeScript server implementation, following the schema-first definition patterns for reliable interfaces.