mcp-server-patterns

Register tools, resources, and prompts on an MCP server using Node/TypeScript SDK.

7|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Davie521/claude-skills --skill mcp-server-patterns-davie521
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/Davie521/claude-skills/tree/main/plugins/web/skills/mcp-server-patterns
Command: npx skills add https://github.com/Davie521/claude-skills --skill mcp-server-patterns-davie521

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MCP servers require a consistent pattern for exposing tools, resources, and prompts, plus transport configuration to connect AI assistants reliably.

Core Features & Use Cases

  • Tools: Register and expose model-accessible tools for the MCP server.
  • Resources & Prompts: Define resources and reusable prompts to guide model behavior.
  • Use Case: Build a new MCP server, upgrade the SDK, or debug registration and transport issues.

Quick Start

Create an MCP server using the Node/TypeScript SDK and register a sample tool and resource to verify setup.

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 the Node and TypeScript SDK?

To build an MCP server with the Node and TypeScript SDK, you must explicitly register tools, resources, and prompts with proper schemas like Zod, then configure either stdio or streamable HTTP transports to connect AI assistants reliably.

What is the difference between stdio and streamable HTTP transports for an MCP server?

Stdio and streamable HTTP transports are two distinct methods for connecting AI assistants to an MCP server. Both adhere to idempotent transport patterns, but streamable HTTP allows network-based communication whereas stdio relies on standard input and output streams.

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

Registering tools and resources in a TypeScript MCP server requires defining them with proper schemas like Zod. This explicit registration exposes model-accessible tools and resources, guiding model behavior over the MCP server.

Can I use Context7 or MCP docs to verify current APIs for my TypeScript MCP server?

Yes, the Node and TypeScript SDK setup is compatible with Context7 or MCP docs. This compatibility ensures you reference current APIs when configuring transports, registering tools, or debugging your MCP server.

Why does my MCP server fail to expose prompts to AI assistants correctly?

An MCP server fails to expose prompts correctly if explicit registration with proper schemas is missing. Defining reusable prompts with schema validation like Zod is required to successfully guide model behavior and connect AI assistants.

Do I need Zod schemas to define resources and prompts in an MCP server?

Yes, using schema validation libraries like Zod is required to explicitly register tools, resources, and prompts. Proper schemas ensure model-accessible tools and reusable prompts function correctly over the configured MCP server transports.