scaffold-mcp
Installation
SKILL.md
Scaffold an MCP server
The five layers
Every MCP server, regardless of target software, has the same skeleton:
- Server & Transport (
src/index.ts) — stdio entry point, lifecycle, cleanup. - Tool Definitions (
src/tool-definitions.ts) — the contract the AI reads to decide what to call. The single most important file. - Router & Handlers (
src/tool-router.ts,src/handlers/*.ts) — request dispatch, validation, response shaping. - The Bridge (
src/executor.ts,scripts/*) — how you actually talk to the target. 80% of the work. - Security & Validation (
src/utils.ts) — path checks,execFileoverexec, tool filtering.
Step 1: Identify the bridge — this decides everything else
Ask: how does the target software let me automate it?