agentleFS
myeolinmalchimyeolinmalchi/mcp2cli/skills/mcp-codegen/SKILL.md

mcp-codegen

Skill4 starsChanged 9 months agoMITView on GitHub

Generate TypeScript CLI tool code from an MCP server analysis. Use when the user wants to create a CLI tool, generate CLI code, scaffold a CLI project, or design CLI command structure from MCP tools. Triggers on "generate cli", "create cli", "cli code", "scaffold cli", "mcp to typescript".

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run mcp-analyze first to get the tool list, parameters, and pattern classification.

    line 12
  2. Distinctive:

    Use kebab-case for multi-word commands

    line 21
  3. Distinctive:

    Default: human-readable formatted text

    line 30
  4. Very specific:

    If the pattern is Tier 3, see references/tier-3-strategies.md for partial conversion approach.

    line 45
  5. Very specific:

    If the source MCP server is Python, see references/porting-cheatsheet.md for Python → TypeScript translation patterns (httpx → fetch, …

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CLI Code Generation

Generate a TypeScript/npm-based CLI tool from an analyzed MCP server.

Prerequisites

Run mcp-analyze first to get the tool list, parameters, and pattern classification.

Step 1: Design CLI Command Structure

Map MCP tools to CLI commands:

Naming Convention:

  • Tool prefix groups become subcommands: lol_get_summoner_profile → <cli> lol profile
  • Single-domain tools become direct commands: parse_document → <cli> parse
  • Use kebab-case for multi-word commands

Parameter Mapping:

  • Required MCP params → positional CLI args
  • Optional MCP params → named flags (--flag value)
  • Boolean params → boolean flags (--verbose, --no-cache)
  • Complex objects → JSON string flags or --file references

Output Design:

  • Default: human-readable formatted text
  • --json: raw JSON output for piping
  • Progress/status → stderr, data → stdout

Standard Flags (always include):

  • --help, --version, --json, --verbose / -v

Step 2: Generate Code

Always generate TypeScript/npm-based CLI tools, regardless of the source MCP server's language.

See references/cli-scaffold.md for the project template, stack, and implementation rules.

Select the appropriate code template from references/tier-1-templates.md or references/tier-2-templates.md based on the pattern classification from mcp-analyze.

If the pattern is Tier 3, see references/tier-3-strategies.md for partial conversion approach.

If the source MCP server is Python, see references/porting-cheatsheet.md for Python → TypeScript translation patterns (httpx → fetch, pydantic → interfaces, asyncio → ESM await, etc.).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.