Flexible Scaffold
FreeStale (389d)π Powerful flexible project scaffolding tool - supports Git repositories and local directory templates, one-click generation of React/Vue/Node.js project struc
About
π Powerful flexible project scaffolding tool - supports Git repositories and local directory templates, one-click generation of React/Vue/Node.js project structures, integrated AI assistant calling capabilities, and bilingual internationalization support
README
π Flexible Project Scaffolding Tool
TypeScript project supporting Git-managed templates and AI assistant integration
π¦ NPM Package: flexible-scaffold
π¨π³ δΈζζζ‘£ (δΈζη)
π¦ NPM Package Information
| Information | Details |
|---|---|
| Package Name | flexible-scaffold |
| Version | 1.0.3 |
| NPM Registry | https://www.npmjs.com/package/flexible-scaffold |
| Install Command | npm install -g flexible-scaffold |
| Npx Usage | npx flexible-scaffold [command] |
β¨ Core Features
- π― TypeScript Support: Complete type definitions and type safety
- π Dual Template Support: Support both Git repositories and local directories as templates
- π οΈ Flexible Add/Delete: Dynamic addition, deletion, and updating of scaffold templates from Git or local sources
- π€ AI-Friendly: Supports MCP protocol and JSON output for AI assistant integration
- β‘ Single Command Operations: All operations can be completed with a single command
- π¨ Template Variables: Support for template variable substitution and post-processing scripts
- π± Interactive Interface: User-friendly interactive command interface
- π§ͺ Complete Testing: Includes MCP server functionality tests
π Quick Start
Install via NPM (Recommended)
# Global installation
npm install -g flexible-scaffold
# Install as project dependency
npm install flexible-scaffold
# Run directly with npx (no installation needed)
npx flexible-scaffold --help
π NPM Package Details:
- π¦ Package Name:
flexible-scaffold - π·οΈ Version: Latest stable version
- π Repository: GitHub
- π Documentation: This README file
- π Issue Tracking: GitHub Issues
Install from Source
git clone <repository-url>
cd flexible-scaffold
npm install
npm run build
npm install -g .
Build for Development
# Development mode
npm run dev
# Build production version
npm run build
# Start built version
npm start
Global Installation (Developers)
# Method 1: Use npm link
npm run build
npm link
# Method 2: Globally install built package
npm run build
npm install -g .
π― Usage
Basic Commands
# View help
flexible-scaffold --help
# Add Git template
flexible-scaffold add react-antd https://github.com/username/react-antd-template.git "React + Ant Design template"
# Add local directory template
flexible-scaffold add my-template /path/to/local/template -d "My local template"
# List all templates
flexible-scaffold list
# or
flexible-scaffold ls
# Create project
flexible-scaffold create react-antd my-new-project
# Interactive creation
flexible-scaffold create react-antd my-project --interactive
# Update specific template (Git only)
flexible-scaffold update react-antd
# Update all templates (Git only)
flexible-scaffold update
# Remove template
flexible-scaffold remove react-antd
# or
flexible-scaffold rm react-antd
# View template info
flexible-scaffold info react-antd
# Validate template
flexible-scaffold validate react-antd
# Clean invalid templates
flexible-scaffold cleanup
# Start interactive interface
flexible-scaffold interactive
# or
flexible-scaffold i
Configuration Management
# Display configuration
flexible-scaffold config --show
# Show configuration path
flexible-scaffold config --path
# Export configuration
flexible-scaffold config --export config-backup.json
# Import configuration
flexible-scaffold config --import config-backup.json
AI Assistant Integration
# Use JSON output mode (suitable for AI calls)
SCAFFOLD_JSON_OUTPUT=true flexible-scaffold list
# Use installed package
npx flexible-scaffold --json list
# Use globally installed version
flexible-scaffold --json create react-antd my-project
Command Options
| Option | Description |
|---|---|
--json |
Output in JSON format |
--interactive |
Use interactive mode |
--help |
Show help information |
--version |
Show version information |
π€ MCP Integration
Start MCP Server
# Using installed package
npx flexible-scaffold mcp
# Using globally installed version
flexible-scaffold mcp
# Development mode (from source)
npm run mcp
NPM Package MCP Configuration
Add to configuration file (like Claude Desktop's ~/.config/claude-desktop/claude_desktop_config.json):
{
"mcpServers": {
"flexible-scaffold": {
"command": "npx",
"args": ["flexible-scaffold", "mcp"]
}
}
}
Global Installation MCP Configuration
{
"mcpServers": {
"flexible-scaffold": {
"command": "flexible-scaffold",
"args": ["mcp"]
}
}
}
Global Installation MCP Configuration Example
{
"mcpServers": {
"flexible-scaffold": {
"command": "flexible-scaffold",
"args": ["mcp"],
"env": {
"DEBUG": "true"
}
}
}
}
Available MCP Features
π§ MCP Tools:
add_scaffold_template: Add new template (Git or local)remove_scaffold_template: Remove templateupdate_scaffold_template: Update specific template (Git only)update_all_scaffold_templates: Update all templates (Git only)list_scaffold_templates: List all templates (Git and local)create_project_from_scaffold: Create project from templateget_scaffold_template_info: Get template detailsvalidate_scaffold_template: Validate templatecleanup_invalid_templates: Clean up invalid templates
π MCP Resources:
scaffold://config: View scaffold configuration informationscaffold://stats: View usage statistics
π¬ MCP Prompts:
scaffold-usage-help: Get usage helpproject-creation-guide: Project creation guidancetemplate-development-guide: Template development guidance
π Project Structure
flexible-scaffold/
βββ src/ # TypeScript source code
β βββ types/ # Type definitions
β β βββ index.ts
β βββ utils/ # Utility functions
β β βββ index.ts
β βββ FlexibleScaffold.ts # Core functionality class
β βββ cli.ts # Command-line interface
β βββ mcp-scaffold-server.ts # MCP server
β βββ test-mcp.ts # MCP test script
β βββ index.ts # Entry file
βββ scripts/ # Script files
β βββ scaffold-ai.sh # AI-friendly wrapper script
βββ dist/ # Compiled JavaScript files
βββ tests/ # Test files
βββ docs/ # Documentation
βββ package.json
βββ tsconfig.json
βββ .gitignore
βββ README.md
π§ͺ Testing
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Run MCP tests
npm run test:mcp
π Development
Prerequisites
- Node.js >= 16.0.0
- npm >= 7.0.0
- Git
Setup Development Environment
# Clone repository
git clone https://github.com/lenuxo/flexible-scaffold.git
cd flexible-scaffold
# Install dependencies
npm install
# Start development mode
npm run dev
# Run tests
npm test
# Build for production
npm run build
Available Scripts
| Script | Description |
|---|---|
npm run build |
Build TypeScript to JavaScript |
npm run dev |
Development mode with hot reload |
npm start |
Run built application |
npm test |
Run tests |
npm run test:coverage |
Run tests with coverage |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Lint code |
npm run lint:fix |
Fix linting issues |
npm run clean |
Clean build directory |
npm run mcp |
Start MCP server in development |
π Template Development
Template Structure
template-name/
βββ template/ # Template files
β βββ package.json
β βββ src/
β βββ ...
βββ scaffold.json # Template configuration
βββ README.md # Template documentation
Template Configuration (scaffold.json)
{
"name": "template-name",
"description": "Template description",
"version": "1.0.0",
"variables": {
"PROJECT_NAME": {
"type": "string",
"description": "Project name",
"default": "my-project"
}
},
"scripts": {
"postCreate": "npm install"
}
}
Template Variables
Use {{variableName}} syntax in template files:
package.json:
{
"name": "{{PROJECT_NAME}}",
"version": "1.0.0",
"description": "Created on {{CREATION_DATE}}",
"author": "{{AUTHOR_NAME}}"
}
src/App.tsx:
import React from 'react';
const App: React.FC = () => {
return (
<div>
<h1>Welcome to {{PROJECT_NAME}}</h1>
<p>Created on {{CREATION_DATE}}</p>
</div>
);
};
export default App;
π Continuous Integration
GitHub Actions
The project includes GitHub Actions for:
- Automated testing on multiple Node.js versions
- Code quality checks
- Automated releases
- NPM publishing
π Performance
- Fast startup: Optimized for quick initialization
- Memory efficient: Minimal memory footprint
- Template caching: Local template caching for faster access
- Parallel processing: Concurrent template operations
π Security
- Input validation and sanitization
- Secure template loading from trusted sources
- No arbitrary code execution
- Template signature verification (planned)
π€ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow TypeScript best practices
- Add tests for new features
- Update documentation
- Use conventional commits
- Maintain backward compatibility
Code Style
- Use TypeScript strict mode
- Follow ESLint configuration
- Use Prettier for formatting
- Add JSDoc comments for public APIs
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Commander.js for CLI framework
- Inquirer.js for interactive prompts
- TypeScript for type safety
- Vitest for testing framework
π·οΈ Version History
v1.0.3 - Internationalization support and MCP commands optimization π
- Added bilingual Chinese-English support π¨π³πΊπΈ
- Optimized MCP command response formats
- Improved error handling and user prompts
- Enhanced CLI output internationalization experience
v1.0.2 - Local template support
- Support for local directory templates π
- Dual template type identification (Git π vs Local π)
- Updated CLI and MCP tools for local templates
- Enhanced interactive interface with template type selection
v1.0.1 - Bug fixes and improvements
- Fixed MCP command issues
- Updated documentation
v1.0.0 - Initial release with core functionality
- Basic scaffold operations
- Git template management
- MCP server support
- Interactive CLI
- TypeScript support
π Support
- π§ Issues: GitHub Issues
- π Documentation: This README file
- π NPM Registry: https://www.npmjs.com/package/flexible-scaffold
Install Flexible Scaffold in Claude Desktop, Claude Code & Cursor
unyly install flexible-scaffoldInstalls into Claude Desktop, Claude Code, Cursor & VS Code β handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add flexible-scaffold --env SCAFFOLD_JSON_OUTPUT="" -- npx -y flexible-scaffoldStep-by-step: how to install Flexible Scaffold
FAQ
Is Flexible Scaffold MCP free?
Yes, Flexible Scaffold MCP is free β one-click install via Unyly at no cost.
Does Flexible Scaffold need an API key?
Yes, it requires environment variables: SCAFFOLD_JSON_OUTPUT. Unyly injects them into the config during install.
Is Flexible Scaffold hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Flexible Scaffold in Claude Desktop, Claude Code or Cursor?
Open Flexible Scaffold on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install β the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
by duxiaohuiSupabase
Database, auth and storage
by SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Flexible Scaffold with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
