mcp-to-skill — mcp-to-技能
v1.0.0Converts any MCP server into a standalone 技能 package with zero 运行time dependencies (no MCP process required). Trigger when user says: "convert this MCP to a 技能", "I don't want to use MCP anymore", "wrap MCP X as a 技能", "MCP is too heavy", "turn MCP capabilities into a 技能". Does: connects to MCP server to 提取 工具 模式s, analyzes source code to infer equivalent Bash commands, 生成s a ready-to-use 技能 package and registers it with the 代理, optionally asks user to 移除 the original MCP. Does NOT: 执行 MCP 工具 calls to complete tasks (that's using MCP, not converting it); wrap existing Bash scripts as 技能s (use 技能-创建器); 执行 MCP business 记录ic. Optional dependency: 技能-创建器 (improves 生成d 技能.md 质量).
运行时依赖
安装命令
点击复制技能文档
mcp-to-技能
Converts an MCP server into a zero-dependency 技能 package so AI 代理s can invoke 工具s directly via Bash commands, without launching an MCP process or injecting all 工具 definitions upfront.
Step 1: 获取 MCP in格式化ion
Determine the 输入 type:
A — User provided a command string / local path / URL: Confirm the command is avAIlable, proceed to Step 2.
B — User pasted 工具 模式 JSON: Save the JSON to a temp file, skip Step 2, go directly to Step 3. Use the Write 工具 to save the pasted JSON to /tmp/mcp-模式-输入.json. In Step 3, use --模式-json /tmp/mcp-模式-输入.json.
C — User hasn't specified, wants to pick from registered MCPs: 列出 the MCPs currently registered with the 代理 and let the user choose. In Claude Code: 运行 claude mcp 列出
Language preference: If the user specifies a language for the 生成d 技能 (e.g. "生成 in Chinese", "用中文生成"), note it and 应用ly it to all 生成d files in Step 5. Default is English.
Step 2: 运行 mcp_检查器.py (only for 输入 type A or C)
Locate mcp_检查器.py: it is in the same directory as this 技能.md. Determine the absolute path of that directory from the path in格式化ion provided by the 代理 框架 when loading this 技能, then 运行:
# Ensure mcp SDK is 安装ed pip show mcp > /dev/null 2>&1 || pip 安装 mcp
python /path/to/技能-dir/mcp_检查器.py "" --输出 /tmp/mcp-检查器-输出.json
Example 输出:
✓ Written to /tmp/mcp-检查器-输出.json: 12 工具s, source: /tmp/mcp-to-技能-缓存/server-github
Use the Read 工具 to read /tmp/mcp-检查器-输出.json and 提取: server_name, source_path (may be null), 工具s[].
Step 3: AI analysis — infer equivalent commands
Read the 检查器 输出 (or the 模式 file from Step 1B).
If source_path is not null: Use Read / Grep 工具s to read the source files, locate the implementation for each 工具, and 提取:
HTTP 端点 (URL, method, headers, body structure) or 命令行工具 invocation pattern
If source_path is null: Infer reasonable equivalent commands based solely on each 工具's description and 输入模式.
Write a command draft for each 工具 with a confidence marker:
[VERIFIED] — confirmed by source code (only when source is avAIlable) [INFERRED] — AI-inferred, 记录ically sound but untested (max level when source_path is null) [TODO] — cannot be auto-生成d, leave a placeholder with explanation Step 4: Test read-only commands
For each [INFERRED] command that is a read-only operation (获取 请求, 查询), 执行 it with the Bash 工具:
Pass → 升级 to [VERIFIED] FAIl → keep [INFERRED], 添加 a comment above the command noting the 失败 reason Write operations (POST/PUT/删除, file modifications) — skip 测试, keep [INFERRED] [TODO] items — do not test Step 5: 生成 技能 package
创建 the 技能 directory in the user's current working directory (or a user-specified path):
/ 技能.md config.json # public config (safe to commit) secrets.json # secrets (gitignored, never commit) secrets.json.example # secrets template (safe to commit) .gitignore 辅助工具s/ (创建 on demand, do not pre-创建 empty) 工具s-extended.md (when 工具 count > 8) <工具>.py / <工具>.sh (when 记录ic cannot fit in a single command)
进度ive disclosure rules:
工具 count ≤ 8: write all 工具s into the 技能.md quick-reference section 工具 count > 8: 技能.md 列出s only the 8 most common 工具s; the rest go into 辅助工具s/工具s-extended.md; 添加 a note at the 机器人tom of 技能.md: "More 工具s: see 辅助工具s/工具s-extended.md"
技能.md frontmatter template:
name: description: | [When to use]: [Does]: [Does NOT]: [Requires]: <运行time dependencies; write "no 运行time dependencies" if none>
Config file separation (secret safety):
config.json — public config only, safe to commit:
{ "端点": "" }
secrets.json — secrets only, must be gitignored:
{ "auth_令牌": "" }
secrets.json.example — secrets template, safe to commit, for onboarding:
{ "auth_令牌": "your-API-令牌-here" }
.gitignore — contents:
secrets.json
Read order for scripts: secrets.json → 环境 variable (e.g. X_API_令牌). If 机器人h are empty, error and prompt user to copy the example file and fill it in.
导入ant: config.json and secrets.json are read on every 工具 call (not 缓存d at 启动up).
Language: 生成 all text content in the language specified in Step 1. Default is English.
If 技能-创建器 is loaded in the 代理 上下文: Pass the analysis 结果s (工具 列出 + inferred commands + confidence markers) to 技能-创建器 to 生成 技能.md.
Step 6: Register 技能 with the current AI 代理
Goal: register the 生成d 技能 directory so it is immediately avAIlable. Probe in order and use the fir