home / skills / bahayonghang / my-claude-code-settings / mcp-to-skill

This skill converts MCP servers into Claude Code Skills, generating complete packages with SKILL.md, scripts, and references for easy reuse.

npx playbooks add skill bahayonghang/my-claude-code-settings --skill mcp-to-skill

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
4.1 KB
---
name: mcp-to-skill
description: |
  Convert MCP (Model Context Protocol) servers to Claude Code Skills. Use when:
  (1) User wants to convert an MCP server project to a skill
  (2) User mentions "MCP to skill", "convert MCP", or "MCP 转 skill"
  (3) User has an MCP server codebase and wants to make it a reusable skill
  (4) User wants to analyze MCP server structure for skill creation
  Supports TypeScript/JavaScript and Python MCP servers. Generates complete skill package with SKILL.md, scripts, and references.
category: skill-management
tags: [mcp, skill-conversion, model-context-protocol, automation]
---

# MCP to Skill Converter

Convert MCP servers into Claude Code Skills for easier distribution and usage.

## Conversion Workflow

### 1. Analyze MCP Server

Read and understand the MCP server structure:

```bash
# Key files to analyze
- package.json / pyproject.toml  # Dependencies and entry point
- src/index.ts / main.py         # Entry point and tool registration
- src/**/*.ts / **/*.py          # Tool implementations
```

Extract this information:
- **Server name and description**
- **Available tools** (name, description, parameters, implementation)
- **Dependencies** (runtime requirements)
- **Execution method** (node, python, etc.)

### 2. Map MCP Tools to Skill Structure

| MCP Concept | Skill Equivalent |
|-------------|------------------|
| Tool name | Script or instruction section |
| Tool description | Used in SKILL.md description |
| Tool parameters | Script arguments or instruction parameters |
| Tool implementation | `scripts/` executable or inline instructions |

### 3. Generate Skill Structure

```
{skill-name}/
├── SKILL.md                    # Core instructions
├── scripts/
│   ├── run_server.sh          # Server startup script (optional)
│   └── {tool_name}.{ext}      # Individual tool scripts
└── references/
    └── tools.md               # Tool reference documentation
```

### 4. Write SKILL.md

Template structure:

```markdown
---
name: {skill-name}
description: |
  {Original MCP server description}. Use when:
  (1) {Primary use case}
  (2) {Secondary use case}
  {List all tool capabilities}
---

# {Skill Name}

{Brief description of what this skill does}

## Prerequisites

{Any setup requirements - permissions, API keys, etc.}

## Available Tools

{List each tool with usage instructions}

### {Tool Name}

{Description}

**Usage:**
{How to invoke - either via script or direct instruction}

**Parameters:**
- `{param}`: {description}

**Example:**
{Concrete usage example}
```

## Conversion Patterns

### Pattern A: Script-based (for complex tools)

When MCP tool has complex logic, create executable script:

```python
# scripts/tool_name.py
#!/usr/bin/env python3
import argparse
# ... implementation
```

Reference in SKILL.md:
```markdown
Run `scripts/tool_name.py --param value`
```

### Pattern B: Instruction-based (for simple tools)

When MCP tool is simple, use inline instructions:

```markdown
### Send Notification

To send a system notification:
1. Use AppleScript: `display notification "message" with title "title"`
```

### Pattern C: Hybrid (server-dependent tools)

When tools require the MCP server runtime:

```markdown
## Setup

Start the MCP server:
\`\`\`bash
cd {project-path}
npm start  # or: node dist/index.js
\`\`\`

Then use MCP tools via the running server.
```

## AppleScript MCP Example

For applescript-mcp specifically:

1. **No server needed** - Tools are standalone AppleScripts
2. **Use instruction-based pattern** - Each tool becomes a section
3. **Group by category** - System, Calendar, Finder, etc.
4. **Include permission notes** - macOS security requirements

## Output Checklist

Before packaging, verify:

- [ ] SKILL.md has proper frontmatter (name, description)
- [ ] Description includes all use cases and triggers
- [ ] All MCP tools are documented
- [ ] Scripts are executable and tested
- [ ] References are complete but not redundant
- [ ] No unnecessary files (README, CHANGELOG, etc.)

## Package the Skill

```bash
python3 ~/.claude/skills/skill-creator/scripts/package_skill.py /path/to/skill
```

Overview

This skill converts MCP (Model Context Protocol) servers into reusable Claude Code skills with a complete package, scripts, and reference docs. It supports TypeScript/JavaScript and Python MCP servers and automates mapping of tools, parameters, and dependencies into a skill layout. Use it to standardize, distribute, or analyze MCP codebases for reuse.

How this skill works

The converter scans the MCP project to extract entry points, tool implementations, dependencies, and runtime details. It maps each MCP tool to either an executable script or an instruction section, generates a skill manifest and scripts folder, and produces a reference document listing tools, parameters, and examples. The output includes startup scripts for server-backed tools, standalone tool scripts for simple actions, and a checklist to validate the final package.

When to use it

  • You have an MCP server codebase and want a reusable Claude Code skill package
  • You ask for “MCP to skill”, “convert MCP”, or similar phrases indicating conversion
  • You need to analyze MCP server structure to document tools and parameters
  • You want to distribute MCP tools as standalone scripts or instruction-based skill content
  • You prefer an automated mapping from MCP concepts to skill layout

Best practices

  • Scan package.json or pyproject.toml to capture dependencies and entry points before conversion
  • Prefer script-based generation for complex tool logic and instruction-based sections for simple utilities
  • Include explicit parameter definitions and concrete examples for every tool
  • Mark server-dependent tools clearly and provide a startup script and usage steps
  • Run and test generated scripts in the target runtime (node or python) before packaging

Example use cases

  • Convert a TypeScript MCP server into a skill with scripts for each tool and a startup script for server-backed endpoints
  • Extract standalone utilities from a Python MCP project and publish them as instruction-based skill entries
  • Audit an MCP repository to produce a catalog of tools, parameters, and dependency requirements for internal documentation
  • Create a hybrid skill where some tools run as local scripts and others require the MCP server to be started
  • Prepare a skill package that includes executable scripts, a manifest, and a references document for developer handoff

FAQ

Which languages are supported?

The converter supports TypeScript/JavaScript and Python MCP servers. It detects entry points and tools in those ecosystems.

How are server-dependent tools handled?

Server-dependent tools are packaged with a startup script and clear instructions to run the MCP server before invoking tool endpoints; standalone tools are emitted as executable scripts or instruction text.