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.