Communitygithub.com

aiskillstore/marketplace

构建高质量 MCP 服务器的开发指南,帮助 LLM 通过精心设计的工具与外部服务交互。适用于使用 Python (FastMCP) 或 Node/TypeScript (MCP SDK) 构建 MCP 服务器以集成外部 API 或服务的场景。

marketplace 是什么?

此技能是一份详细的 MCP 服务器开发指南,旨在帮助开发者和 AI 智能体创建高质量、可用的模型上下文协议服务器。它涵盖了一个结构化的四阶段工作流程:研究与规划、实现、审查与测试,以及创建评估。该指南强调使用 TypeScript 或 Python 等推荐技术栈,并为每种语言提供了 SDK 文档和具体代码示例。其核心优势在于指导如何设计工具,使其命名清晰、描述准确、错误信息可操作,并能通过批量操作和分页等功能高效处理数据,从而最大限度地提升 LLM 在实际任务中的表现。该技能还引用了多个参考文件,如最佳实践指南、语言实现指南和评估创建指南,供开发者按需加载。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiskillstore/marketplace/tree/HEAD/skills/mcp-builder

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

MCP 服务器开发指南

概述

创建 MCP(模型上下文协议)服务器,使大语言模型能够通过精心设计的工具与外部服务交互。MCP 服务器的质量取决于其如何帮助 LLM 完成真实世界的任务。


流程

🚀 高级工作流程

创建一个高质量的 MCP 服务器分为四个主要阶段:

阶段 1:深度研究与规划

1.1 理解现代 MCP 设计

API 覆盖度与工作流工具: 在全面的 API 端点覆盖与专门的工作流工具之间取得平衡。工作流工具在某些特定任务上可能更方便,而全面的覆盖则能为智能体提供组合操作的灵活性。性能因客户端而异——某些客户端受益于能够组合基本工具的代码执行,而另一些则更适合高层工作流。不确定时,优先考虑全面的 API 覆盖。

工具命名与可发现性: 清晰、描述性的工具名称能帮助智能体快速找到合适的工具。使用一致的前缀(例如 github_create_issue、github_list_repos)和面向操作的命名。

上下文管理: 智能体受益于简洁的工具描述以及过滤/分页结果的能力。设计能返回聚焦、相关数据的工具。某些客户端支持代码执行,这有助于智能体高效地过滤和处理数据。

可操作的错误消息: 错误消息应引导智能体找到解决方案,并提供具体建议和后续步骤。

1.2 研究 MCP 协议文档

浏览 MCP 规范:

从站点地图开始查找相关页面:https://modelcontextprotocol.io/sitemap.xml

