mcp-server-patterns

Implement Node/TypeScript MCP servers with Zod validation and stdio or Streamable HTTP transport.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill mcp-server-patterns-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/.agents/skills/mcp-server-patterns
Command: npx skills add https://github.com/luongldptit/move-ticket --skill mcp-server-patterns-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the friction of building and maintaining Model Context Protocol (MCP) servers amid frequent SDK API changes, ensuring you implement compatible, standards-compliant servers without guesswork or version mismatch errors.

Core Features & Use Cases

  • Tool & Resource Registration: Implement validated MCP tools and read-only resources using Zod schemas and current SDK patterns for reliable model interaction.
  • Transport Configuration: Set up the correct stdio transport for local clients like Claude Desktop, or Streamable HTTP for remote clients like Cursor and cloud services.
  • Use Case: A developer building an internal MCP server to expose company API data as resources can use this Skill to correctly register resources and configure the appropriate transport for their target client.

Quick Start

Use the mcp-server-patterns skill to build a new MCP server with a validated search tool and stdio transport for local Claude Desktop access.

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 Node and TypeScript?

To build an MCP server with Node and TypeScript, you use the SDK to register tools and resources, define Zod schemas for input validation, and configure either stdio or Streamable HTTP transports for your target client.

Why does my MCP server throw input validation errors after an SDK update?

MCP server validation errors after an SDK update usually stem from API changes that require updating your Zod schema implementation to match current specification standards and SDK patterns for tool registration.

When should I use Streamable HTTP instead of stdio for an MCP server?

Use Streamable HTTP for remote MCP clients like Cursor and cloud services, while stdio transport is configured specifically for local clients like Claude Desktop to access your server directly.

How do I register read-only resources in a TypeScript MCP server?

Registering read-only resources in a TypeScript MCP server involves using current SDK patterns to expose data, combined with Zod schemas to ensure validated, reliable model interaction without guesswork.

Can I use Zod schemas for tool input validation in the Model Context Protocol?

Yes, Zod schemas are used for tool input validation in Model Context Protocol servers to ensure standards compliance, providing reliable model interaction and preventing input mismatch errors.