GBSOSS/-mcp-to-skill-converter

Convert any MCP server into a Claude Skill with 90% context savings

License:UnknownLanguage:Python10412

Deep Analysis

ๅฐ†ไปปไฝ•MCPๆœๅŠกๅ™จ่ฝฌๆขไธบClaude Skill๏ผŒๅฎž็Žฐ90%็š„ไธŠไธ‹ๆ–‡่Š‚็œ

Highly Recommended

Core Features

Progressive Disclosure

ๅฏๅŠจ100ไปค็‰Œ๏ผŒไฝฟ็”จๆ—ถ5kไปค็‰Œ๏ผŒๆ‰ง่กŒ0ไปค็‰Œ

MCP Server่ฝฌๆข

่‡ชๅŠจ่ฏปๅ–MCP้…็ฝฎ็”ŸๆˆSkill็ป“ๆž„ๆ–‡ไปถ

Dynamic Execution

executor.pyๅœจไธŠไธ‹ๆ–‡ๅค–ๆ‰ง่กŒMCPๅทฅๅ…ท

Universalๅ…ผๅฎนๆ€ง

ๆ”ฏๆŒๆ‰€ๆœ‰ๆ ‡ๅ‡†MCPๆœๅŠกๅ™จ

Technical Implementation

Architecture:Pythonๅบ”็”จ่ฏปๅ–MCP้…็ฝฎ๏ผŒ็”ŸๆˆSKILL.mdๅ’Œexecutor.py็š„Skill็›ฎๅฝ•็ป“ๆž„
Execution Flow:
ๅˆ›ๅปบMCP้…็ฝฎ

ๆŒ‡ๅฎšMCPๆœๅŠกๅ™จๅ‘ฝไปคๅ’Œ็Žฏๅขƒๅ˜้‡

่ฟ่กŒ่ฝฌๆขๅ™จ

ๆ‰ง่กŒmcp_to_skill.py่„šๆœฌ

็”ŸๆˆSkill็ป“ๆž„

็”ŸๆˆSKILL.mdๅ’Œexecutor.py

้ƒจ็ฝฒๅˆฐClaude

Claudeไป…ๅŠ ่ฝฝๅ…ƒๆ•ฐๆฎ

ProgressiveๅŠ ่ฝฝ

้œ€่ฆๆ—ถๅŠ ่ฝฝๅฎŒๆ•ด่ฏดๆ˜Ž

Key Components:
Progressive Disclosureๅฎž็Žฐ90%ไธŠไธ‹ๆ–‡่Š‚็œ
Python MCP LibraryMCPๆœๅŠกๅ™จ้€šไฟก
Dynamic Tool ExecutionไธŠไธ‹ๆ–‡ๅค–ๆ‰ง่กŒMCPๅทฅๅ…ท
Highlights
  • ็ฉบ้—ฒๆ—ถ100ไปค็‰Œvs MCP็š„8000ไปค็‰Œ๏ผˆ่Š‚็œ98.75%๏ผ‰
  • ๆ”ฏๆŒๆ‰€ๆœ‰ๆ ‡ๅ‡†MCPๆœๅŠกๅ™จ
  • ็ตๆ„Ÿๆฅ่‡ชplaywright-skill็š„Progressive Disclosure
  • ่ฝป้‡็บงPythonๅฎž็Žฐๆ˜“ไบŽๅฎšๅˆถ
Use Cases
  • 10+ไธชๅทฅๅ…ทไธ”ไธŠไธ‹ๆ–‡็ดงๅผ ๆ—ถ
  • ๅคงๅคšๆ•ฐๅทฅๅ…ทไธๅธธ็”จ็š„ๅœบๆ™ฏ
  • ้œ€่ฆๅคšไธชMCPๆœๅŠกๅ™จ็š„ๅบ”็”จ
Limitations
  • ๆ—ฉๆœŸ้˜ถๆฎตๅ้ฆˆๆœ‰้™
  • ๅคๆ‚OAuthๅฏ่ƒฝ้œ€ๆ‰‹ๅŠจ่ฐƒๆ•ด
Tech Stack
Python 3.8+MCPClaude Skills Framework

mcp-to-skill-converter

Convert any MCP server into a Claude Skill with 90% context savings.

