跳到正文
Skillpedia
连接器(MCP)48k · #5188

mcp-tool-developer

它能做什么

这个工具可以帮你构建 AI 的服务器和工具,遵循一种叫做 MCP 的协议。它涵盖从最初构思到发布的整个过程,支持 TypeScript 和 Python 等语言。

适用场景

  • ✓当你要从零开始构建一个新的 MCP 服务器时。
  • ✓当你想把现有的 API 改造成 MCP 工具时。
  • ✓当你要把 MCP 服务器发布到注册中心时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mcp-tool-developer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mcp-tool-developer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“用 TypeScript 创建一个 MCP 服务器,其中包含一个可以向用户问好的工具。”

每周 5 个新技能,1 分钟读完。

工作原理

首先,你需要定义服务器要做什么(工具、数据、文本模板)以及它如何通信。然后,设计工具如何接收和返回信息,最后使用官方开发工具包编写代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MCP Tool Developer

Overview

Expert at building Model Context Protocol (MCP) servers that give AI agents new capabilities. Covers the full MCP development lifecycle: specification, implementation, testing, deployment, and registry publishing. Supports both TypeScript and Python with production-ready patterns.

This skill understands MCP specification primitives (tools, resources, prompts, sampling), transport options (stdio, SSE, Streamable HTTP), and the tool design patterns that make MCP servers reliable and composable.

When to Use This Skill

  • Use when building a new MCP server from scratch
  • Use when wrapping an existing API as an MCP tool
  • Use when debugging MCP server issues
  • Use when designing the tool schema for an MCP server
  • Use when publishing an MCP server to a registry

How It Works

Step 1: Define the MCP Server Scope

Identify what capabilities the server should expose:

  • Tools - Functions the LLM can call (primary use case)
  • Resources - Data the LLM can read (files, APIs, databases)
  • Prompts - Reusable prompt templates

Choose the transport:

  • stdio - For local CLI tools (Claude Code, Cursor)
  • SSE (Server-Sent Events) - For remote/hosted tools
  • Streamable HTTP - New in MCP spec for modern deployments

Step 2: Design the Tool Schema

Define input/output schemas before writing implementation:

{
  name: "tool_name",
  description: "What this tool does (visible to the LLM)",
  inputSchema: {
    type: "object",
    properties: { ... },
    required: [ ... ]
  }
}

Step 3: Implement the Server

Create the server with proper error handling, validation, and logging. Use the official MCP SDK for TypeScript (@modelcontextprotocol/sdk) or Python (mcp).

Step 4: Test and Deploy

Test with the MCP Inspector, validate tool schemas, handle edge cases, then deploy locally or remotely.

Examples

Example 1: TypeScript MCP Server

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({ name: "my-tools", version: "1.0.0" });

server.tool("greet", "Greet someone by name",
  { name: z.string().describe("Person's name") },
  async ({ name }) => ({ content: [{ type: "text", text: `Hello, ${name}!` }] })
);

const transport = new StdioServerTransport();
await server.connect(transport);

Example 2: API Wrapper Pattern

Wrap an external API as an MCP tool with auth, rate limiting, and error handling:

  • Map API endpoints to tools
  • Handle auth via environment variables
  • Transform API responses to LLM-friendly format
  • Add retry logic with exponential backoff

Best Practices

  • Build small, focused tools that can be chained rather than monolithic tools
  • Return structured errors, not crashes - tools should fail gracefully
  • Define schemas before implementation
  • Include descriptions that help the LLM understand when and how to use each tool
  • Validate all inputs against the schema
  • Add rate limiting for external API calls
  • Use environment variables for secrets, never hardcode credentials

Limitations

  • This skill provides guidance and code generation; actual runtime testing requires a development environment
  • MCP specification is evolving; always check the latest spec version
  • Security review is essential before deploying tools that handle sensitive data

Security and Safety Notes

  • Never hardcode API keys or credentials in tool implementations
  • Use environment variables or secret managers for all authentication
  • Validate and sanitize all inputs to prevent injection attacks
  • Rate limit external API calls to prevent abuse
  • Review tool permissions carefully - tools can access files, networks, and execute code

Common Pitfalls

  • Problem: LLM calls tools with wrong parameters Solution: Improve tool descriptions and add examples in the description field. The LLM reads descriptions to decide how to call tools.

  • Problem: Tool times out on large inputs Solution: Add input size validation and pagination. Stream large responses instead of buffering.

Related Skills

  • api-integration-architect - For API design patterns used in MCP tools
  • security-audit-code-reviewer - For reviewing MCP server code security
常见问题

什么是 MCP?

MCP(Model Context Protocol,模型上下文协议)是一种协议,让 AI 代理能够以结构化的方式使用工具并访问数据。

支持哪些语言?

构建 MCP 服务器和工具时,主要支持 TypeScript 和 Python。

AI 怎么知道什么时候该用某个工具?

AI 会根据你为每个工具提供的描述,理解它的功能,以及什么时候调用它比较合适。

详情

作者的原始描述

Build Model Context Protocol (MCP) servers and tools from scratch. Full-stack MCP development with TypeScript/Python, testing, deployment, and registry publishing.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5188
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能