mcp-server-patterns

Build MCP servers with the Node/TypeScript SDK.

1|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/hbvg234/jnmt.vn --skill mcp-server-patterns-hbvg234
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/hbvg234/jnmt.vn/tree/main/.claude/skills/mcp-server-patterns
Command: npx skills add https://github.com/hbvg234/jnmt.vn --skill mcp-server-patterns-hbvg234

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MCP servers need a structured setup with tools, resources, and prompts behind a clean transport layer; this skill provides a blueprint for building and maintaining MCP servers using the Node/TypeScript SDK, with guidance on stdio and Streamable HTTP transports and compatibility notes for different SDK versions.

Core Features & Use Cases

  • Tools: Define model-invocable actions (e.g. search, run) and register them via the SDK equivalents, ensuring input schemas and error handling.
  • Resources: Expose read-only data sources (e.g. file contents, API responses) via a consistent resource API and include a uri parameter in handlers.
  • Prompts: Create reusable, parameterized prompts and surface them to clients through the appropriate registration API.
  • Transport: Choose stdio for local clients and Streamable HTTP for remote clients; maintain transport-agnostic server logic to plug in different transports.
  • The Node/TypeScript SDK evolution means your code should adapt to changes in tool/resource/register signatures; consult MCP docs or Context7 for current API shapes.
  • Best practices include strong schemas via Zod, idempotent tool design, and clear error handling; version SDKs in package.json.

Quick Start

Configure a basic MCP server that exposes a tool named 'search' and a resource named 'docs' using the Node/TypeScript SDK.

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

To build an MCP server with Node and TypeScript, you use the SDK to register tools, resources, and prompts. You must also implement a transport layer, choosing between stdio for local clients and Streamable HTTP for remote clients.

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

Stdio transport connects MCP servers to local clients, while Streamable HTTP connects them to remote clients. Maintaining transport-agnostic server logic allows you to plug in different transports without rewriting core tool or resource handlers.

How do I register tools and resources using the TypeScript MCP SDK?▼

You register tools and resources using current SDK signatures, defining input schemas with Zod and including a uri parameter in resource handlers. The Node/TypeScript SDK evolves, so consult MCP docs for the exact API shapes.

Can I expose read-only data sources through my MCP server?▼

Yes, you can expose read-only data sources like file contents or API responses through the MCP server's resource API. You configure handlers with a uri parameter to surface these consistent data sources to clients.

What are the best practices for MCP server development in TypeScript?▼

Best practices include defining strong schemas via Zod, designing idempotent tools, and implementing clear error handling. You should also version your SDKs in package.json and maintain transport-agnostic server logic.

Why do my MCP server tool registration signatures keep changing?▼

Tool registration signatures change because the Node/TypeScript MCP SDK evolves over time. You must adapt your code to these changes and consult MCP docs or Context7 to verify the current API shapes for tools and resources.