Why This Exists

MCP servers are great but load all tool definitions into context at startup. With 20+ tools, that's 30-50k tokens gone before Claude does any work.

This converter applies the "progressive disclosure" pattern (inspired by playwright-skill) to any MCP server:

  • Startup: ~100 tokens (just metadata)
  • When used: ~5k tokens (full instructions)
  • Executing: 0 tokens (runs externally)

Quick Start

# 1. Create your MCP config file
cat > github-mcp.json << 'EOF'
{
  "name": "github",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {"GITHUB_TOKEN": "your-token-here"}
}
EOF

# 2. Convert to Skill
python mcp_to_skill.py \
  --mcp-config github-mcp.json \
  --output-dir ./skills/github

# 3. Install dependencies
cd skills/github
pip install mcp

# 4. Copy to Claude
cp -r . ~/.claude/skills/github

Done! Claude can now use GitHub tools with minimal context.

What It Does

The converter:

  1. Reads your MCP server config
  2. Generates a Skill structure with:
    • SKILL.md - Instructions for Claude
    • executor.py - Handles MCP calls dynamically
    • Config files
  3. Claude loads metadata only (~100 tokens)
  4. Full instructions load when the skill is needed
  5. Executor runs MCP tools outside context

Context Savings

Before (MCP):

20 tools = 30k tokens always loaded
Context available: 170k / 200k = 85%

After (Skills):

20 skills = 2k tokens metadata
When 1 skill active: 7k tokens
Context available: 193k / 200k = 96.5%

Real Example

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%

Works With

Any standard MCP server:

  • โœ… @modelcontextprotocol/server-github
  • โœ… @modelcontextprotocol/server-slack
  • โœ… @modelcontextprotocol/server-filesystem
  • โœ… @modelcontextprotocol/server-postgres
  • โœ… Your custom MCP servers

When To Use

Use this converter when:

  • You have 10+ tools
  • Context space is tight
  • Most tools won't be used in each conversation
  • Tools are independent

Stick with MCP when:

  • You have 1-5 tools
  • Need complex OAuth flows
  • Need persistent connections
  • Cross-platform compatibility critical

Best approach: Use both

  • MCP for core tools
  • Skills for extended toolset

Requirements

pip install mcp

Python 3.8+ required.

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Your MCP Config                     โ”‚
โ”‚ (JSON file)                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ mcp_to_skill.py                     โ”‚
โ”‚ - Reads config                      โ”‚
โ”‚ - Generates Skill structure         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Generated Skill                     โ”‚
โ”‚ โ”œโ”€โ”€ SKILL.md (100 tokens)           โ”‚
โ”‚ โ”œโ”€โ”€ executor.py (dynamic calls)     โ”‚
โ”‚ โ””โ”€โ”€ config files                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Claude                              โ”‚
โ”‚ - Loads metadata only               โ”‚
โ”‚ - Full docs when needed             โ”‚
โ”‚ - Calls executor for tools          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Examples

Example 1: GitHub Integration

# Create config
cat > github.json << 'EOF'
{
  "name": "github",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {"GITHUB_TOKEN": "ghp_your_token"}
}
EOF

# Convert
python mcp_to_skill.py --mcp-config github.json --output-dir ./skills/github

# Result: GitHub tools accessible with 100 tokens vs 8k

Example 2: Multiple Servers

# Convert multiple MCP servers
for config in configs/*.json; do
  name=$(basename "$config" .json)
  python mcp_to_skill.py --mcp-config "$config" --output-dir "./skills/$name"
done

Troubleshooting

"mcp package not found"

pip install mcp

"MCP server not responding"

Check your config file:

  • Command is correct
  • Environment variables set
  • Server is accessible

Testing the generated skill

cd skills/your-skill

# 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": {...}}'

Limitations

  • Early stage (feedback welcome)
  • Requires mcp Python package
  • Some complex auth may need adjustments
  • Not all MCP servers tested

Contributing

This is a proof of concept. Contributions welcome:

  • Test with more MCP servers
  • Improve error handling
  • Add more examples
  • Better documentation

Credits

Inspired by:

License

MIT

Learn More


Status: Functional but early stage
Feedback: Issues and PRs welcome
Questions: Open an issue