mcp-server-patterns

Structure MCP servers with tools, resources, prompts, and transport.

2|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/MomoDaviluke/star-citizen-promotion --skill mcp-server-patterns-momodaviluke
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/MomoDaviluke/star-citizen-promotion/tree/main/.agents/skills/ecc/mcp-server-patterns
Command: npx skills add https://github.com/MomoDaviluke/star-citizen-promotion --skill mcp-server-patterns-momodaviluke

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MCP Server Patterns provide a structured blueprint to build AI-enabled MCP servers using the Node/TypeScript SDK. It explains how to model Tools, Resources, Prompts, and Transport to enable an AI to call server-side functions, fetch data, and manage prompts securely, with guidance on stdio vs Streamable HTTP and proper validation.

Core Features & Use Cases

  • Tools: register and expose actions the model can invoke, with appropriate schemas.
  • Resources: expose read-only data endpoints for the model to fetch data or docs.
  • Prompts: reusable templates to drive model behavior and responses.
  • Transport: choose between stdio for local clients or Streamable HTTP for remote usage, with guidance for backward compatibility.
  • Use Cases: building, debugging, and upgrading MCP servers, integrating with SDKs and docs, and ensuring proper validation with Zod.

Quick Start

Instantiate an MCP server with the Node/TypeScript SDK and register tools, resources, and prompts to expose a functional server via Streamable HTTP.

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

To build an MCP server, instantiate the server using the Node/TypeScript SDK and explicitly register your tools, resources, and prompts. You must apply schema validation via Zod to ensure safe, transport-agnostic operation.

What is the difference between stdio and Streamable HTTP transport for MCP servers?

MCP server transport determines how clients connect: stdio is used for local clients, while Streamable HTTP enables remote usage. The pattern provides guidance on choosing between them and maintaining backward compatibility during upgrades.

How do I expose actions and read-only data endpoints for an AI model in an MCP server?

You expose actions by registering Tools with appropriate schemas for the model to invoke, and expose read-only data by defining Resources. Both require explicit registration in your MCP server to function safely.

Do I need schema validation to create MCP server tools with TypeScript?

Yes, schema validation is required when creating MCP server tools with TypeScript. You must use Zod to validate schemas, ensuring that the server-side functions the AI invokes operate safely and correctly.

Can I use reusable prompt templates to drive AI behavior in an MCP server?

Yes, you can register Prompts within your MCP server to provide reusable templates. These templates drive model behavior and manage responses securely alongside your registered tools and resources.