然后使用 .md 后缀获取特定页面的 Markdown 格式(例如 https://modelcontextprotocol.io/specification/draft.md)。

需要查阅的关键页面:

  • 规范概述与架构
  • 传输机制(可流式 HTTP、stdio)
  • 工具、资源和提示词的定义

1.3 研究框架文档

推荐技术栈:

  • 语言:TypeScript(良好的 SDK 支持,在多种执行环境中兼容性良好,例如 MCPB。此外,AI 模型擅长生成 TypeScript 代码,得益于其广泛使用、静态类型和良好的 lint 工具。)
  • 传输层:远程服务器使用可流式 HTTP 配合无状态 JSON(相比有状态会话和流式响应,更易于扩展和维护)。本地服务器使用 stdio。

加载框架文档:

针对 TypeScript(推荐):

  • TypeScript SDK:使用 WebFetch 加载 https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md
  • ⚡ TypeScript 指南 - TypeScript 模式与示例

针对 Python:

  • Python SDK:使用 WebFetch 加载 https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md
  • 🐍 Python 指南 - Python 模式与示例

1.4 规划你的实现

理解 API: 查看服务的 API 文档,确定关键端点、认证要求和数据模型。根据需要,使用网络搜索和 WebFetch。

工具选择: 优先考虑全面的 API 覆盖。列出要实现的端点,从最常用的操作开始。


阶段 2:实现

2.1 设置项目结构

查看语言特定指南以了解项目设置:

2.2 实现核心基础设施

创建共享工具:

  • 包含认证的 API 客户端
  • 错误处理辅助函数
  • 响应格式化(JSON/Markdown)
  • 分页支持

2.3 实现工具

对于每个工具:

输入模式:

  • 使用 Zod(TypeScript)或 Pydantic(Python)
  • 包含约束条件和清晰描述
  • 在字段描述中添加示例

输出模式:

  • 在可能的情况下定义 outputSchema 以提供结构化数据
  • 在工具响应中使用 structuredContent(TypeScript SDK 特性)
  • 帮助客户端理解和处理工具输出

工具描述:

  • 功能简介
  • 参数描述
  • 返回类型模式

实现:

  • 使用 async/await 处理 I/O 操作
  • 使用可操作的消息进行正确的错误处理
  • 在适用情况下支持分页
  • 使用现代 SDK 时,同时返回文本内容和结构化数据

注解:

  • readOnlyHint: true/false
  • destructiveHint: true/false
  • idempotentHint: true/false
  • openWorldHint: true/false

阶段 3:审查与测试

3.1 代码质量

审查以下内容:

  • 没有重复代码(DRY 原则)
  • 一致的错误处理
  • 完整的类型覆盖
  • 清晰的工具描述

3.2 构建与测试

TypeScript:

  • 运行 npm run build 验证编译
  • 使用 MCP Inspector 测试:npx @modelcontextprotocol/inspector

Python:

  • 验证语法:python -m py_compile your_server.py
  • 使用 MCP Inspector 测试

有关详细的测试方法和质量检查清单,请参阅语言特定指南。


阶段 4:创建评估

实现 MCP 服务器后,创建全面的评估来测试其有效性。

加载 ✅ 评估指南 以获取完整的评估指南。

4.1 理解评估目的

使用评估来测试 LLM 是否能有效使用你的 MCP 服务器来回答真实、复杂的问题。

4.2 创建 10 个评估问题

要创建有效的评估,请按照评估指南中概述的流程操作:

  1. 工具检查:列出可用工具并理解它们的能力
  2. 内容探索:使用只读操作探索可用数据
  3. 问题生成:创建 10 个复杂、真实的问题
  4. 答案验证:自己解决每个问题以验证答案

4.3 评估要求

确保每个问题:

  • 独立:不依赖于其他问题
  • 只读:仅需非破坏性操作
  • 复杂:需要多次工具调用和深入探索
  • 真实:基于人们关心的真实用例
  • 可验证:具有单一、清晰的答案,可通过字符串比较验证
  • 稳定:答案不会随时间变化

4.4 输出格式

创建一个具有以下结构的 XML 文件:

<evaluation>
  <qa_pair>
    <question>查找关于以动物代号命名的 AI 模型发布的讨论。其中一个模型需要一个特定的安全名称,格式为 ASL-X。以斑点野猫命名的模型正在确定的数字 X 是多少?</question>
    <answer>3</answer>
  </qa_pair>
<!-- 更多 qa_pair... -->
</evaluation>

参考文件

📚 文档库

在开发过程中根据需要加载这些资源:

核心 MCP 文档(先加载)

  • MCP 协议:从 https://modelcontextprotocol.io/sitemap.xml 的站点地图开始,然后使用 .md 后缀获取特定页面
  • 📋 MCP 最佳实践 - 通用 MCP 指南,包括:
    • 服务器和工具命名约定
    • 响应格式指南(JSON vs Markdown)
    • 分页最佳实践
    • 传输层选择(可流式 HTTP vs stdio)
    • 安全和错误处理标准

SDK 文档(在阶段 1/2 加载)

  • Python SDK:从 https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md 获取
  • TypeScript SDK:从 https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md 获取

语言特定实现指南(在阶段 2 加载)

  • 🐍 Python 实现指南 - 完整的 Python/FastMCP 指南,包括:

    • 服务器初始化模式
    • Pydantic 模型示例
    • 使用 @mcp.tool 注册工具
    • 完整的可工作示例
    • 质量检查清单
  • ⚡ TypeScript 实现指南 - 完整的 TypeScript 指南,包括:

    • 项目结构
    • Zod 模式模式
    • 使用 server.registerTool 注册工具
    • 完整的可工作示例
    • 质量检查清单

评估指南(在阶段 4 加载)

  • ✅ 评估指南 - 完整的评估创建指南,包括:
    • 问题创建指南
    • 答案验证策略
    • XML 格式规范
    • 示例问题和答案
    • 使用提供的脚本运行评估

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

aiskillstore/marketplace

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

aiskillstore/marketplace

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

aiskillstore/marketplace

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

aiskillstore/marketplace

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

aiskillstore/marketplace

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

aiskillstore/marketplace

This skill helps users extract GitHub repository project details and contributor contact information using keywords, stars, and update dates. Agent should proactively apply this skill when users express needs like search for GitHub projects by keywords, find top open-source contributors in specific domains, extract developer contacts from GitHub repositories, discover trending repositories with high stars, gather contributor profiles and social links for tech recruiting, retrieve GitHub project descriptions and metrics, build developer communities by finding active contributors, search for repositories updated recently, collect personal website and Twitter links of developers, generate targeted leads for developer tools, or track active open-source contributors for collaboration.

aiskillstore/marketplace

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

aiskillstore/marketplace

Using the Wonda CLI to generate images, videos, music, and audio from the terminal — plus LinkedIn, Reddit, and X/Twitter research and automation

aiskillstore/marketplace

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

aiskillstore/marketplace

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

aiskillstore/marketplace

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

aiskillstore/marketplace

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

aiskillstore/marketplace

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

aiskillstore/marketplace

Router skill for LLMQuant portfolio workflows. Use when the user needs company profiles, thesis tracking, theme research, watchlist monitoring, or alert management.

aiskillstore/marketplace

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

aiskillstore/marketplace

Use for Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs/products and ChatGPT Work. Also use for model choice/migration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat/Work/Codex comparisons. Do not use for generic app/software tasks that merely mention Codex.

aiskillstore/marketplace

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

aiskillstore/marketplace

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

aiskillstore/marketplace

Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.

aiskillstore/marketplace

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

相关技能