← ClaudeAtlas

mcp-server-devlisted

Build MCP (Model Context Protocol) servers in TypeScript with @modelcontextprotocol/sdk. Use when writing, reviewing, or refactoring MCP server code: (1) Creating MCP servers with McpServer, (2) Registering tools with registerTool, inputSchema, outputSchema, Zod validation, (3) Defining resources and resource templates, (4) Defining prompts with arguments, (5) Transports: StdioServerTransport, NodeStreamableHTTPServerTransport, SSE, (6) Tool annotations (readOnlyHint, destructiveHint, idempotentHint), (7) Error handling and isError responses, (8) Dynamic tool loading and tool list change notifications, (9) Middleware patterns for MCP tools, (10) Testing MCP servers with vitest, (11) Publishing and configuring for Claude Code, Cursor, Windsurf, (12) Any @modelcontextprotocol/sdk imports.
arthjean/skills · ★ 3 · AI & Automation · score 69
Install: claude install-skill arthjean/skills
# MCP Server Development — TypeScript SDK ## What is MCP The **Model Context Protocol** is an open standard for connecting AI assistants (Claude, Cursor, etc.) to external tools and data. An MCP server exposes **tools**, **resources**, and **prompts** that clients can discover and invoke. ## Quick Setup ```bash bun init bun add @modelcontextprotocol/sdk zod ``` ```typescript // src/index.ts import { McpServer } from '@modelcontextprotocol/server' import { StdioServerTransport } from '@modelcontextprotocol/node' import * as z from 'zod/v4' const server = new McpServer({ name: 'my-mcp-server', version: '1.0.0', }) // Register a tool server.registerTool( 'greet', { description: 'Greet a user by name', inputSchema: z.object({ name: z.string().describe('Name of the person to greet'), }), }, async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }], }) ) // Start server with stdio transport const transport = new StdioServerTransport() await server.connect(transport) ``` ```json // package.json essentials { "type": "module", "bin": { "my-mcp-server": "./dist/index.js" }, "scripts": { "build": "tsc", "start": "node dist/index.js" } } ``` ## Three Primitives | Primitive | Purpose | Client Action | Example | |-----------|---------|---------------|---------| | **Tools** | Execute actions, return results | LLM decides when to call | API calls, calculations, file ops | | **Resources** | Expose read-only data