一键导入
mcp-builder
Guide for creating MCP (Model Context Protocol) servers in TypeScript or Python. Use when building MCP servers to integrate external APIs or services.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for creating MCP (Model Context Protocol) servers in TypeScript or Python. Use when building MCP servers to integrate external APIs or services.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Interview the user relentlessly about a plan or design until branch-level decisions are resolved for execution.
Access Figma designs, extract design systems, and retrieve component specifications. Use when implementing UI from Figma mockups, extracting design tokens, or analyzing design files.
Enforce cost-aware MCP usage. Use when a task might trigger heavy external tools, web search, or broad context expansion. Prevents token burn by ensuring MCPs are only used when local context is insufficient.
Navigate the Warmplane mcp0 facade efficiently. Use when the active config exposes provider capabilities through `mcp0_*` tools and you need to discover or call provider tools without brute-force describing large capability sets. Trigger on requests involving mcp0, Warmplane, or provider work through the facade such as Linear, Notion, Figma, New Relic, Context7, grep.app, or Storybook tools.
Use this when the user needs to control Chrome, navigate to a page, inspect a tab, click or fill elements, take screenshots, or automate a browser flow with aeroxy/chrome-devtools-cli.
Guidelines for creating and managing implementation plans with citations
| name | mcp-builder |
| description | Guide for creating MCP (Model Context Protocol) servers in TypeScript or Python. Use when building MCP servers to integrate external APIs or services. |
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. 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.
Actionable Error Messages: Error messages should guide agents toward solutions with specific suggestions and next steps.
Navigate the MCP specification:
Start with the sitemap: 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:
SDK Documentation:
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.mdhttps://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.
Tool Selection: Prioritize comprehensive API coverage. List endpoints to implement, starting with the most common operations.
TypeScript project:
my-mcp-server/
├── src/
│ ├── index.ts # Entry point
│ ├── tools/ # Tool implementations
│ └── utils/ # Shared utilities
├── package.json
├── tsconfig.json
└── README.md
Python project:
my-mcp-server/
├── src/
│ └── my_mcp_server/
│ ├── __init__.py
│ ├── server.py # Entry point
│ ├── tools/ # Tool implementations
│ └── utils/ # Shared utilities
├── pyproject.toml
└── README.md
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 # Verify compilation
npx @modelcontextprotocol/inspector # Test with MCP Inspector
Python:
python -m py_compile your_server.py # Verify syntax
# Test with MCP Inspector
After implementing your MCP server, create comprehensive evaluations to test its effectiveness.
Use evaluations to test whether LLMs can effectively use your MCP server to answer realistic, complex questions.
Process:
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>
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
const server = new McpServer({
name: "my-server",
version: "1.0.0",
});
server.tool(
"list_items",
{
description: "List items with optional filtering",
inputSchema: z.object({
filter: z.string().optional().describe("Filter by name"),
limit: z.number().default(10).describe("Max items to return"),
}),
},
async ({ filter, limit }) => {
const items = await fetchItems(filter, limit);
return {
content: [{ type: "text", text: JSON.stringify(items, null, 2) }],
};
}
);
server.tool("get_item", { /* schema */ }, async ({ id }) => {
try {
const item = await fetchItem(id);
if (!item) {
return {
content: [{ type: "text", text: `Item ${id} not found. Try list_items to see available items.` }],
isError: true,
};
}
return { content: [{ type: "text", text: JSON.stringify(item) }] };
} catch (error) {
return {
content: [{ type: "text", text: `Failed to fetch item: ${error.message}. Check your API key.` }],
isError: true,
};
}
});
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field
mcp = FastMCP("my-server")
class ListItemsInput(BaseModel):
filter: str | None = Field(None, description="Filter by name")
limit: int = Field(10, description="Max items to return")
@mcp.tool()
async def list_items(input: ListItemsInput) -> str:
"""List items with optional filtering."""
items = await fetch_items(input.filter, input.limit)
return json.dumps(items, indent=2)
@mcp.tool()
async def get_item(id: str) -> str:
"""Get item by ID."""
try:
item = await fetch_item(id)
if not item:
raise ValueError(f"Item {id} not found. Try list_items to see available items.")
return json.dumps(item)
except Exception as e:
raise ValueError(f"Failed to fetch item: {e}. Check your API key.")
github-mcp-serverslack-workspace-tools not slackgithub_create_issue, github_list_reposlist_, get_, create_, update_, delete_search_issues_by_label not search