mcp-server-patterns

Build MCP servers exposing tools and resources with Zod validation.

Updated Apr 25, 2026
One-click install
npx skills add https://github.com/ldk-hub/broke-shopping --skill mcp-server-patterns-ldk-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/ldk-hub/broke-shopping/tree/main/.agent/.agents/skills/mcp-server-patterns
Command: npx skills add https://github.com/ldk-hub/broke-shopping --skill mcp-server-patterns-ldk-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduce friction in building MCP servers by exposing tools and resources to AI clients.

Core Features & Use Cases

  • Tools: register and expose actions the model can invoke.
  • Resources: read-only data sources the model can fetch.
  • Prompts: reusable templates guiding model behavior.
  • Transport: support stdio for local development and streamable HTTP for remote.

Quick Start

Install the MCP SDK, initialize a new server project, and register a sample tool with a basic handler.

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 Node.js to expose tools to an AI client?

You build an MCP server using the Node/TS SDK by registering tools, resources, and prompts, then configuring transport. This Skill provides end-to-end workflows from tool registration to transport setup, reducing friction in exposing actions to AI clients.

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

Stdio transport supports local MCP server development, while streamable HTTP enables remote connections. This Skill separates tooling, resources, and transport configuration to maintain robust operation across both stdio and streamable HTTP scenarios.

How do I validate tool inputs when registering actions with the MCP SDK?

You validate tool inputs by enforcing type-safe validation with Zod when registering actions with the MCP SDK. This Skill ensures robust operation by maintaining version-aware SDK usage and type-safe validation for tools and resources.

Can I expose read-only data sources to a model using Model Context Protocol?

Yes, you can expose read-only data sources by registering resources with the MCP server. This Skill covers registering resources that the model can fetch, alongside tools for invocable actions and prompts for reusable templates.

What's the best way to structure a TypeScript project for a Model Context Protocol server?

The best way to structure a TypeScript MCP server is by separating tooling, resources, and transport. This Skill enforces type-safe validation with Zod and maintains version-aware SDK usage for robust operation.