mcp-server-patterns

Implement MCP servers with correct SDK signatures and Zod validation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building MCP servers often involves navigating inconsistent SDK API patterns across versions, selecting the correct transport for your use case, and implementing proper input validation, which leads to wasted time and broken implementations without clear, up-to-date guidance.

Core Features & Use Cases

  • Tool & Resource Registration: Correctly implement MCP tools (actions the model can invoke) and resources (read-only data for the model) using current Node/TypeScript SDK signatures.
  • Transport Configuration: Choose and set up the appropriate transport: stdio for local clients like Claude Desktop, or Streamable HTTP for remote clients like Cursor, avoiding compatibility issues.
  • Validation & Best Practices: Use Zod for input validation, follow guidelines for error handling, idempotent tool design, and SDK version management to build reliable MCP servers. A common use case is a developer building a custom MCP server to let Claude Desktop access their internal project management API: this skill guides them to correctly register API query tools, set up stdio transport, and add input validation to prevent invalid requests.

Quick Start

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

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

Building an MCP server with Node.js and TypeScript requires using the correct SDK method signatures for tool and resource registration, configuring stdio or Streamable HTTP transports, and implementing Zod input validation to ensure reliable model interactions.

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

Use stdio transport for local clients like Claude Desktop and Streamable HTTP transport for remote clients like Cursor to avoid compatibility issues; selecting the correct MCP transport ensures proper communication between the server and its specific client environment.

How do I validate input parameters in an MCP server tool?

Validate input parameters in an MCP server tool by defining schemas with Zod, which enforces input validation and prevents invalid requests, adhering to MCP tool design and error handling best practices for robust server development.

Why does my MCP server registration fail after an SDK version upgrade?

MCP server registration fails after SDK version upgrades due to inconsistent API patterns across versions; resolving this requires applying current Node/TypeScript SDK method signatures for tool and resource registration and debugging the MCP registration process.

What are the best practices for designing MCP server tools?

Best practices for designing MCP server tools include using Zod for input validation, implementing proper error handling, ensuring idempotent tool design, and managing SDK versions to build reliable MCP servers that correctly expose actions for models to invoke.

Can I use TypeScript to create both tools and resources in an MCP server?

Yes, you can use TypeScript to create both tools (actions the model can invoke) and resources (read-only data for the model) by applying current Node/TypeScript SDK signatures for correct MCP server implementation.