A CLI tool that converts Model Context Protocol (MCP) servers into agent skills. It automatically generates SKILL.md and tool references from MCP server metadata, and provides a CLI tool to interact with the MCP server.
curl -sSL https://raw.githubusercontent.com/fenwei-dev/mcp2skill/main/install.sh | bashTo uninstall: rm ~/.local/bin/mcp2skill
- Download the binary
mcp2skill_windows_{arch}.tar.gzfrom GitHub Releases: - Extract the archive and add
mcp2skill.exeto your PATH.
go install github.com/fenwei-dev/mcp2skill/cmd/mcp2skill@latestgit clone https://github.com/fenwei-dev/mcp2skill.git
cd mcp2skill
go build ./cmd/mcp2skillThe compiled binary will be ./mcp2skill.
- Configure your MCP servers in
~/.mcp2skill/config.json:
{
"mcp": {
"fetch": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/fetch"
]
},
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer {github_pat}"
}
}
}
}- Generate a skill package:
mcp2skill generate-skill --server github --output ~/.claude/skills- Use the generated skill in your coding agents:
The tool looks for configuration in the following order (project overrides global):
- Custom config: Path specified via
--configflag - Project config:
.mcp2skill/config.jsonin current directory or any parent - Global config:
~/.mcp2skill/config.json
{
"mcp": {
"server-name": {
"type": "stdio|http",
// For stdio transport:
"command": "path/to/executable",
"args": ["arg1", "arg2"],
"env": {
"VAR_NAME": "value"
},
// For http transport:
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer token"
}
}
}
}For MCP servers that communicate via standard input/output.
{
"type": "stdio",
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {
"FETCH_API_KEY": "sk-..."
}
}For MCP servers accessible via HTTP/S.
{
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ghp_..."
}
}Not yet implemented.
See docs/commands.md for detailed command documentation.
my-skill/
├── SKILL.md # Main skill documentation with frontmatter
├── references/
│ ├── TOOLS.md # Generated tool reference (if applicable)
│ └── RESOURCES.md # Generated resource reference (if applicable)
└── bin/
└── mcp2skill # Embedded binary (if applicable)
The generated SKILL.md follows the Agent Skills specification with standard frontmatter:
---
name: my-server
description: Provides access to My MCP Server (v1.0.0) MCP server with tools: tool1, tool2. Use when the user requests My MCP Server functionality.
---
# My MCP Server
This skill provides access to the My MCP Server MCP server.
## MCP Server Info
- **MCP Server:** my-server
- **Server Version:** 1.0.0
- **Server Title:** My MCP Server Title
- **Protocol Version:** 2024-11-05
## Available Tools
This skill provides the following tools:
- **tool1**: Description of tool1
- **tool2**: Description of tool2
## Usage
This skill is automatically invoked when tools from this MCP server are required.
For detailed documentation on each tool's parameters and usage, see [TOOLS.md](references/TOOLS.md).# Configure
cat > ~/.mcp2skill/config.json <<'EOF'
{
"mcp": {
"fetch": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {
"TAVILY_API_KEY": "your-key"
}
}
}
}
EOF
# Generate
mcp2skill generate-skill --server fetch --output ./skills/fetch# Configure
cat > ~/.mcp2skill/config.json <<'EOF'
{
"mcp": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ghp_..."
}
}
}
}
EOF
# Generate
mcp2skill generate-skill --server github --output ./skills/github# Check for updates
mcp2skill update-skill --skill ./skills/fetch
# Review changes in ./skills/fetch/update/
# Apply if satisfied
mcp2skill update-skill --skill ./skills/fetch --confirmmcp2skill generate-skill --server fetch --output ./skills/fetch --no-embedThis generates a skill that references your globally installed mcp2skill binary instead of embedding it.
mcp2skill/
├── cmd/
│ └── mcp2skill/ # Main CLI entry point
├── internal/
│ ├── cliapp/ # CLI command implementations
│ ├── config/ # Configuration management
│ ├── mcp/ # MCP client wrapper
│ └── skill/ # Skill generation logic
├── go.mod
└── README.md
# Standard build
go build ./cmd/mcp2skill
# Static binary for distribution
CGO_ENABLED=0 go build -ldflags="-s -w" ./cmd/mcp2skill# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific package tests
go test ./internal/config
go test ./internal/mcp
go test ./internal/cliappEnsure your MCP server is defined in your config file at one of these locations:
~/.mcp2skill/config.json(global).mcp2skill/config.jsonin your project directory- Path specified via
--configflag
Common causes:
- Incorrect command path for stdio transport
- Missing required environment variables
- Invalid URL or headers for http transport
- Network connectivity issues (for http)
Use --verbose flag for more detailed error messages:
mcp2skill generate-skill --server my-server --verboseThe target directory already contains files. Use --force to overwrite:
mcp2skill generate-skill --server my-server --output ./skills/my-server --forceIf update-skill reports "No updates available", the skill is already synchronized with the MCP server's current state.
This indicates a previous update was started but not completed. Either:
- Run with
--confirmto apply the pending updates - Run with
--discardto cancel them and start fresh
See LICENSE for details.
