git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/mcp-to-skill" ~/.claude/skills/majiayu000-claude-skill-registry-data-mcp-to-skill && rm -rf "$T"
data/mcp-to-skill/SKILL.mdname: mcp-to-skill description: Convert any MCP server into a Claude Skill with 90% context savings. Use this skill when converting an MCP server to a skill to reduce context usage and improve performance. version: 1.0.0
MCP to Skill Converter
Convert any MCP (Model Context Protocol) server into a Claude Skill using the progressive disclosure pattern for significant context savings and improved performance.
Context Efficiency Benefits
Traditional MCP approach:
- All tools loaded at startup (10-50k tokens for 20+ tools)
- Context available: 85% of total
Skill approach:
- Metadata only: ~100 tokens at startup
- Full instructions (when used): ~5k tokens
- Tool execution: 0 tokens (runs externally)
- Context available: 96.5% of total
When to Use This Skill
Use this converter when:
- Working with 10+ MCP tools
- Context space is tight
- Most tools are not used in each conversation
- Tools are independent
Stick with direct MCP when:
- Working with 1-5 tools
- Complex OAuth flows are required
- Persistent connections are needed
- Cross-platform compatibility is critical
How It Works
Apply the "progressive disclosure" pattern:
- Read the MCP server configuration
- Generate a Skill structure with:
- SKILL.md - Instructions for Claude
- executor.py - Handles MCP calls dynamically
- Config files
- Load metadata only (~100 tokens)
- Load full instructions when the skill is needed
- Run MCP tools through executor outside context
Usage Pattern
Step 1: Create MCP Configuration
Create a JSON configuration file for your MCP server:
{ "name": "server-name", "description": "Server description", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-name"], "env": {"ENV_VAR": "value"} }
Step 2: Convert to Skill
Execute the converter script:
cd $SKILL_DIR python scripts/convert_mcp_to_skill.py --mcp-config path/to/config.json --output-dir ./output-dir
Step 3: Install Dependencies
cd ./output-dir uv pip install mcp
Step 4: Install the Skill
cp -r ./output-dir ~/.claude/skills/skill-name
Available Scripts
convert_mcp_to_skill.py
Transform MCP configurations into skills using this main converter script.
Usage:
python scripts/convert_mcp_to_skill.py --mcp-config CONFIG_FILE --output-dir OUTPUT_DIR
Parameters:
: Path to MCP server configuration JSON file--mcp-config
: Directory where the generated skill will be created--output-dir
Example MCP Configurations
Reference
assets/examples/ for sample MCP configurations:
- GitHub MCP server
- Slack MCP server
- Filesystem MCP server
- Postgres MCP server
Generated Skill Structure
Generated skills follow this structure:
skill-name/ ├── SKILL.md (instructions for Claude) ├── executor.py (handles MCP communication) ├── mcp-config.json (MCP server configuration) └── package.json (dependencies)
Testing Generated Skills
Test generated skills after conversion:
cd skill-directory # List tools python executor.py --list # Describe a tool python executor.py --describe tool_name # Call a tool python executor.py --call '{"tool": "tool_name", "arguments": {...}}'
Troubleshooting
"mcp package not found"
Install the mcp package:
uv pip install mcp
"MCP server not responding"
Verify the config file:
- Command is correct
- Environment variables are set
- Server is accessible
"TypeError: object _AsyncGeneratorContextManager can't be used in 'await' expression"
This error has been fixed in recent versions. The issue occurred with improper async context manager handling.
Solution: Ensure you're using the latest version of the converter:
cd mcp-to-skill python scripts/convert_mcp_to_skill.py --mcp-config your-config.json --output-dir ./your-skill
For technical details about this fix, see
references/async_context_manager_fix.md.
Requirements
- Python 3.8+
- mcp package (install with
)uv pip install mcp
References
Reference these files for additional information:
- MCP protocol fundamentalsreferences/mcp_basics.md
- Technical details about the converterreferences/converter_details.md
- Context optimization strategiesreferences/context_optimization.md
Performance Comparison
Real example with GitHub MCP server (8 tools):
| Metric | MCP | Skill | Savings |
|---|---|---|---|
| Idle | 8,000 tokens | 100 tokens | 98.75% |
| Active | 8,000 tokens | 5,000 tokens | 37.5% |
Best Practices
- Use descriptive names for your skills
- Include clear descriptions in MCP configurations
- Test generated skills before deployment
- Keep MCP configurations in version control
- Use environment variables for sensitive data
Limitations
- Early stage (feedback welcome)
- Requires
Python packagemcp - Some complex auth may need adjustments
- Not all MCP servers tested
This skill uses the mcp-to-skill-converter from https://github.com/GBSOSS/-mcp-to-skill-converter