mcp-server-patterns

Build MCP servers with Node/TypeScript SDK using Zod validation.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill mcp-server-patterns-kanakmalpani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/KanakMalpani/General-Private-Skills/tree/main/skills/mcp-server-patterns
Command: npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill mcp-server-patterns-kanakmalpani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MCP server development can be complex, requiring tooling patterns, correct transport choices, and proper tool/resource registration to build reliable AI-enabled servers.

Core Features & Use Cases

  • Define tools, resources, and prompts for MCP servers; support both stdio and Streamable HTTP transports; validate inputs with Zod; adapt to SDK changes and MCP docs for current API definitions.

Quick Start

Instantiate an MCP server using the Node/TypeScript SDK and register a sample tool to validate 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 using Node and TypeScript?

To build an MCP server using Node and TypeScript, you instantiate the server with the SDK, register tools, resources, and prompts, and configure transport options like stdio or Streamable HTTP for deployment.

What is the best way to validate tool inputs in an MCP server?

Validating tool inputs in an MCP server is handled by enforcing Zod schemas during tool registration, ensuring reliable input validation and type safety before requests reach your core logic.

Can I use Streamable HTTP transport instead of stdio for my MCP server?

Yes, you can use Streamable HTTP transport instead of stdio. The Node/TypeScript SDK supports both configurations, allowing you to choose the transport that fits your deployment environment.

How do I register prompts and resources in a TypeScript MCP server?

Registering prompts and resources in a TypeScript MCP server involves using the Node SDK's configuration patterns to define their schemas and handlers, aligning with current API definitions from MCP docs.

How do I keep my MCP server compatible with current SDK APIs during upgrades?

Keeping an MCP server compatible with current SDK APIs during upgrades involves aligning your development with Context7 or MCP docs, ensuring your tool, resource, and prompt registrations match the latest definitions.

When should I not use stdio transport for an MCP server?

You should avoid stdio transport for an MCP server when your deployment requires network accessibility over HTTP, making Streamable HTTP transport the necessary choice for remote or web-based integrations.