|
| 1 | +# `mcp-skillgen` |
| 2 | + - ## Abstract idea |
| 3 | + - Let `mytech-mcp` be an existing [[Open Source]] [[MCP/Server]]. |
| 4 | + - Let `mcp-skillgen` be a [[CLI/Tool]], or more appropriately, a CLI metatool, which facilitates the transformation of `mytech-mcp` into a dedicated `mytech-mcp-cli` CLI tool, and which also facilitate the use of that generated CLI to extract and instantiate subsets of functionality into dedicated Claude Code Skills. |
| 5 | + - ## Concrete idea |
| 6 | + - There's a Claude Code skill called `mcp-skillgen` which wraps a CLI tool of the same name. |
| 7 | + - Let's say `mytech-mcp` contains 70 tools. You only need 3 - tool1, tool2, tool3. You call either instruct Claude to use the skill, or directly call |
| 8 | + - `mcp-skillgen path/to/mytech-mcp/source --skillgen tool1 --skillgen tool2, --skillgen tool3` |
| 9 | + - Result |
| 10 | + - A `mytech-mcp-cli` is created |
| 11 | + - which reimplements the functionality of tool1, tool2, tool3 |
| 12 | + - which knows that it has not compiled tool4 through tool70, and can answer questions about those tools but not execute them |
| 13 | + - which knows how to use `mcp-skillgen` to compile any of the tools, if they needed |
| 14 | + - A [[Claude Code Project Skill]] is created called `mytech` which wraps `mytech-mcp-cli`; it knows all the things `mytech-mcp-cli` knows and can do |
| 15 | + - A [[Claude Code Project Skill]] is created for `mytech-tool1`, `mytech-tool2`, `mytech-tool3`, which tells it to use the generated `mytech-mcp-cli` to accomplish the skill. `mytech-mcp-cli` is located in `.claude/skills/mytech/resources/mytech-mcp-cli` |
| 16 | + - Now |
| 17 | + - Claude code knows how to use the skills from the MCP without weighing down the context. |
| 18 | + - ## Impetus |
| 19 | + - MCP is extremely wasteful. [[AI/Context/Rot]] is a very real problem, and MCPs exacerbate it. |
| 20 | + - If an MCP server has 70 tools, it's quite likely that any given conversation will not need more than three of those tools. So 57 tool definitions clog the entire context. It's quite common for 2-3 MCP servers to consume > 40% of the context. Add Anthropic, GitHub and one more, and it will be at 40% of the context limit for [[Anthropic/Model/Claude/Sonnet/4.5]]. |
| 21 | + - MCP also loads tool definitions into context long before they are used. If there are ten turns to a conversation and the tool is needed on the 11th, then loading those tools before the 11th is wasteful. |
| 22 | + - ## Elaboration and Questions |
| 23 | + - ### Why generate a [[CLI]] for replacing the [[MCP/Server]]? |
| 24 | + - Any good CLI will have documentation. By creating a dedicated CLI that reimplements the functionality of the MCP server, an AI agent will be able to use its documentation and help pages at the command line to discover how to use it. |
| 25 | + - ### Why use a [[CLI]] to generate a [[CLI]]? |
| 26 | + - In [[Agentic AI Coding]] agents, CLIs are more context efficient than MCP, for the reasons listed in the Impetus. As a result, the same holds true for |
| 27 | + - coding agents know how to use CLI tools; we don't need to reinvent the world there, and also they don't need to be spoon-fed instructions about how to use the tools before they are needed. |
| 28 | + - The reason why we want to use generated CLIs are the reason why we want to use a CLI to generate them. |
| 29 | + - ### How will the CLI be generated? |
| 30 | + - Given the source code for the MCP, `mcp-skillgen` will wrap commands to a [[CLI]]-based [[AI/Coding/Tool]] to |
| 31 | + - file information about the tool in a file for later |
| 32 | + - one-time setup |
| 33 | + - analyze the MCP architecture of the tool with respect to security, authentication and other NFRs |
| 34 | + - some setup for all tools, whether implemented or not |
| 35 | + - create a basic requirements spec for the tool's basic functional requirements |
| 36 | + - some setup for all implemented tools |
| 37 | + - create a detailed requirements spec for the tool's detailed functional requirements (for implemented tools) |
| 38 | + - analyze the implementation and enhance the spec with key lessons learned |
| 39 | + - implementation |
| 40 | + - implement the CLI targets and their corresponding skills |
| 41 | + - |
0 commit comments