mcp-server-patterns

Implements MCP servers with tools, resources, prompts, and stdio or HTTP transports.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @modelcontextprotocol/sdk, zod.

What problem does it solve? Building a Model Context Protocol server requires navigating an evolving SDK API, choosing between stdio and Streamable HTTP transports, and correctly registering tools, resources, and prompts. This Skill provides the patterns and guidance to implement MCP servers in Node/TypeScript without guessing at current API signatures. ## Core Features & Use Cases - Tool, Resource, and Prompt Registration: Register callable tools with Zod-validated input schemas, read-only resources with URI handlers, and parameterized prompt templates using the @modelcontextprotocol/sdk. - Transport Selection Guidance: Choose stdio for local clients like Claude Desktop or Streamable HTTP for remote clients like Cursor, with notes on legacy HTTP/SSE backward compatibility. - SDK Version Awareness: Directs verification against Context7 or official MCP docs since registration APIs (tool() vs registerTool()) change across SDK versions. - Use Case: You need to expose an internal search API to Claude Desktop. Use this Skill to scaffold an MCP server, register a search tool with a Zod schema, and connect it over stdio. ## Quick Start Use the mcp-server-patterns skill to scaffold an MCP server in TypeScript with one Zod-validated tool and a stdio transport.

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 TypeScript?▼

Install @modelcontextprotocol/sdk and zod, create an McpServer instance with a name and version, then register tools, resources, and prompts. Connect a stdio transport for local clients or Streamable HTTP for remote clients, checking official docs for current API signatures.

How do I register tools in the MCP TypeScript SDK?▼

Tool registration uses server.tool() or registerTool() depending on SDK version, with either positional arguments or an options object containing name, description, and inputSchema. Verify the exact signature against Context7 or the official MCP documentation for your installed version.

Should I use stdio or Streamable HTTP for my MCP server?▼

Use stdio for local clients like Claude Desktop and Streamable HTTP for remote clients like Cursor or cloud deployments. Keep server logic independent of transport so you can swap entrypoints, and support legacy HTTP/SSE only for backward compatibility.

Does the MCP SDK support input validation for tools?▼

Yes, the TypeScript SDK works with Zod schemas to validate tool inputs. Define a schema for every tool documenting parameters and return shape, and return structured errors the model can interpret rather than raw stack traces.

Why does my MCP tool registration code fail after an SDK upgrade?▼

The MCP SDK registration API has changed over time, switching between tool()/resource() and registerTool()/registerResource() patterns. Pin the SDK version in package.json and check release notes or Context7 when upgrading to avoid signature mismatches.