mcp-server-patterns

Build MCP servers with tools, resources, prompts, and Zod validation using the TypeScript SDK.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/diazMelgarejo/orama-system --skill mcp-server-patterns-diazmelgarejo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/diazMelgarejo/orama-system/tree/main/.cursor/.agents/skills/mcp-server-patterns
Command: npx skills add https://github.com/diazMelgarejo/orama-system --skill mcp-server-patterns-diazmelgarejo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @modelcontextprotocol/sdk, zod.

What problem does it solve? Building Model Context Protocol servers requires navigating an evolving SDK API, choosing between stdio and HTTP transports, and correctly registering tools, resources, and prompts. This Skill provides the patterns and guidance to implement MCP servers without guessing at current API signatures. ## Core Features & Use Cases - Tool, Resource, and Prompt Registration: Register callable tools, read-only resources, and parameterized prompt templates using the @modelcontextprotocol/sdk with Zod schema validation. - Transport Selection: Configure stdio transport for local clients like Claude Desktop or Streamable HTTP for remote clients like Cursor and cloud deployments. - Use Case: You need to expose an internal API to AI assistants. Use this Skill to scaffold an MCP server, define Zod-validated input schemas for each tool, and connect it via stdio so Claude Desktop can invoke your endpoints. ## Quick Start Ask the AI to build an MCP server with a tool that queries your API, using Zod for input validation and stdio transport for Claude Desktop.

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

Install @modelcontextprotocol/sdk and zod, create an McpServer instance with a name and version, then register tools and resources with Zod input schemas. Connect a stdio transport for local clients or Streamable HTTP for remote clients.

How do I register tools in the MCP TypeScript SDK?

Register tools using server.tool() or registerTool() depending on your SDK version, passing a name, description, Zod input schema, and handler function. Check the official MCP docs or Context7 for current signatures since the API has changed across versions.

Should I use stdio or HTTP transport 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 switch in the entrypoint.

Does the MCP SDK support input validation?

Yes, the TypeScript SDK uses Zod schemas to validate tool inputs. Define a schema for every tool documenting parameters and return shape, which also helps the model understand how to call the tool correctly.

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

The SDK registration API has changed over time, switching between positional arguments, object arguments, and registerTool() methods. Pin your SDK version in package.json and verify current signatures against the official MCP documentation when upgrading.