Skip to content

Meta-Boltz/mcp-gen

Repository files navigation

mcp-gen

🚀 Quickly scaffold MCP (Model Context Protocol) projects with a single command!

What is this?

mcp-gen is a CLI tool that helps you quickly create new MCP projects by copying a pre-configured template with all the necessary files and dependencies.

Features

  • Quick Setup: Generate a complete MCP project structure in seconds
  • 🎯 Interactive CLI: Uses Clack.js for a beautiful, user-friendly interface
  • 📁 Flexible Location: Choose where to create your project
  • 🔧 Auto-install: Optionally install dependencies automatically
  • 📝 Template-based: Based on a proven MCP project structure
  • 🎨 Modern Stack: TypeScript, ES modules, and latest MCP SDK

Installation

npm install -g @meta-boltz/mcp-gen

Or use it directly with npx (recommended):

npx -y @meta-boltz/mcp-gen

Usage

Basic Usage

npx -y @meta-boltz/mcp-gen

This will start an interactive CLI that asks you:

  1. MCP Project Name: What to name your MCP project (e.g., cool-mcp)
  2. Target Directory: Where to create the project (e.g., ./my-mcp-project)
  3. Install Dependencies: Whether to run npm install automatically

Example Session

$ npx -y @meta-boltz/mcp-gen

🚀 MCP Project Generator

? What would you like to name your MCP project? cool-mcp
? Where would you like to create your MCP project? ./cool-mcp
? Would you like to install dependencies after creating the project? Yes

Generating MCP project...
✅ Project generated successfully!
Installing dependencies...
✅ Dependencies installed successfully!

🎉 Your MCP project "cool-mcp" has been created at /path/to/cool-mcp

Next steps:
  cd ./cool-mcp
  npm run build
  npm start

What Gets Generated

The tool creates a complete MCP project structure:

your-project/
├── package.json          # Configured with MCP dependencies
├── tsconfig.ts          # TypeScript configuration
├── main.ts              # Main MCP server entry point
├── tools/               # MCP tools directory
│   ├── index.ts        # Tools export file
│   ├── tool1.ts        # Example tool 1
│   └── tool2.ts        # Example tool 2
└── helper/              # Helper utilities
    ├── index.ts        # Helper exports
    └── register.ts     # Tool registration helper

Dependencies Included

  • @modelcontextprotocol/sdk - Official MCP SDK
  • zod - Schema validation
  • typescript - TypeScript compiler
  • tsx - TypeScript execution
  • @types/node - Node.js type definitions

Development

Local Development

# Clone the repository
git clone <your-repo>
cd mcp-template

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

# Test the built version
npm start

Publishing

# Build the project
npm run build

# Publish to npm
npm publish

Project Structure

mcp-template/
├── src/                 # Source code
│   └── index.ts        # Main CLI entry point
├── templates/           # Template files to copy
│   ├── package.json    # Package configuration
│   ├── tsconfig.ts     # TypeScript config
│   ├── main.ts         # MCP server
│   ├── tools/          # MCP tools
│   └── helper/         # Helper utilities
├── dist/               # Built output (generated)
├── package.json        # Package configuration
└── tsconfig.json       # TypeScript configuration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

If you encounter any issues or have questions:

  1. Check the MCP documentation
  2. Open an issue on GitHub
  3. Check existing issues for solutions

Made with ❤️ for the MCP community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published