mcp-server-patterns

Implement MCP servers with the Node/TypeScript SDK covering tools, resources, prompts, and transports.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill mcp-server-patterns-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/.agent/skills/mcp-server-patterns
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill mcp-server-patterns-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @modelcontextprotocol/sdk, zod.

What problem does it solve? Building a Model Context Protocol server involves evolving SDK APIs, multiple registration patterns, and transport choices that are easy to get wrong. This Skill provides current patterns and decision guidance so your MCP server registers tools, resources, and prompts correctly on the first attempt. ## Core Features & Use Cases - Tool, Resource, and Prompt Registration: Register capabilities with the correct SDK method signatures (tool/registerTool, resource/registerResource) and Zod-based input validation. - Transport Selection: Choose between stdio for local clients like Claude Desktop and Streamable HTTP for remote clients like Cursor, with guidance on legacy HTTP/SSE compatibility. - SDK Version Awareness: Directs you to Context7 or official MCP docs to verify current API signatures before writing code. - Use Case: You need to expose an internal search API to Claude Desktop. Use this Skill to scaffold an MCP server with a Zod-validated search tool, connect it over stdio, and structure errors so the model can interpret failures. ## Quick Start Ask the AI to scaffold an MCP server in TypeScript with a Zod-validated tool and stdio transport using the current @modelcontextprotocol/sdk API.

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 and resources using the API your SDK version provides. Verify current signatures against the official MCP docs or Context7 since the API has changed over time.

What is the difference between stdio and Streamable HTTP in MCP?

Stdio transport is for local clients like Claude Desktop, while Streamable HTTP is the preferred transport for remote clients such as Cursor or cloud deployments. Legacy HTTP/SSE should only be supported when backward compatibility is required.

How do I register tools in the MCP TypeScript SDK?

Depending on SDK version, use server.tool() with positional arguments, an options object, or registerTool(). Always include a Zod input schema for validation and check the official MCP documentation for the exact current signature.

Does the MCP SDK support languages other than TypeScript?

Yes, official SDKs exist beyond TypeScript. There is an official Go SDK at modelcontextprotocol/go-sdk on GitHub and an official C# SDK for .NET, alongside the JavaScript/TypeScript package on npm.

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

The SDK registration API has changed across versions, so older method signatures may no longer exist. Pin the SDK version in package.json, review release notes when upgrading, and confirm current signatures via Context7 or the official docs.