mcp-developer by jeffallan/claude-skills
npx skills add https://github.com/jeffallan/claude-skills --skill mcp-developer资深 MCP(模型上下文协议)开发者,在构建连接人工智能系统与外部工具及数据源的服务器和客户端方面拥有深厚专业知识。
npx @modelcontextprotocol/create-server my-server(TypeScript)或 pip install mcp + 脚手架(Python)npx @modelcontextprotocol/inspector 以交互方式验证协议合规性;确认工具出现、模式接受有效输入,并且错误响应是格式良好的 JSON-RPC 2.0。反馈循环: 如果模式验证失败 → 检查 Zod/Pydantic 错误输出 → 修复模式定义 → 重新运行检查器。如果工具调用返回格式错误的响应 → 检查传输序列化 → 修复处理器 → 重新测试。根据上下文加载详细指导:
| 主题 | 参考 | 加载时机 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 协议 | references/protocol.md | 消息类型、生命周期、JSON-RPC 2.0 |
| TypeScript SDK | references/typescript-sdk.md | 在 Node.js 中构建服务器/客户端 |
| Python SDK | references/python-sdk.md | 在 Python 中构建服务器/客户端 |
| 工具 | references/tools.md | 工具定义、模式、执行 |
| 资源 | references/resources.md | 资源提供者、URI、模板 |
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-server", version: "1.1.0" });
// 注册一个带有验证输入模式的工具
server.tool(
"get_weather",
"获取指定位置的当前天气",
{
location: z.string().min(1).describe("城市名称或坐标"),
units: z.enum(["celsius", "fahrenheit"]).default("celsius"),
},
async ({ location, units }) => {
// 实现:调用外部 API,转换响应
const data = await fetchWeather(location, units); // 你的获取逻辑
return {
content: [{ type: "text", text: JSON.stringify(data) }],
};
}
);
// 注册一个资源提供者
server.resource(
"config://app",
"应用程序配置",
async (uri) => ({
contents: [{ uri: uri.href, text: JSON.stringify(getConfig()), mimeType: "application/json" }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field
mcp = FastMCP("my-server")
class WeatherInput(BaseModel):
location: str = Field(..., min_length=1, description="城市名称或坐标")
units: str = Field("celsius", pattern="^(celsius|fahrenheit)$")
@mcp.tool()
async def get_weather(location: str, units: str = "celsius") -> str:
"""获取指定位置的当前天气。"""
data = await fetch_weather(location, units) # 你的获取逻辑
return str(data)
@mcp.resource("config://app")
async def app_config() -> str:
"""将应用程序配置作为资源公开。"""
return json.dumps(get_config())
if __name__ == "__main__":
mcp.run() # 默认使用 stdio 传输
预期的工具调用流程:
Client → { "method": "tools/call", "params": { "name": "get_weather", "arguments": { "location": "Berlin" } } }
Server → { "result": { "content": [{ "type": "text", "text": "{\"temp\": 18, \"units\": \"celsius\"}" }] } }
实现 MCP 功能时,请提供:
每周安装次数
812
代码仓库
GitHub 星标数
7.3K
首次出现
2026年1月20日
安全审计
安装于
opencode676
gemini-cli659
codex643
claude-code636
github-copilot608
cursor597
Senior MCP (Model Context Protocol) developer with deep expertise in building servers and clients that connect AI systems with external tools and data sources.
npx @modelcontextprotocol/create-server my-server (TypeScript) or pip install mcp + scaffold (Python)npx @modelcontextprotocol/inspector to verify protocol compliance interactively; confirm tools appear, schemas accept valid inputs, and error responses are well-formed JSON-RPC 2.0. Feedback loop: if schema validation fails → inspect Zod/Pydantic error output → fix schema definition → re-run inspector. If a tool call returns a malformed response → check transport serialisation → fix handler → re-test.Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Protocol | references/protocol.md | Message types, lifecycle, JSON-RPC 2.0 |
| TypeScript SDK | references/typescript-sdk.md | Building servers/clients in Node.js |
| Python SDK | references/python-sdk.md | Building servers/clients in Python |
| Tools | references/tools.md | Tool definitions, schemas, execution |
| Resources | references/resources.md |
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-server", version: "1.1.0" });
// Register a tool with validated input schema
server.tool(
"get_weather",
"Fetch current weather for a location",
{
location: z.string().min(1).describe("City name or coordinates"),
units: z.enum(["celsius", "fahrenheit"]).default("celsius"),
},
async ({ location, units }) => {
// Implementation: call external API, transform response
const data = await fetchWeather(location, units); // your fetch logic
return {
content: [{ type: "text", text: JSON.stringify(data) }],
};
}
);
// Register a resource provider
server.resource(
"config://app",
"Application configuration",
async (uri) => ({
contents: [{ uri: uri.href, text: JSON.stringify(getConfig()), mimeType: "application/json" }],
})
);
const transport = new StdioServerTransport();
await server.connect(transport);
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field
mcp = FastMCP("my-server")
class WeatherInput(BaseModel):
location: str = Field(..., min_length=1, description="City name or coordinates")
units: str = Field("celsius", pattern="^(celsius|fahrenheit)$")
@mcp.tool()
async def get_weather(location: str, units: str = "celsius") -> str:
"""Fetch current weather for a location."""
data = await fetch_weather(location, units) # your fetch logic
return str(data)
@mcp.resource("config://app")
async def app_config() -> str:
"""Expose application configuration as a resource."""
return json.dumps(get_config())
if __name__ == "__main__":
mcp.run() # defaults to stdio transport
Expected tool call flow:
Client → { "method": "tools/call", "params": { "name": "get_weather", "arguments": { "location": "Berlin" } } }
Server → { "result": { "content": [{ "type": "text", "text": "{\"temp\": 18, \"units\": \"celsius\"}" }] } }
When implementing MCP features, provide:
Weekly Installs
812
Repository
GitHub Stars
7.3K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode676
gemini-cli659
codex643
claude-code636
github-copilot608
cursor597
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
136,300 周安装
| Resource providers, URIs, templates |