Chuyển đến nội dung
Skillpedia
Trình kết nối (MCP)29k · #9591

mcp-server-builder

Skill này làm gì

Skill này giúp xây dựng một máy chủ MCP, cho phép trợ lý AI dùng một API qua các công cụ rõ ràng. Skill dành cho lập trình viên muốn kết nối một API nội bộ hoặc bên ngoài với trợ lý AI của mình.

Khi nào nên dùng

  • ✓Khi bạn muốn trợ lý AI dùng một REST API có sẵn thông qua các công cụ có kiểu dữ liệu rõ ràng.
  • ✓Khi bạn muốn thay thế tự động hóa trình duyệt dễ hỏng bằng một kết nối đàng hoàng tới dịch vụ.
  • ✓Khi bạn muốn dùng chung một máy chủ MCP cho nhiều nhóm hoặc nhiều trợ lý.

Liên kết skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/mcp-server-builder/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/mcp-server-builder/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Biến đặc tả OpenAPI của công ty chúng tôi thành một máy chủ MCP mà trợ lý của tôi có thể dùng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill đọc mô tả API, tạo định nghĩa công cụ cho từng thao tác, sinh một máy chủ khởi đầu bằng Python hoặc TypeScript và kiểm tra kết quả xem có lỗi thường gặp nào không.

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 Server Builder

Tier: POWERFUL · Category: Engineering · Domain: AI / API Integration

Overview

Use this skill to design and ship production-ready MCP servers from API contracts instead of hand-written one-off tool wrappers. It focuses on fast scaffolding, schema quality, validation, and safe evolution.

The workflow supports both Python and TypeScript MCP implementations and treats OpenAPI as the source of truth.

Core Capabilities

  • Convert OpenAPI paths/operations into MCP tool definitions
  • Generate starter server scaffolds (Python or TypeScript)
  • Enforce naming, descriptions, and schema consistency
  • Validate MCP tool manifests for common production failures
  • Apply versioning and backward-compatibility checks
  • Separate transport/runtime decisions from tool contract design

When to Use

  • You need to expose an internal/external REST API to an LLM agent
  • You are replacing brittle browser automation with typed tools
  • You want one MCP server shared across teams and assistants
  • You need repeatable quality checks before publishing MCP tools
  • You want to bootstrap an MCP server from existing OpenAPI specs

Key Workflows

1. OpenAPI to MCP Scaffold

  1. Start from a valid OpenAPI spec.
  2. Generate tool manifest + starter server code.
  3. Review naming and auth strategy.
  4. Add endpoint-specific runtime logic.
python3 scripts/openapi_to_mcp.py \
  --input openapi.json \
  --server-name billing-mcp \
  --language python \
  --output-dir ./out \
  --format text

Supports stdin as well:

cat openapi.json | python3 scripts/openapi_to_mcp.py --server-name billing-mcp --language typescript

2. Validate MCP Tool Definitions

Run validator before integration tests:

python3 scripts/mcp_validator.py --input out/tool_manifest.json --strict --format text

Checks include duplicate names, invalid schema shape, missing descriptions, empty required fields, and naming hygiene.

3. Runtime Selection

  • Choose Python for fast iteration and data-heavy backends.
  • Choose TypeScript for unified JS stacks and tighter frontend/backend contract reuse.
  • Keep tool contracts stable even if transport/runtime changes.

4. Harden for Production

Key items before publishing:

  • Keep secrets in env vars, not tool schemas
  • Prefer outbound host allowlists over open proxies
  • Use additive-only changes; never rename tool names in-place

Full hardening guidance: references/production-hardening-guide.md.

Script Interfaces

  • python3 scripts/openapi_to_mcp.py --help
    • Reads OpenAPI from stdin or --input
    • Produces manifest + server scaffold
    • Emits JSON summary or text report
  • python3 scripts/mcp_validator.py --help
    • Validates manifests and optional runtime config
    • Returns non-zero exit in strict mode when errors exist

Reference Material

Câu hỏi thường gặp

API cần có gì?

Cần một đặc tả OpenAPI hợp lệ, mô tả các endpoint của API.

Nó có viết được cả máy chủ Python lẫn TypeScript không?

Có, skill hỗ trợ cả hai ngôn ngữ và tạo khung khởi đầu cho cả hai.

Nó có viết hết logic nghiệp vụ không?

Không, bạn vẫn phải thêm logic mà mỗi endpoint cần sau khi code khởi đầu được tạo.

Chi tiết

Mô tả gốc của tác giả

Use when exposing an API as an MCP server or scaffolding a new MCP server in Python or TypeScript, before hand-writing tool wrappers. Generates tools from OpenAPI with openapi_to_mcp.py and validates them with mcp_validator.py.

repo: alirezarezvani/claude-skills

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9591
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự