npx skills add https://github.com/agilkannan/skills --skill mcp-builder创建 MCP(模型上下文协议)服务器,使 LLM 能够通过精心设计的工具与外部服务交互。MCP 服务器的质量取决于它能在多大程度上帮助 LLM 完成现实世界的任务。
创建一个高质量的 MCP 服务器涉及四个主要阶段:
API 覆盖度与工作流工具: 在全面的 API 端点覆盖和专门的工作流工具之间取得平衡。工作流工具对于特定任务可能更方便,而全面的覆盖则赋予智能体组合操作的灵活性。性能因客户端而异——有些客户端受益于组合基本工具的代码执行,而另一些则更适合使用更高层级的工作流。当不确定时,优先考虑全面的 API 覆盖。
工具命名与可发现性: 清晰、描述性的工具名称有助于智能体快速找到合适的工具。使用一致的前缀(例如 github_create_issue、github_list_repos)和面向操作的命名。
上下文管理: 智能体受益于简洁的工具描述以及过滤/分页结果的能力。设计能返回重点、相关数据的工具。一些客户端支持代码执行,这可以帮助智能体高效地过滤和处理数据。
可操作的错误消息: 错误消息应通过具体的建议和后续步骤指导智能体找到解决方案。
浏览 MCP 规范:
从站点地图开始查找相关页面:https://modelcontextprotocol.io/sitemap.xml
然后获取带有 .md 后缀的特定页面以获取 Markdown 格式(例如 )。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
https://modelcontextprotocol.io/specification/draft.md需要审阅的关键页面:
推荐的技术栈:
加载框架文档:
对于 TypeScript(推荐):
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md对于 Python:
https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md理解 API: 查阅服务的 API 文档,识别关键端点、身份验证要求和数据模型。根据需要使用网络搜索和 WebFetch。
工具选择: 优先考虑全面的 API 覆盖。列出要实现的端点,从最常见的操作开始。
请参阅特定语言的指南以了解项目设置:
创建共享工具:
对于每个工具:
输入模式:
输出模式:
outputSchema 以获取结构化数据structuredContent(TypeScript SDK 特性)工具描述:
实现:
注解:
readOnlyHint: true/falsedestructiveHint: true/falseidempotentHint: true/falseopenWorldHint: true/false审查以下方面:
TypeScript:
npm run build 以验证编译npx @modelcontextprotocol/inspectorPython:
python -m py_compile your_server.py有关详细的测试方法和质量检查清单,请参阅特定语言的指南。
实现 MCP 服务器后,创建全面的评估以测试其有效性。
加载✅ 评估指南 以获取完整的评估指南。
使用评估来测试 LLM 是否能有效地使用你的 MCP 服务器来回答现实、复杂的问题。
要创建有效的评估,请遵循评估指南中概述的流程:
确保每个问题:
创建一个具有以下结构的 XML 文件:
<evaluation>
<qa_pair>
<question>查找关于使用动物代号命名的 AI 模型发布的讨论。其中一个模型需要一个特定格式为 ASL-X 的安全等级。对于那个以斑点野猫命名的模型,需要确定的数字 X 是多少?</question>
<answer>3</answer>
</qa_pair>
<!-- 更多 qa_pairs... -->
</evaluation>
在开发过程中根据需要加载这些资源:
https://modelcontextprotocol.io/sitemap.xml,然后获取带有 .md 后缀的特定页面https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md 获取https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md 获取🐍 Python 实现指南 - 完整的 Python/FastMCP 指南,包含:
@mcp.tool 注册工具⚡ TypeScript 实现指南 - 完整的 TypeScript 指南,包含:
server.registerTool 注册工具每周安装次数
1
代码仓库
GitHub 星标数
2
首次出现
1 天前
安全审计
已安装在
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.
Creating a high-quality MCP server involves four main phases:
API Coverage vs. Workflow Tools: Balance comprehensive API endpoint coverage with specialized workflow tools. Workflow tools can be more convenient for specific tasks, while comprehensive coverage gives agents flexibility to compose operations. Performance varies by client—some clients benefit from code execution that combines basic tools, while others work better with higher-level workflows. When uncertain, prioritize comprehensive API coverage.
Tool Naming and Discoverability: Clear, descriptive tool names help agents find the right tools quickly. Use consistent prefixes (e.g., github_create_issue, github_list_repos) and action-oriented naming.
Context Management: Agents benefit from concise tool descriptions and the ability to filter/paginate results. Design tools that return focused, relevant data. Some clients support code execution which can help agents filter and process data efficiently.
Actionable Error Messages: Error messages should guide agents toward solutions with specific suggestions and next steps.
Navigate the MCP specification:
Start with the sitemap to find relevant pages: https://modelcontextprotocol.io/sitemap.xml
Then fetch specific pages with .md suffix for markdown format (e.g., https://modelcontextprotocol.io/specification/draft.md).
Key pages to review:
Recommended stack:
Load framework documentation:
For TypeScript (recommended):
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.mdFor Python:
https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.mdUnderstand the API: Review the service's API documentation to identify key endpoints, authentication requirements, and data models. Use web search and WebFetch as needed.
Tool Selection: Prioritize comprehensive API coverage. List endpoints to implement, starting with the most common operations.
See language-specific guides for project setup:
Create shared utilities:
For each tool:
Input Schema:
Output Schema:
outputSchema where possible for structured datastructuredContent in tool responses (TypeScript SDK feature)Tool Description:
Implementation:
Annotations:
readOnlyHint: true/falsedestructiveHint: true/falseidempotentHint: true/falseopenWorldHint: true/falseReview for:
TypeScript:
npm run build to verify compilationnpx @modelcontextprotocol/inspectorPython:
python -m py_compile your_server.pySee language-specific guides for detailed testing approaches and quality checklists.
After implementing your MCP server, create comprehensive evaluations to test its effectiveness.
Load✅ Evaluation Guide for complete evaluation guidelines.
Use evaluations to test whether LLMs can effectively use your MCP server to answer realistic, complex questions.
To create effective evaluations, follow the process outlined in the evaluation guide:
Ensure each question is:
Create an XML file with this structure:
<evaluation>
<qa_pair>
<question>Find discussions about AI model launches with animal codenames. One model needed a specific safety designation that uses the format ASL-X. What number X was being determined for the model named after a spotted wild cat?</question>
<answer>3</answer>
</qa_pair>
<!-- More qa_pairs... -->
</evaluation>
Load these resources as needed during development:
https://modelcontextprotocol.io/sitemap.xml, then fetch specific pages with .md suffixhttps://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.mdhttps://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md🐍 Python Implementation Guide - Complete Python/FastMCP guide with:
@mcp.tool⚡ TypeScript Implementation Guide - Complete TypeScript guide with:
server.registerToolWeekly Installs
1
Repository
GitHub Stars
2
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
45,700 周安装
SQL性能优化助手 - 专业SQL查询调优与索引策略优化工具
8,600 周安装
Vue Router 最佳实践指南:导航守卫、路由生命周期与常见陷阱解决方案
9,200 周安装
后台代理状态通知 - 避免轮询浪费,高效处理AI代理进度更新
205 周安装
网站设计审查工具 - 自动检测并修复HTML/CSS/JS、React、Vue等框架的视觉与布局问题
8,900 周安装
.NET/C# 最佳实践指南:代码规范、设计模式、依赖注入与AI集成
8,900 周安装
Playwright MCP 测试生成工具 - 自动生成 TypeScript 端到端测试代码
9,000 周安装