A comprehensive Node.js application template with CLI, Web, and MCP (Model Context Protocol) support
This template provides a modern, production-ready foundation for building Node.js applications with multiple interfaces (CLI, Web, and AI agent integration).
- π― Unified CLI - Single executable with three modes: CLI, Web, and MCP
- ποΈ Monorepo structure with pnpm workspaces
- π¦ TypeScript with strict mode
- π¨ Biome for lightning-fast linting and formatting
- π¦ Rolldown for optimized CLI bundling
- π§ͺ Vitest for unit testing
- π€ MCP support for AI agent integration
- π CI/CD with GitHub Actions
- π³ Devcontainer ready
- π Dependabot configured
This monorepo contains:
@template/core- Core business logic and shared utilities@template/cli- Unified CLI with three modes:- CLI mode - Command-line interface with Commander.js
- Web mode - Express REST API server
- MCP mode - Model Context Protocol server for AI agents
@template/web- Web UI components (Preact, used by CLI web mode)@template/mcp- MCP server implementation (used by CLI mcp mode)
- Click "Use this template" on GitHub
- Clone your new repository
- Update package names in all
package.jsonfiles - Update repository URLs
- Update README with your project details
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint and format
pnpm lint
pnpm formatThe CLI supports three modes:
cd packages/cli
pnpm build
# Basic commands
node dist/index.js greet "World"
node dist/index.js info
node dist/index.js --help# Start web server with REST API
node dist/index.js web --port 3000
# Or use bundled version
node dist/bundled.js web# Start MCP server for AI agent integration
node dist/index.js mcp
# Or use bundled version
node dist/bundled.js mcpcd packages/cli
pnpm build:bundle
# Creates a single bundled executable at dist/bundled.js
# This includes all three modes in one filemin-node-app-template/
βββ .devcontainer/ # Dev container configuration
βββ .github/
β βββ workflows/ # CI/CD pipelines
β β βββ ci.yml # Continuous Integration
β β βββ release.yml # Release pipeline
β βββ dependabot.yml # Dependency updates
βββ docs/ # Documentation
β βββ README.md # Documentation index
β βββ design.md # Architecture & design
β βββ development.md # Development guide
βββ packages/
β βββ core/ # Core package
β β βββ src/
β β βββ test/
β β βββ package.json
β βββ cli/ # CLI package
β β βββ src/
β β βββ test/
β β βββ scripts/ # Build scripts
β β βββ package.json
β βββ web/ # Web package
β β βββ src/
β β β βββ server.ts # Express server
β β β βββ client/ # Preact UI
β β βββ test/
β β βββ package.json
β βββ mcp/ # MCP package
β βββ src/
β βββ test/
β βββ package.json
βββ .gitignore
βββ .biomeignore
βββ biome.json # Linting & formatting
βββ package.json # Root package
βββ pnpm-workspace.yaml # Workspace config
βββ tsconfig.base.json # Base TypeScript config
βββ AGENTS.md # AI agent guidelines
βββ CHANGELOG.md
βββ CONTRIBUTING.md
βββ LICENSE
βββ README.md
- Language: TypeScript 5.x
- Package Manager: pnpm 10.x
- Build Tool: TypeScript Compiler (tsc)
- Bundlers:
- Rolldown (CLI single-file bundle)
- Vite (Web frontend)
- Testing: Vitest
- Linting/Formatting: Biome
- CLI Framework: Commander.js
- Web Framework: Express + Preact
- AI Integration: Model Context Protocol SDK
For CI/CD to work properly, configure these secrets:
NPM_TOKEN- For publishing packages to npmGITHUB_TOKEN- Automatically provided by GitHub
- Package Names: Update
namein allpackage.jsonfiles - Repository URLs: Update
repository.urlin allpackage.jsonfiles - License: Update LICENSE file if needed
- Styling: Customize Biome rules in
biome.json - Build: Adjust TypeScript config in
tsconfig.base.json
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test -- --watch
# Run tests with coverage
pnpm test -- --coverage
# Test specific package
cd packages/core
pnpm test# Build all packages
pnpm build
# Build CLI bundle
cd packages/cli
pnpm build:bundle
# Build web for production
cd packages/web
pnpm buildThe template includes automated publishing via GitHub Actions:
- Update version in
packages/cli/package.json - Update
CHANGELOG.md - Commit changes
- Create and push tag:
git tag v1.0.0 && git push origin v1.0.0 - GitHub Actions will automatically publish to npm
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details
This template is designed for:
- Developers who want a solid foundation for Node.js projects
- Projects that need multiple interfaces (CLI, Web, AI)
- Teams that value type safety and developer experience
- Applications that benefit from monorepo structure
- Projects requiring AI agent integration via MCP
Built with β€οΈ using modern TypeScript tooling