mcp-converter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MCP-to-Skill Converter

MCP-to-Skill 转换器

Installation

安装

The skill invokes
.claude/tools/integrations/mcp-converter/batch_converter.py
. Requirements:
  • Python 3.10+: python.org or
    winget install Python.Python.3.12
    (Windows),
    brew install python@3.12
    (macOS).
  • pip: Usually included with Python; verify with
    pip --version
    .
  • Dependencies: From the repo root, install deps for the integration (e.g. PyYAML if required):
    bash
    pip install pyyaml
    Run from project root; the script uses
    .claude/tools/integrations/mcp-converter/
    (catalog:
    mcp-catalog.yaml
    ).
该Skill调用
.claude/tools/integrations/mcp-converter/batch_converter.py
。要求如下:
  • Python 3.10+:可从python.org下载,或使用
    winget install Python.Python.3.12
    (Windows)、
    brew install python@3.12
    (macOS)安装。
  • pip:通常随Python一同安装;可通过
    pip --version
    验证是否安装。
  • 依赖项:从仓库根目录安装集成所需的依赖(例如若需要PyYAML):
    bash
    pip install pyyaml
    从项目根目录运行脚本;该脚本会使用
    .claude/tools/integrations/mcp-converter/
    目录下的内容(目录文件:
    mcp-catalog.yaml
    )。

Cheat Sheet & Best Practices

速查表与最佳实践

MCP design: Single responsibility per server; bounded toolsets; contracts first (strict I/O schemas); stateless by default; additive changes; security (identity, auth, audit). Prefer stdio for local, Streamable HTTP for remote; use a gateway for multi-tenant/centralized policy.
Conversion: Introspect server; estimate token usage of tool schemas; generate skill with progressive disclosure. Test converted skills before relying on them. Use catalog + batch_converter for rules-driven conversion.
Hacks: Focus on high-token or high-value servers first. Keep generated SKILL.md and wrappers in version control. Use
mcp-catalog.yaml
to mark
keep_as_mcp
or auto-convert thresholds.
MCP设计原则:每个服务器单一职责;有限工具集;优先契约(严格的I/O schema);默认无状态;增量式变更;安全性(身份、认证、审计)。本地环境优先使用标准输入输出(stdio),远程环境优先使用可流式传输的HTTP;多租户/集中式策略场景使用网关。
转换流程:自省服务器;估算工具schema的Token使用量;生成具备渐进式披露功能的Skill。在依赖转换后的Skill前先进行测试。使用目录文件+batch_converter进行规则驱动的转换。
技巧:优先处理高Token消耗或高价值的服务器。将生成的SKILL.md和包装器纳入版本控制。使用
mcp-catalog.yaml
标记
keep_as_mcp
或设置自动转换阈值。

Certifications & Training

认证与培训

MCP: MCP Best Practices, modelcontextprotocol.info. Skill data: Single responsibility, bounded tools, contracts first, stateless; stdio vs HTTP; gateway pattern; introspect → generate skill.
MCP相关MCP最佳实践modelcontextprotocol.infoSkill相关要点:单一职责、有限工具、优先契约、无状态;stdio与HTTP对比;网关模式;自省→生成Skill。

Hooks & Workflows

钩子与工作流

Suggested hooks: Post–MCP config change: optional batch_converter run to refresh skills. Use with evolution-orchestrator (add mcp-converter to secondary) when creating skills from MCP servers.
Workflows: Use with evolution-orchestrator. Flow: list servers → convert server or batch → test converted skill. See
creators/skill-creator-workflow.yaml
; mcp-converter feeds skill-creator input.
建议钩子:MCP配置变更后:可选运行batch_converter来刷新Skills。在从MCP服务器创建Skills时,与evolution-orchestrator配合使用(将mcp-converter添加为次要组件)。
工作流:与evolution-orchestrator配合使用。流程:列出服务器→转换单个或批量服务器→测试转换后的Skill。详见
creators/skill-creator-workflow.yaml
;mcp-converter为skill-creator提供输入。

🚀 Usage

🚀 使用方法

1. List Available MCP Servers

1. 列出可用的MCP服务器

See which servers are configured in your
.mcp.json
:
bash
python .claude/tools/mcp-converter/mcp_analyzer.py --list
查看
.mcp.json
中配置的服务器:
bash
python .claude/tools/mcp-converter/mcp_analyzer.py --list

2. Convert a Server

2. 转换单个服务器

Convert a specific MCP server to a Skill:
bash
python .claude/tools/mcp-converter/mcp_analyzer.py --server <server_name>
将指定的MCP服务器转换为Skill:
bash
python .claude/tools/mcp-converter/mcp_analyzer.py --server <server_name>

3. Batch Conversion (Catalog)

3. 批量转换(基于目录)

Convert multiple servers based on rules:
bash
python .claude/tools/mcp-converter/batch_converter.py
根据规则转换多个服务器:
bash
python .claude/tools/mcp-converter/batch_converter.py

ℹ️ How it Works

ℹ️ 工作原理

  1. Introspect: Connects to the running MCP server.
  2. Analyze: Estimates token usage of tool schemas.
  3. Generate: Creates a
    SKILL.md
    wrapper that creates dynamic tool calls only when needed.
  1. 自省:连接到运行中的MCP服务器。
  2. 分析:估算工具schema的Token使用量。
  3. 生成:创建
    SKILL.md
    包装器,仅在需要时生成动态工具调用。

🔧 Dependencies

🔧 依赖项

Requires
mcp
python package:
bash
pip install mcp
需要安装
mcp
Python包:
bash
pip install mcp

Memory Protocol (MANDATORY)

内存协议(强制要求)

Before starting: Read
.claude/context/memory/learnings.md
After completing:
  • New pattern ->
    .claude/context/memory/learnings.md
  • Issue found ->
    .claude/context/memory/issues.md
  • Decision made ->
    .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前: 阅读
.claude/context/memory/learnings.md
完成后
  • 新模式 → 写入
    .claude/context/memory/learnings.md
  • 发现问题 → 写入
    .claude/context/memory/issues.md
  • 做出的决策 → 写入
    .claude/context/memory/decisions.md
假设会被中断:如果未记录到内存中,就视为未发生。