i18n/zh-TW/mcp-builder/SKILL.md
建立高質量 MCP (Model Context Protocol) 伺服器的指南,使 LLM 能透過精心設計的工具與外部服務互動。當需要建構 MCP 伺服器以整合外部 API 或服務時使用,無論是使用 Python (FastMCP) 或 Node/TypeScript (MCP SDK)。
npx skillsauth add tai-ch0802/skills-bundle mcp-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
建立 MCP (Model Context Protocol) 伺服器,使 LLM 能透過精心設計的工具與外部服務互動。MCP 伺服器的品質取決於它如何良好地幫助 LLM 完成真實世界的任務。
建立高質量的 MCP 伺服器包含四個主要階段:
API 覆蓋率 vs. 工作流程工具: 在全面的 API 端點覆蓋率和專門的工作流程工具之間取得平衡。工作流程工具對於特定任務可能更方便,而全面的覆蓋則讓代理程式有靈活性來組合操作。不同客戶端的效能各異 — 有些客戶端受益於結合基本工具的程式碼執行,而其他則在更高階的工作流程中表現更好。若不確定,請優先考慮全面的 API 覆蓋率。
工具命名與可發現性:
清晰、具描述性的工具名稱有助於代理程式快速找到正確的工具。使用一致的前綴(例如:github_create_issue、github_list_repos)和任務導向的命名。
上下文管理: 代理程式受益於簡潔的工具描述以及過濾/分頁結果的能力。設計能返回聚焦、相關資料的工具。有些客戶端支援程式碼執行,這可幫助代理程式有效率地過濾和處理資料。
可執行的錯誤訊息: 錯誤訊息應透過具體的建議和後續步驟引導代理程式解決問題。
瀏覽 MCP 規格:
從網站地圖開始尋找相關頁面:https://modelcontextprotocol.io/sitemap.xml
然後透過 .md 後綴取得特定頁面的 markdown 格式(例如: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 覆蓋率。列出要實作的端點,從最常見的操作開始。
請參閱特定語言的專案設定指南:
建立共用工具程式:
針對每個工具:
輸入 Schema:
輸出 Schema:
outputSchemastructuredContent (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>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>
<!-- 更多 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 註冊工具development
Unified testing skill — TDD workflow, unit/integration patterns, E2E/Playwright strategies. Replaces tdd-workflow + testing-patterns + webapp-testing.
testing
Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
Spec-Driven Development (SDD): A structured workflow (Requirement -> Analysis -> Implementation) enforcing explicit documentation before coding.
development
Methodologies for System Analysis (SA), focusing on technical architecture, data flow modeling, and API design.