帮助开发者用 Node/TypeScript 快速构建符合规范的 MCP 服务器与工具能力
该技能材料显示其本质是关于构建 MCP Server 的提示/文档型内容,本身未声明需要密钥、远程端点或本地执行行为。结合开源且社区采用度很高,整体风险偏低,但因其主题涉及可扩展到工具/资源/HTTP 传输的服务器开发,使用时仍应关注后续实际实现带来的权限与依赖面。
材料明确标注无需密钥或环境变量;README 也未要求登录、API token 或凭证注入。就当前技能本身看,未见凭证收集、存储或滥用迹象。
系统检查项与材料均显示无预设远程端点;内容仅讨论 stdio 与 Streamable HTTP 等模式,属于说明性文档,没有证据表明该技能本身会向外发送用户数据。
该对象被判定为 prompt-only,当前提供的是模式说明与示例片段,而非可直接执行的工具。虽然示例讨论 MCP tool 可运行命令等能力,但这是通用概念介绍,不等于此技能自身具备执行权限。
未声明读写本地文件、系统资源或外部数据源的实际权限;README 中对 resources 的描述停留在概念层,未见该技能自身请求过度数据访问。
来源为 GitHub 开源仓库且社区星标极高,明显降低风险并支持可审计性;但许可证未声明、维护状态未知,且材料引用 npm 依赖 `@modelcontextprotocol/sdk` 与 `zod`,因此仍需对后续实际采用的代码版本与依赖完整性保持基本供应链审查。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "mcp-server-patterns" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/mcp-server-patterns/SKILL.md 2. 保存为 ~/.claude/skills/mcp-server-patterns/SKILL.md 3. 装好后重载技能,告诉我可以用了
请用 Node.js 和 TypeScript SDK 生成一个最小可运行的 MCP 服务器示例,包含一个 tools 接口、一个 resource、一个 prompt,并使用 Zod 做参数校验。请给出项目结构、关键代码和启动命令。
一套可运行的 MCP 服务器脚手架示例,含目录结构、TypeScript 代码与运行说明。
我想为 MCP 服务器添加两个工具:网页摘要和关键词提取。请用 TypeScript SDK 设计 tools 的输入输出 schema,使用 Zod 校验参数,并说明错误处理和返回格式的最佳实践。
两个工具的 schema 与实现建议,包括 Zod 校验、错误处理方式和标准化返回结构。
请比较 MCP 服务器使用 stdio 与 Streamable HTTP 两种传输方式的差异,分别说明适用场景、部署方式、优缺点,并给出 Node/TypeScript SDK 的配置示例。
一份清晰的传输方案对比与配置示例,帮助选择合适的 MCP 服务接入方式。
The 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.
For the broader routing decision of when a capability should be a rule, a skill, MCP, or a plain CLI/API workflow, see docs/capability-surface-selection.md.
Use when: implementing a new MCP server, adding tools or resources, choosing stdio vs HTTP, upgrading the SDK, or debugging MCP registration and transport issues.
registerTool() or tool() depending on SDK version.registerResource() or resource(). Handlers typically receive a uri argument.registerPrompt() or equivalent.The Node/TypeScript SDK may expose tool() / resource() or registerTool() / registerResource(); the official SDK has changed over time. Always verify against the current MCP docs or Context7.
For 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.
Keep server logic (tools + resources) independent of transport so you can plug in stdio or HTTP in the entrypoint.
For Cursor, cloud, or other remote clients, use Streamable HTTP (single MCP HTTP endpoint per current spec). Support legacy HTTP/SSE only when backward compatibility is required.
npm install @modelcontextprotocol/sdk zod
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
Register 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/sdk signatures to avoid copy-paste errors.
Use Zod (or the SDK’s preferred schema format) for input validation.
@modelcontextprotocol/sdk (npm). Use Context7 with library name "MCP" for current registration and transport patterns.modelcontextprotocol/go-sdk).扫描 Claude Code 配置中的安全漏洞、误配与注入风险并给出检查结果
帮助用户搭建 WireGuard VPN、配置客户端并安全远程访问家庭网络。
读取计划文档并拆解步骤,生成可直接粘贴的 /orchestrate 链式提示词
为 Spring Boot 与 Quarkus 服务生成并统一应用 Java 编码规范。
帮助你设计 Quarkus 3 后端架构模式,覆盖消息、REST、数据访问与异步处理。
将界面截图或设计稿批量转换为 Vue 3 组件代码,适配常见组件库。
帮助开发者快速搭建可用于生产环境的 TypeScript MCP 服务器脚手架。
帮助开发者快速搭建 TypeScript 的 MCP 服务器并扩展示例工具与资源。
帮助开发者用 TypeScript 快速搭建类型安全的 MCP 服务器模板
帮助开发者用 TypeScript 快速搭建并扩展 MCP 服务器项目。
指导你构建高质量 MCP 服务器,安全集成外部 API 与服务供大模型调用。
为开发者提供可直接上手的 TypeScript MCP 服务器脚手架与架构范式