mcp2skill
v0.0.1
Published
Generate a ready‑to‑use "SKILL" folder from any MCP server. mcp2skill connects to a Model Context Protocol (MCP) server (stdio or Streamable HTTP), enumerates its tools, and emits a portable skill package containing:
Readme
mcp2skill
Generate a ready‑to‑use "SKILL" folder from any MCP server. mcp2skill connects to a Model Context Protocol (MCP) server (stdio or Streamable HTTP), enumerates its tools, and emits a portable skill package containing:
SKILL.mdwith clear, schema‑first usage guidancetools/*.jsoninput schemas for each toolscripts/call-tool.jshelper to invoke tools by namemcp-config.jsoncapturing how to reconnect to the MCP server
This lets you install and reuse MCP tools as a standalone skill in other agent setups or workflows, without guessing inputs or wiring.
Requirements
- Node.js 18+
Usage
The CLI discovers tools from an MCP server and writes a self‑contained skill directory.
npx mcp2skill \
--skill-name <skill name> \
--mcp-name <mcp server name> \
--transport <http|sse|stdio> \
--out-dir <output root> \
[URL or -- <command> [args...]]Options
--skill-name(required): Name of the skill folder to create.--mcp-name(required): Human‑friendly MCP server name recorded inSKILL.md.--transport(required):stdioorhttp(see note onssebelow).--out-dir(required): Directory where the skill folder is created.--env KEY=VALUE(repeatable, stdio only): Environment variables for the spawned MCP server process.--header 'Key: Value'(repeatable, http/sse only): Placeholder for future header support. See limitations.
Notes
- For
stdio, pass the command after--. You may repeat--env KEY=VALUEto inject environment variables. - For
http, pass exactly one URL positional argument. - The CLI validates argument combinations and will refuse ambiguous inputs.
What gets generated
Given --out-dir ~/.claude/skills and --skill-name my-skill, the CLI writes:
~/.claude/skills/my-skill/
├─ SKILL.md # Usage protocol and checklist
├─ mcp-config.json # How to connect to the MCP server
├─ scripts/
│ └─ call-tool.js # Helper to invoke tools by name
└─ tools/
├─ <toolA>.json # JSON Schema for <toolA> input
└─ <toolB>.json # JSON Schema for <toolB> inputExamples
- Generate a skill from a local stdio server:
npx mcp2skill \
--skill-name local-stdio-skill \
--mcp-name local-stdio \
--transport stdio \
--out-dir ~/.claude/skills \
-- node ./server/example-mcp.js- Generate a skill from a Streamable HTTP server:
npx mcp2skill \
--skill-name http-skill \
--mcp-name http-demo \
--transport http \
--out-dir ~/.claude/skills \
http://localhost:3000/mcpHow it works
- Discovers tools via the MCP client (
@modelcontextprotocol/sdk) using:StdioClientTransportfor local/stdio serversStreamableHTTPClientTransportfor HTTP servers
- Writes
tools/*.jsonfrom each tool’sinputSchema - Emits
SKILL.mdwith a schema‑first protocol and safety checklist - Bundles
scripts/call-tool.jsthat usesmcp-config.jsonto connect and call tools
Known limitations
- SSE: Although the CLI accepts
--transport sse, the current client only connects via stdio or Streamable HTTP. SSE fallback is not implemented. - HTTP headers:
--headeris accepted by the CLI but not yet persisted inmcp-config.jsonor applied by the client transport. If you need auth, prefer stdio or run your MCP server without custom headers for now.
License
mcp2skill is MIT licensed.
