mcp-server-patterns

Build MCP servers with tools, resources, prompts, and transport configuration for Node and TypeScript.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill mcp-server-patterns-mostafa-ismail-2004
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/mostafa-ismail-2004/codex-plugin/tree/main/skills/mcp-server-patterns
Command: npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill mcp-server-patterns-mostafa-ismail-2004

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @modelcontextprotocol/sdk, zod.

What problem does it solve?

This Skill helps you design and implement Model Context Protocol servers without getting blocked by transport, registration, or SDK version confusion.

Core Features & Use Cases

  • Server setup guidance: Create MCP servers with the right structure for tools, resources, and prompts.
  • Transport decisions: Choose between stdio for local clients and Streamable HTTP for remote clients.
  • Validation and compatibility: Use Zod schemas, pin SDK versions, and verify current APIs against official MCP docs or Context7.
  • Use case: Build a Node or TypeScript MCP server that exposes search tools, read-only resources, and reusable prompts for Codex or other MCP clients.

Quick Start

Use the mcp-server-patterns skill to help me design a Node or TypeScript MCP server with proper tool registration, transport selection, and input validation.

Frequently Asked Questions about mcp-server-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up an MCP server in Node.js with tools, resources, and prompts?

To set up an MCP server in Node.js, structure your project to define tools, resources, and reusable prompts using the Model Context Protocol SDK. You must implement transport-independent server logic and validate all inputs with Zod schemas before exposing endpoints to clients.

When should I use stdio versus Streamable HTTP for an MCP server?

Use stdio transport for local MCP clients and Streamable HTTP for remote client connections. Choosing the right transport ensures your MCP server communicates correctly with its target environment, whether running locally or deployed across a network.

How do I validate input schemas for MCP server tools using Zod?

Validate input schemas for MCP server tools by defining Zod schemas for each tool's parameters. This enforces strict type checking and runtime validation, ensuring that malformed or invalid requests are rejected before reaching your core server logic.

Why are my MCP server tools not registering correctly with clients?

MCP server tools fail to register correctly when server logic is transport-dependent or SDK versions are mismatched. Debug registration by pinning your MCP SDK version, verifying current APIs against official documentation, and ensuring your server logic remains transport-independent.

Can I build an MCP server in TypeScript that exposes search tools and read-only resources?

Yes, you can build a TypeScript MCP server that exposes search tools, read-only resources, and reusable prompts. This setup allows clients like Codex to securely query data and execute predefined actions without modifying the underlying resource state.

What is the best way to keep an MCP server compatible with the latest SDK updates?

Keep an MCP server compatible with SDK updates by pinning your dependency versions and verifying current APIs against official MCP documentation or Context7. This prevents breaking changes from affecting your server's tool registration and transport configuration.