mcp-developer
Skill này làm gì
Skill hướng dẫn agent AI xây máy chủ và client Model Context Protocol để liên kết hệ thống AI với công cụ và nguồn dữ liệu. Skill dành cho lập trình viên muốn ứng dụng AI của họ dùng các dịch vụ bên ngoài.
Khi nào nên dùng
- ✓Khi bạn muốn xây một máy chủ MCP cho công cụ AI truy cập dữ liệu của bạn.
- ✓Khi một máy chủ MCP không vượt qua kiểm tra giao thức hoặc trả về phản hồi sai định dạng.
- ✓Khi bạn cần thiết lập transport stdio, HTTP hoặc SSE cho máy chủ MCP.
Liên kết skill
https://github.com/Jeffallan/claude-skills/blob/main/skills/mcp-developer/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xây một máy chủ MCP để trợ lý AI của tôi tra cứu đơn hàng từ cơ sở dữ liệu của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent khởi tạo dự án bằng SDK TypeScript hoặc Python, định nghĩa schema công cụ bằng Zod hoặc Pydantic, rồi đăng ký các handler. Sau đó nó kiểm thử máy chủ bằng MCP inspector.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
MCP Developer
Senior MCP (Model Context Protocol) developer with deep expertise in building servers and clients that connect AI systems with external tools and data sources.
Core Workflow
- Analyze requirements — Identify data sources, tools needed, and client apps
- Initialize project —
npx @modelcontextprotocol/create-server my-server(TypeScript) orpip install mcp+ scaffold (Python) - Design protocol — Define resource URIs, tool schemas (Zod/Pydantic), and prompt templates
- Implement — Register tools and resource handlers; configure transport (stdio/SSE/HTTP)
- Test — Run
npx @modelcontextprotocol/inspectorto 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. - Deploy — Package, add auth/rate-limiting, configure env vars, monitor
Reference Guide
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 |
Resource providers, URIs, templates |
Minimal Working Example
TypeScript — Tool with Zod Validation
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);
Python — Tool with Pydantic Validation
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\"}" }] } }
Constraints
MUST DO
- Implement JSON-RPC 2.0 protocol correctly
- Validate all inputs with schemas (Zod/Pydantic)
- Use proper transport mechanisms (stdio/HTTP/SSE)
- Implement comprehensive error handling
- Add authentication and authorization
- Log protocol messages for debugging
- Test protocol compliance thoroughly
- Document server capabilities
MUST NOT DO
- Skip input validation on tool inputs
- Expose sensitive data in resource content
- Ignore protocol version compatibility
- Mix synchronous code with async transports
- Hardcode credentials or secrets
- Return unstructured errors to clients
- Deploy
Câu hỏi thường gặp
Nó dùng những SDK nào?
Nó dùng SDK MCP cho TypeScript và Python.
Làm sao kiểm thử máy chủ MCP?
Nó chạy MCP inspector để xác nhận các công cụ hiển thị, schema chấp nhận đầu vào hợp lệ và lỗi được trả về đúng.
Nó hỗ trợ những transport nào?
Nó hỗ trợ transport stdio, HTTP và SSE.
Chi tiết
Mô tả gốc của tác giả
Use when building, debugging, or extending MCP servers or clients that connect AI systems with external tools and data sources. Invoke to implement tool handlers, configure resource providers, set up stdio/HTTP/SSE transport layers, validate schemas with Zod or Pydantic, debug protocol compliance issues, or scaffold complete MCP server/client projects using TypeScript or Python SDKs.
repo: Jeffallan/claude-skills
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11436
- Giấy phép
- MIT
- Cập nhật
- 30/10/2026
Bình luận
- …
Thêm skill từ kho mã này
angular-architect
12kGiúp agent của bạn xây ứng dụng Angular 17 trở lên với standalone component, định tuyến lazy-loaded, state NgRx, mẫu RxJS và tinh chỉnh hiệu năng.
api-designer
12kGiúp agent của bạn thiết kế API REST hoặc GraphQL và viết đặc tả OpenAPI 3.1, với quy tắc cho tài nguyên, phân trang, định dạng lỗi và phiên bản.
architecture-designer
12kGiúp agent của bạn thiết kế kiến trúc hệ thống, so sánh các mẫu và công nghệ, và viết Architecture Decision Record giải thích từng lựa chọn.
atlassian-mcp
12kGiúp agent của bạn tìm kiếm và cập nhật issue Jira cùng trang Confluence qua MCP, gồm truy vấn JQL và CQL, sprint và đồng bộ tài liệu.
Skill tương tự
mcporter
394kGiúp agent của bạn liệt kê, gọi và kiểm tra các máy chủ MCP cùng công cụ của chúng qua HTTP hoặc stdio, và quản lý cài đặt đăng nhập.
fastmcp
260kGiúp bạn xây dựng, kiểm thử và triển khai một máy chủ MCP bằng Python, cấp cho trợ lý AI quyền truy cập API, cơ sở dữ liệu hoặc file của bạn dưới dạng công cụ.
mcp-oauth-remote-gateway
260kHướng dẫn bạn đăng nhập OAuth cho máy chủ MCP từ xa khi Hermes chạy trên máy chủ, nơi đăng nhập bằng trình duyệt thông thường không thể truy cập được.