Scale your AI coding agents with scaffolding, architecture patterns, and validation rules
A collection of Model Context Protocol (MCP) servers and tools that help AI coding agents maintain consistency, follow conventions, and scale with your codebase.
- Why This Exists
- Core Pillars
- Getting Started
- Packages
- Our Approach
- Development
- Documentation
- Version Support
- Contributing
- License
As projects evolve from MVP to production, they develop patterns, conventions, and opinionated approaches. Custom instructions alone struggle to ensure AI agents follow these requirementsβespecially as complexity grows and context windows fill up.
AI Code Toolkit provides building blocks to scale coding agent capabilities:
- β Generate code that follows your team's conventions
- β Enforce architectural patterns automatically
- β Validate agent outputs programmatically
- β Work with any AI coding agent (Claude, Cursor, etc.)
- β Support any tech stack (Next.js, React, or custom frameworks)
Whether you're bootstrapping a new project or managing a complex monorepo, these tools ensure AI agents integrate seamlessly with your development workflow.
Combine templating with LLMs to generate standardized code that follows your internal conventions while reducing maintenance overhead.
Convention over configuration scales. Like Ruby on Rails or Angular, opinionated approaches make code predictableβfor both humans and AI agents.
Pre-flight guidance + post-flight validation = consistent output. Rules provide programmatic checks (quantitative or qualitative) to enforce your processes.
- Node.js:
>= 18(LTS recommended) - Package Manager:
pnpm(ornpm/yarn) - Git:
>= 2.13.2
-
Install the package:
pnpm install @agiflowai/scaffold-mcp
-
Configure Claude Desktop: Add to your MCP settings:
{ "mcpServers": { "scaffold": { "command": "scaffold-mcp", "args": ["mcp-serve"] } } } -
Start using it: The MCP server tools will be available in Claude Desktop.
# Install globally or use npx
pnpm install -g @agiflowai/scaffold-mcp
# Initialize templates (auto-downloads official templates)
scaffold-mcp init
# List available boilerplates
scaffold-mcp boilerplate list
# Create a new project
scaffold-mcp boilerplate create scaffold-nextjs-app \
--vars '{"appName":"my-app","withDrizzle":true}'
# Add features to existing projects
scaffold-mcp scaffold list ./apps/my-app
scaffold-mcp scaffold add scaffold-route \
--project ./apps/my-app \
--vars '{"routePath":"about","pageTitle":"About Us"}'Key Features:
- π Auto-download templates:
initcommand downloads official templates from GitHub - π GitHub subdirectory support: Add templates from specific folders in repositories
- π Multiple transport modes: stdio (MCP), HTTP, SSE, or standalone CLI
- π¦ Built-in templates: Next.js 15 with Drizzle ORM, Storybook, and more
For detailed usage, see the scaffold-mcp documentation.
The init command automatically downloads official templates from the AgiFlow repository:
# Initialize and auto-download official templates
scaffold-mcp init
# Skip auto-download
scaffold-mcp init --no-download
# Custom templates path
scaffold-mcp init --path ./custom-templatesAdd additional templates from GitHub (supports subdirectories):
# Add from full repository
scaffold-mcp add --name my-template --url https://github.com/user/repo
# Add from repository subdirectory
scaffold-mcp add \
--name nextjs-template \
--url https://github.com/user/repo/tree/main/templates/nextjsCurrent Templates:
- nextjs-15-drizzle: Next.js 15 + App Router + TypeScript + Tailwind CSS 4 + Storybook + Optional Drizzle ORM
- Boilerplate: Full application setup
- Features: Routes, components, API routes, auth, services, and more
The AI Code Toolkit packages work together to create a complete development workflow for AI coding agents. Here's how they integrate:
1. Bootstrap Project (scaffold-mcp)
β
scaffold-mcp boilerplate create β Creates project with template
β
Result: Project with architect.yaml + RULES.yaml from template
2. Get Design Guidance (architect-mcp)
β
architect-mcp get-file-design-pattern β Shows patterns for file
β
Result: AI agent understands architectural patterns to follow
3. Write Code (AI Agent)
β
Agent writes code following design patterns
β
Result: Code implementation
4. Review Code (architect-mcp)
β
architect-mcp review-code-change β Validates against rules
β
Result: Violations identified, feedback provided
5. Add Features (scaffold-mcp)
β
scaffold-mcp scaffold add β Adds new features/components
β
Result: Consistent code following patterns
scaffold-mcp and architect-mcp are complementary:
| Tool | Purpose | When to Use |
|---|---|---|
| scaffold-mcp | Generate code from templates | Creating new projects, adding standard features (routes, components) |
| architect-mcp | Guide and validate code | Understanding patterns, reviewing code quality |
Integration Points:
-
Shared Templates: Both use the same template structure
templates/nextjs-15/ βββ scaffold.yaml β scaffold-mcp: Defines boilerplates/features βββ architect.yaml β architect-mcp: Defines design patterns βββ RULES.yaml β architect-mcp: Defines coding rules -
Project Configuration: Projects reference templates via
project.json{ "name": "my-app", "sourceTemplate": "nextjs-15" } -
Workflow Stages:
- Pre-coding: scaffold-mcp generates boilerplate β architect-mcp shows patterns
- During coding: architect-mcp provides guidance β AI agent writes code
- Post-coding: architect-mcp reviews code β Identifies violations
- Iteration: scaffold-mcp adds features β architect-mcp validates
Step 1: Create Project
scaffold-mcp boilerplate create scaffold-nextjs-app \
--vars '{"appName":"my-store","withDrizzle":true}'Result: Project created with Next.js structure, architect.yaml, and RULES.yaml
Step 2: Understand Patterns (Before writing custom code)
architect-mcp get-file-design-pattern apps/my-store/src/app/products/page.tsxResult: Shows "Next.js App Router Pattern" and applicable rules
Step 3: Add Feature (Standard features)
scaffold-mcp scaffold add scaffold-nextjs-route \
--project apps/my-store \
--vars '{"routePath":"products","pageTitle":"Products"}'Result: Route created following template patterns
Step 4: Write Custom Code (AI agent writes business logic)
// AI agent adds product fetching logic following patterns shown
export default async function ProductsPage() {
const products = await fetchProducts(); // Custom logic
return <div>{/* render products */}</div>;
}Step 5: Review Code
architect-mcp review-code-change apps/my-store/src/app/products/page.tsxResult: Validates against RULES.yaml (named exports, error handling, etc.)
- Templates as Single Source of Truth: Both tools read from same template definitions
- Separation of Concerns:
- scaffold-mcp: Generates repetitive code
- architect-mcp: Guides unique code
- Progressive Enhancement:
- Start with scaffolding (fast, consistent)
- Add custom logic (AI-assisted, pattern-guided)
- Validate output (automated review)
- Feedback Loop: Reviews inform future scaffolding and patterns
Claude Desktop Configuration (Both MCP servers):
{
"mcpServers": {
"scaffold-mcp": {
"command": "npx",
"args": ["-y", "@agiflowai/scaffold-mcp", "mcp-serve", "--admin-enable"]
},
"architect-mcp": {
"command": "npx",
"args": [
"-y", "@agiflowai/architect-mcp", "mcp-serve",
"--admin-enable",
"--design-pattern-tool", "claude-code",
"--review-tool", "claude-code"
]
}
}
}Agent Instructions (in CLAUDE.md or similar):
When creating new features:
1. Use scaffold-mcp to generate boilerplate if standard feature exists
2. Use architect-mcp to understand patterns before writing custom code
3. Use architect-mcp to review code before committing
When updating patterns:
1. Use architect-mcp admin tools to update architect.yaml and RULES.yaml
2. Use scaffold-mcp admin tools to update scaffold.yaml templatesMCP server for scaffolding applications with boilerplate templates and feature generators.
Key Features:
- π Create projects from boilerplate templates
- π― Add features to existing projects (pages, components, services)
- π¦ Template management (initialize, add from repositories)
- π§ Built-in templates: Next.js 15, Vite + React
- π Multiple transport modes: stdio, HTTP, SSE
- π» Standalone CLI mode
- ποΈ Slash command prompts for AI coding agents
MCP server for software architecture design, code quality enforcement, and design pattern guidance.
Key Features:
- π¨ Design pattern guidance for specific files
- β Code review against template-specific rules
- π Architecture patterns (architect.yaml)
- π Coding standards and rules (RULES.yaml)
- π€ Optional LLM-powered analysis with Claude Code CLI
- π Multiple transport modes: stdio, HTTP, SSE
- π» Standalone CLI mode
- π§ Admin tools for pattern and rule management
Works with any AI coding agent (Claude Code, Cursor, Windsurf, etc.). Each library provides:
- MCP tools for integration with MCP-compatible agents
- CLI commands for scripting deterministic workflows
Built-in templates for popular frameworks:
- Next.js 15
- Vite + React
- More coming soon
Don't see your stack? Use the built-in MCP tools to generate custom templatesβthe system is fully extensible.
Maximize effectiveness by combining three layers:
- MCP Servers β Let tools guide the agent with their default prompts
- Custom Instructions β Use
CLAUDE.md,AGENTS.mdto specify when to use MCP tools - Hooks β Intercept tool calls to enforce workflows (e.g., require scaffolding for new files)
Experiment with these layers to find the right balance for your project. There's no one-size-fits-all solution.
The scaffold-mcp server provides built-in slash commands for AI coding agents like Claude Code:
For Users:
/scaffold-mcp:scaffold-application- Guide the agent to create a new application from boilerplate templates/scaffold-mcp:scaffold-feature- Guide the agent to add features (pages, components, services) to existing projects
For Template Creators:
/scaffold-mcp:generate-boilerplate- Guide the agent to create a new boilerplate template configuration/scaffold-mcp:generate-feature-scaffold- Guide the agent to create a new feature scaffold configuration
These prompts provide step-by-step instructions to the AI agent, ensuring it follows the correct workflow for scaffolding tasks. They're automatically available when the MCP server is configured in your coding agent.
π Learn how to use prompts β
This is an Nx monorepo using pnpm for package management.
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Build a specific package
pnpm exec nx build scaffold-mcp
# Run tests
pnpm test
pnpm exec nx test scaffold-mcp
# Lint and format
pnpm lint # Check for issues
pnpm lint:fix # Auto-fix issues
pnpm format # Format code
pnpm format:check # Check formatting
# Type checking
pnpm typecheck
pnpm exec nx typecheck scaffold-mcp
# Visualize project graph
pnpm exec nx graphWe use Biome for lightning-fast linting and formatting:
- β‘ 10-100x faster than ESLint (written in Rust)
- π― All-in-one: Replaces ESLint + Prettier
- π§ Zero config: Sensible defaults out of the box
Configuration: biome.json
See PUBLISHING.md for the complete release workflow:
# Preview release (dry run)
pnpm release:dry-run
# Publish to npm
pnpm release- Scaffold MCP Guide - Complete guide to the scaffolding MCP server
- How to Use Prompts - Step-by-step guide for using slash command prompts
- Architect MCP Guide - Complete guide to the architecture and rules MCP server
- Design Pattern Overview - High-level explanation of the design pattern system
- Rules Overview - Detailed guide to the coding rules system
- Contributing Guide - How to contribute to this project
- Publishing Guide - Release and versioning workflow
| Component | Requirement |
|---|---|
| Node.js | >= 18 (LTS recommended) |
| Git | >= 2.13.2 |
| pnpm | >= 9 (or use npm/yarn) |
Security patches are applied to non-EOL versions. Features are added to the latest version only.
We welcome contributions! Whether it's bug reports, feature requests, or pull requestsβall contributions are appreciated.
How to contribute:
- π΄ Fork the repository
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature) - π» Make your changes
- β
Run tests and linting (
pnpm test && pnpm lint) - π Commit your changes (follow conventional commits)
- π Push to your branch (
git push origin feature/amazing-feature) - π Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
AGPL-3.0 Β© AgiflowIO
Built with β€οΈ by the AgiflowIO team
- π Report Issues
- π¬ Discussions
- π Website