[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F6NHJ9A7BHN7HDD96JXDCC":3,"skill-same:01M7F6NHJ9A7BHN7HDD96JXDCC":52},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7F6NHJ9A7BHN7HDD96JXDCC","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. Use when building or debugging an MCP server — tools, resources, prompts, validation, or transport choice.","JUICEWRLD998\u002Fmyskills","JUICEWRLD998","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F112366831?v=4","01M7F6BY76NXJQY5JX1JQ0J9GA","BLVCK_NINJA","01M7F6BY8EBEVH8BX79AVB9B5T",0,"MIT","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fplugins\u002Fecc__ecc\u002F.agents\u002Fskills\u002Fmcp-server-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",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. Use when building or debugging an MCP server — tools, resources, prompts, validation, or transport choice.\nlicense: MIT\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\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\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,"license":15,"description":7},"main","e4b5c5ed00b1419bd769ad56a0621e872609ac23","plugins\u002Fecc__ecc\u002F.agents\u002Fskills\u002Fmcp-server-patterns","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998","blvckninja.vercel.app","Full-stack Dev 💻|| Smart Contract Auditor||Blockchain Engineer||Road to mastery 🚀","2026-10-30 17:50:51",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add JUICEWRLD998\u002Fmyskills --skill mcp-server-patterns",{"tool":38,"command":39},"bunx","bunx skills add JUICEWRLD998\u002Fmyskills --skill mcp-server-patterns",{"tool":41,"command":42},"pnpm","pnpm dlx skills add JUICEWRLD998\u002Fmyskills --skill mcp-server-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fplugins\u002Fecc__ecc\u002F.agents\u002Fskills\u002Fmcp-server-patterns\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",269,"https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fplugins\u002Fecc__ecc\u002F.agents\u002Fskills\u002Fmcp-server-patterns\u002Fagents\u002Fopenai.yaml",[53,60,67,74,83,91],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FBFRSSQYQZNR9JDBF5KS4Q","web-pentest","Authorized web pentest: recon, proof-based exploits, report.","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-pentest\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"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},"01M7FBEWDAAP23Z2VAAG3N6BXZ","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Ftest-driven-development\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},"01M7FBENYKD6ZK0R73SVEZ0RVK","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\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":78,"licenseFileUrl":79,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7FBE16336DACSKJ88EVNQV2","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fsynced\u002F2afcd8ab-ba1f-4bc7-97aa-30e65b87f9ec_e979b332-d9cd-418f-b1bb-ef8141c48880\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fsynced\u002F2afcd8ab-ba1f-4bc7-97aa-30e65b87f9ec_e979b332-d9cd-418f-b1bb-ef8141c48880\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FBCTE262XYW1MF4AXS7W4T","learn","Use this skill when the user wants intellectual understanding — learning how or why something works, not getting a task done or soliciting Claude's judgment.\n\nTrigger for:\n- Explicit learning requests: teach, explain, ELI5, walk me through, quiz me, flashcards, \"I'm rusty on\"; definitions (\"what is X\")\n- Terse concept names implying \"help me understand this\": \"Galois theory,\" \"transformers, from scratch\"\n- Confusion signals: \"won't stick,\" \"keep mixing these up,\" \"not getting it\"\n- Learning-path questions: prerequisites, sequencing, what to study before X\n- Conceptual questions about mechanisms, causes, or dynamics\n\nDon't trigger for:\n- Tasks: coding, writing, calculation, translation, factual lookup, news updates\n- Personal troubleshooting; resource\u002Ftextbook recommendations\n- Claude's evaluative verdict: opinion prompts (\"do you think X\", \"settle this\", \"honest take\", \"is X dead \u002F still taken seriously\") and interpretive takes (\"was X really as harsh as people say\")","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fsynced\u002F2afcd8ab-ba1f-4bc7-97aa-30e65b87f9ec_e979b332-d9cd-418f-b1bb-ef8141c48880\u002Flearn\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fsynced\u002F2afcd8ab-ba1f-4bc7-97aa-30e65b87f9ec_e979b332-d9cd-418f-b1bb-ef8141c48880\u002Flearn\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7FB94QHCE1GV8VA8V0TGQAX","plan","Write a markdown plan to .hermes\u002Fplans\u002F; no execution.","https:\u002F\u002Fgithub.com\u002FJUICEWRLD998\u002Fmyskills\u002Fblob\u002Fmain\u002Fskills\u002Fplan\u002FSKILL.md",[],[]]