How yadav-prakhar/mcp-maker works
Project type and purpose
• MCP Maker is an open-source CLI scaffolding tool written in TypeScript.
• Its purpose is to bootstrap and manage “MCP” (Model Context Protocol) server projects by generating boilerplate code for servers, services, tools, prompts, and authentication modules.
File structure
• Top-level “src/” contains:
• commands/ (create, add-tool, add-service, add-prompt, add-auth, help)
• templates/ (Handlebars templates for project, tools, services, prompts, auth)
• utils/ (helpers: string manipulation, project validation, CLI output formatting)
• index.ts (CLI entry point)
• config files: tsconfig.json, .eslintrc.cjs, .prettierrc
• scripts under “.specify/” used for internal automation (pre-commit checks, context updates, scaffolding steps)
Core components
a. CLI Entry Point
• index.ts loads Commander.js, registers commands.
b. Command Parser & Dispatcher
• Uses Commander to parse user input and route to specific handlers.
c. Command Handlers (one per command)
• create.ts, add-tool.ts, add-service.ts, add-prompt.ts, add-auth.ts, help-*.ts
• Each invokes:
• Project Validator (ensure you’re in a valid MCP project)
• Template Engine
• File System Manager
• Utilities (string formatting, dependency updates)
d. Template Engine
• Wraps Handlebars
• Loads the correct template folder from src/templates, applies user arguments (names, options), returns generated file content.
e. File System Manager
• Wraps Node’s fs and fs-extra
• Creates directories, writes files, updates index.ts and handler registration lists.
f. Utilities
• string-utils: name formatting
• help-formatter: ANSI formatting for CLI
• validate-project: detect whether current dir is an MCP project
g. Automation Scripts (.specify)
• Separate Bash scripts to bootstrap the CLI’s own development tasks (plan updates, codegen for new commands, context updates).
h. External Dependencies
• Node.js runtime
• npm registry for installing generated project dependencies
Relationships & data flow
• User runs mcp-maker <command> [options]
↓
• CLI Entry Point (index.ts)
↓
• Command Parser dispatches to Command Handler
↓
• Handler calls Project Validator → Template Engine → File System Manager
↓
• File System writes code artifacts
↓
• CLI prints success messages via Utilities
Architectural patterns & principles
• Modular command-based architecture (each command lives in its own module)
• Template-driven code generation (separation of logic from templates)
• Single Responsibility modules (utilities, validators, file I/O are reused)
• Easy extensibility: new commands and templates can be added without changing core logic
Detail level
• Under Template Engine, note the main template folders (project, tool, service, prompt, auth).
• For File System Manager, show operations: mkdir, writeFile, appendIndex.
• In Utilities, list the key functions: validateProject(), formatHelp(), slugifyName().