[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M730MWQCC1FZWMM02DCYHWT2":3,"skill-same:01M730MWQCC1FZWMM02DCYHWT2":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M730MWQCC1FZWMM02DCYHWT2","mcp-server-patterns",null,"Build MCP servers with Node\u002FTypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest API.","SriramGandhiS\u002FSkills","SriramGandhiS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211849986?v=4","01M72WQCW12BYX71C6WN584TTA","Sriram S","01M72WQCWTJ2RD0ET1X31AF1RC",1,"MIT","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fmcp-server-patterns\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: mcp-server-patterns\ndescription: Build MCP servers with Node\u002FTypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest API.\norigin: ECC\n---\n\n# MCP Server Patterns\n\nThe Model Context Protocol (MCP) lets AI assistants call tools, read resources, and use prompts from your server. Use this skill when building or maintaining MCP servers. The SDK API evolves; check Context7 (query-docs for \"MCP\") or the official MCP documentation for current method names and signatures.\n\nFor the broader routing decision of when a capability should be a rule, a skill, MCP, or a plain CLI\u002FAPI workflow, see [docs\u002Fcapability-surface-selection.md](..\u002F..\u002Fdocs\u002Fcapability-surface-selection.md).\n\n## When to Use\n\nUse when: implementing a new MCP server, adding tools or resources, choosing stdio vs HTTP, upgrading the SDK, or debugging MCP registration and transport issues.\n\n## How It Works\n\n### Core concepts\n\n- **Tools**: Actions the model can invoke (e.g. search, run a command). Register with `registerTool()` or `tool()` depending on SDK version.\n- **Resources**: Read-only data the model can fetch (e.g. file contents, API responses). Register with `registerResource()` or `resource()`. Handlers typically receive a `uri` argument.\n- **Prompts**: Reusable, parameterised prompt templates the client can surface (e.g. in Claude Desktop). Register with `registerPrompt()` or equivalent.\n- **Transport**: stdio for local clients (e.g. Claude Desktop); Streamable HTTP is preferred for remote (Cursor, cloud). Legacy HTTP\u002FSSE is for backward compatibility.\n\nThe Node\u002FTypeScript SDK may expose `tool()` \u002F `resource()` or `registerTool()` \u002F `registerResource()`; the official SDK has changed over time. Always verify against the current [MCP docs](https:\u002F\u002Fmodelcontextprotocol.io) or Context7.\n\n### Connecting with stdio\n\nFor local clients, create a stdio transport and pass it to your server’s connect method. The exact API varies by SDK version (e.g. constructor vs factory). See the official MCP documentation or query Context7 for \"MCP stdio server\" for the current pattern.\n\nKeep server logic (tools + resources) independent of transport so you can plug in stdio or HTTP in the entrypoint.\n\n### Remote (Streamable HTTP)\n\nFor Cursor, cloud, or other remote clients, use **Streamable HTTP** (single MCP HTTP endpoint per current spec). Support legacy HTTP\u002FSSE only when backward compatibility is required.\n\n## Examples\n\n### Install and server setup\n\n```bash\nnpm install @modelcontextprotocol\u002Fsdk zod\n```\n\n```typescript\nimport { McpServer } from \"@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fmcp.js\";\nimport { z } from \"zod\";\n\nconst server = new McpServer({ name: \"my-server\", version: \"1.0.0\" });\n```\n\nRegister tools and resources using the API your SDK version provides: some versions use `server.tool(name, description, schema, handler)` (positional args), others use `server.tool({ name, description, inputSchema }, handler)` or `registerTool()`. Same for resources — include a `uri` in the handler when the API provides it. Check the official MCP docs or Context7 for the current `@modelcontextprotocol\u002Fsdk` signatures to avoid copy-paste errors.\n\nUse **Zod** (or the SDK’s preferred schema format) for input validation.\n\n## Best Practices\n\n- **Schema first**: Define input schemas for every tool; document parameters and return shape.\n- **Errors**: Return structured errors or messages the model can interpret; avoid raw stack traces.\n- **Idempotency**: Prefer idempotent tools where possible so retries are safe.\n- **Rate and cost**: For tools that call external APIs, consider rate limits and cost; document in the tool description.\n- **Versioning**: Pin SDK version in package.json; check release notes when upgrading.\n\n## Official SDKs and Docs\n\n- **JavaScript\u002FTypeScript**: `@modelcontextprotocol\u002Fsdk` (npm). Use Context7 with library name \"MCP\" for current registration and transport patterns.\n- **Go**: Official Go SDK on GitHub (`modelcontextprotocol\u002Fgo-sdk`).\n- **C#**: Official C# SDK for .NET.\n","# MCP Server Patterns\n\nThe Model Context Protocol (MCP) lets AI assistants call tools, read resources, and use prompts from your server. Use this skill when building or maintaining MCP servers. The SDK API evolves; check Context7 (query-docs for \"MCP\") or the official MCP documentation for current method names and signatures.\n\nFor the broader routing decision of when a capability should be a rule, a skill, MCP, or a plain CLI\u002FAPI workflow, see [docs\u002Fcapability-surface-selection.md](..\u002F..\u002Fdocs\u002Fcapability-surface-selection.md).\n\n## When to Use\n\nUse when: implementing a new MCP server, adding tools or resources, choosing stdio vs HTTP, upgrading the SDK, or debugging MCP registration and transport issues.\n\n## How It Works\n\n### Core concepts\n\n- **Tools**: Actions the model can invoke (e.g. search, run a command). Register with `registerTool()` or `tool()` depending on SDK version.\n- **Resources**: Read-only data the model can fetch (e.g. file contents, API responses). Register with `registerResource()` or `resource()`. Handlers typically receive a `uri` argument.\n- **Prompts**: Reusable, parameterised prompt templates the client can surface (e.g. in Claude Desktop). Register with `registerPrompt()` or equivalent.\n- **Transport**: stdio for local clients (e.g. Claude Desktop); Streamable HTTP is preferred for remote (Cursor, cloud). Legacy HTTP\u002FSSE is for backward compatibility.\n\nThe Node\u002FTypeScript SDK may expose `tool()` \u002F `resource()` or `registerTool()` \u002F `registerResource()`; the official SDK has changed over time. Always verify against the current [MCP docs](https:\u002F\u002Fmodelcontextprotocol.io) or Context7.\n\n### Connecting with stdio\n\nFor local clients, create a stdio transport and pass it to your server’s connect method. The exact API varies by SDK version (e.g. constructor vs factory). See the official MCP documentation or query Context7 for \"MCP stdio server\" for the current pattern.\n\nKeep server logic (tools + resources) independent of transport so you can plug in stdio or HTTP in the entrypoint.\n\n### Remote (Streamable HTTP)\n\nFor Cursor, cloud, or other remote clients, use **Streamable HTTP** (single MCP HTTP endpoint per current spec). Support legacy HTTP\u002FSSE only when backward compatibility is required.\n\n## Examples\n\n### Install and server setup\n\n```bash\nnpm install @modelcontextprotocol\u002Fsdk zod\n```\n\n```typescript\nimport { McpServer } from \"@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fmcp.js\";\nimport { z } from \"zod\";\n\nconst server = new McpServer({ name: \"my-server\", version: \"1.0.0\" });\n```\n\nRegister tools and resources using the API your SDK version provides: some versions use `server.tool(name, description, schema, handler)` (positional args), others use `server.tool({ name, description, inputSchema }, handler)` or `registerTool()`. Same for resources — include a `uri` in the handler when the API provides it. Check the official MCP docs or Context7 for the current `@modelcontextprotocol\u002Fsdk` signatures to avoid copy-paste errors.\n\nUse **Zod** (or the SDK’s preferred schema format) for input validation.\n\n## Best Practices\n\n- **Schema first**: Define input schemas for every tool; document parameters and return shape.\n- **Errors**: Return structured errors or messages the model can interpret; avoid raw stack traces.\n- **Idempotency**: Prefer idempotent tools where possible so retries are safe.\n- **Rate and cost**: For tools that call external APIs, consider rate limits and cost; document in the tool description.\n- **Versioning**: Pin SDK version in package.json; check release notes when upgrading.\n\n## Official SDKs and Docs\n\n- **JavaScript\u002FTypeScript**: `@modelcontextprotocol\u002Fsdk` (npm). Use Context7 with library name \"MCP\" for current registration and transport patterns.\n- **Go**: Official Go SDK on GitHub (`modelcontextprotocol\u002Fgo-sdk`).\n- **C#**: Official C# SDK for .NET.\n",{"name":5,"origin":24,"description":7},"ECC","master","d6ca01da0f24a3b0e26e4a8b7b66cbd25d429f5d","skills\u002Feverything-claude-code\u002Fskills\u002Fmcp-server-patterns",0,"https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills","https:\u002F\u002Fgithub.com\u002FSriramGandhiS","https:\u002F\u002Fsriram.website\u002F","Curious guy who keeps tinkering until something works","2026-05-20 16:21:34",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add SriramGandhiS\u002FSkills --skill mcp-server-patterns",{"tool":40,"command":41},"bunx","bunx skills add SriramGandhiS\u002FSkills --skill mcp-server-patterns",{"tool":43,"command":44},"pnpm","pnpm dlx skills add SriramGandhiS\u002FSkills --skill mcp-server-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fmcp-server-patterns\u002FSKILL.md",true,[],[49,56,61,67,74,81],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M732609EPJWV13PVTX3GT4TM","webgpu-threejs-tsl","Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002Fskills\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7325XM47AGWB6K6C4VXKE6B","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7325WP6DES69JKC840VMFEP","verification-loop","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7325TFQF1DZTQ6J3WGQQ1VR","tdd-workflow","Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Ftdd-workflow\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7325RGV9AY9PK92D2V8KKPW","strategic-compact","Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fstrategic-compact\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7325MZC28SE86E7NMCNEFS4","security-review","Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment\u002Fsensitive features. Provides comprehensive security checklist and patterns.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fsecurity-review\u002FSKILL.md",[],[]]