Scaffold MCP

Generate standardized code from templates for consistent project bootstrapping and feature addition across your codebase.

Overview

Scaffold MCP is an open-source Model Context Protocol server from the AI Code Toolkit that enables AI coding agents to generate standardized code from templates. It addresses the challenge of maintaining consistency as projects scale by providing programmatic scaffolding for new projects and features.

Unlike custom instructions that struggle to enforce architectural patterns, Scaffold MCP provides concrete templates and generation tools that ensure every new project or feature follows your established patterns and conventions.

Key Benefits

Rapid Bootstrapping

Generate entire projects from boilerplate templates in seconds. Support for Next.js 15, TypeScript libraries, and MCP packages out of the box.

Consistent Architecture

Ensure every project follows the same architectural patterns and conventions. Templates reference the same design rules used by Architect MCP for validation.

Incremental Feature Addition

Add new features like pages, components, and API routes to existing applications while maintaining consistency with the project's established patterns.

Monorepo & Monolith Support

Works seamlessly with both monorepo and monolith project structures. Supports multiple transport modes (stdio, HTTP, SSE) for flexibility.

Available MCP Tools

list-boilerplates

Display all available project templates (boilerplates) that can be used to create new projects.

  • • View all available templates
  • • See template descriptions and features
  • • Understand required variables for each template

use-boilerplate

Generate a new project from a selected boilerplate template with customizable variables.

  • • Create complete project structure
  • • Customize project name, description, etc.
  • • Generate all necessary configuration files

list-scaffolding-methods

Show available features (scaffolding methods) that can be added to an existing project.

  • • View features available for your project type
  • • See required variables for each method
  • • Understand what each method generates

use-scaffold-method

Add a new feature to an existing project using a scaffolding method (e.g., add a new page, component, or API route).

  • • Generate feature-specific code
  • • Follow project's existing patterns
  • • Update imports and exports automatically

How Scaffold MCP Works

1

Template Discovery

AI agents use list-boilerplates to discover available project templates and list-scaffolding-methods to see what features can be added to existing projects.

2

Variable Configuration

Each template and scaffolding method defines required variables (project name, description, etc.). The AI agent collects this information from user input or context.

3

Code Generation

The MCP server processes the template with the provided variables, generating all necessary files, directories, and configuration based on the template definition.

4

Pattern Consistency

Generated code follows the same architectural patterns and coding standards defined in architect.yaml and RULES.yaml, ensuring consistency with validation rules.

Common Use Cases

New Project Creation

"Create a new Next.js 15 application called 'dashboard' with TypeScript and Tailwind CSS"

Project Bootstrapping

Feature Addition

"Add a new settings page to my React application" or "Create a new API endpoint for user authentication"

Incremental Development

Component Scaffolding

"Generate a new reusable data table component with sorting and filtering capabilities"

Component Library

Library Creation

"Create a new TypeScript library package for shared utilities" or "Set up a new MCP server package"

Package Management

Installation & Configuration

Installation

Scaffold MCP can be run directly using npx without installation, or you can install it globally:

# Run directly with npx (recommended)
npx -y @agiflowai/scaffold-mcp mcp-serve --admin-enable
# Or install globally
npm install -g @agiflowai/scaffold-mcp

MCP Configuration

Add the following configuration to your AI coding tool's MCP settings (e.g., Claude Code, Cursor, Windsurf):

{
  "mcpServers": {
    "scaffold-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@agiflowai/scaffold-mcp",
        "mcp-serve",
        "--admin-enable"
      ]
    }
  }
}

Quick Start with AI Code Toolkit

Use the unified AI Code Toolkit CLI to automatically configure Scaffold MCP:

# Initialize project with MCP configuration
npx @agiflowai/aicode-toolkit init

Integration with Architect MCP

Scaffold MCP works complementarily with Architect MCP to provide a complete development workflow:

1. Pre-coding

Use Scaffold MCP to generate boilerplate code

2. During coding

Use Architect MCP for pattern guidance

3. Post-coding

Use Architect MCP to review against rules

Both tools reference the same template definitions, ensuring consistency between generated and reviewed code.

Best Practices

🎯 Start with Boilerplates

Always use list-boilerplates first to see what templates are available. This ensures you're using the most appropriate template for your project type.

📝 Follow Naming Conventions

Use kebab-case for project names (e.g., "my-new-project") and follow the variable requirements specified by each template for consistency.

🔄 Incremental Development

Use scaffolding methods to add features incrementally rather than creating everything manually. This maintains consistency as your project grows.

✅ Validate with Architect

After scaffolding, use Architect MCP to validate that the generated code follows your project's rules and patterns before making customizations.

Next Steps