NitroStack Logo
/cli
/init

Init Command

Usage

Bash
npx @nitrostack/cli init [project-name] [options]
# or when globally installed:
nitrostack-cli init [project-name] [options]

If no project-name is passed, the CLI interactively prompts for project details.


Options

OptionDescriptionDefault
--preset <alias>Shorthand preset name (starter, enterprise-search, code-mode, pizzaz, oauth)starter
--template <name>Full template directory name (typescript-starter, typescript-enterprise-search, typescript-code-mode, typescript-pizzaz, typescript-oauth)typescript-starter
--description <desc>Description of the MCP server projectMy awesome MCP server
--author <author>Author string for package.json""
--skip-installSkip automatic npm install and widget dependency setupfalse
--forceOverwrite existing agent skill files if presentfalse

Template Matrix & Preset Aliases

Full Template NamePreset AliasPrimary Focus & Subsystems
typescript-starterstarterCalculator tool, Next.js widget, health checks, ConfigModule
typescript-enterprise-searchenterprise-searchBM25SearchTransform, @Controller namespacing, token reduction
typescript-code-modecode-modeQuickJS WebAssembly sandbox, worker thread pool, local script execution
typescript-pizzazpizzazMapbox map widget, multi-widget shop workflow, MCP resources
typescript-oauthoauthOAuth 2.1 PKCE, JWT verification, Duffel flights API, scope guards

Available Templates

1. typescript-starter (Preset: starter)

A clean, modular starter MCP server implementing:

  • Basic arithmetic calculator tool with an interactive Next.js widget (calculator-result).
  • File upload temperature conversion tool.
  • @McpApp and @Module architecture with ConfigModule.forRoot().
  • System health checks under health://checks.
Bash
npx @nitrostack/cli init my-calculator --preset starter

An enterprise service featuring progressive tool discovery:

  • Organizes finance, inventory, and support capabilities with @Controller namespacing.
  • Integrates BM25SearchTransform to collapse raw tools into synthetic search_tools and call_tool.
  • Reduces prompt token consumption by up to 98% for large enterprise toolsets.
  • Demonstrates alwaysVisible bypass for essential bootstrap tools.
Bash
npx @nitrostack/cli init enterprise-tools --preset enterprise-search

3. typescript-code-mode (Preset: code-mode)

An advanced execution server with isolated WebAssembly orchestration:

  • Integrates CodeModeTransform with QuickJS WebAssembly sandboxing.
  • Executes multi-step batch scripts in an isolated Node.js worker pool.
  • Exposes search, get_schema, and execute meta-tools.
  • Includes sample data processing pipeline script (src/scripts/sample-batch.js).
Bash
npx @nitrostack/cli init code-service --preset code-mode

4. typescript-pizzaz (Preset: pizzaz)

An advanced location & shop finder template showcasing rich UI widgets:

  • Multi-widget workflow (map view, shop listings, and order audit).
  • Dynamic Mapbox integration with @nitrostack/widgets.
  • Structured MCP resource and prompt providers.
Bash
npx @nitrostack/cli init pizza-finder --preset pizzaz

5. typescript-oauth (Preset: oauth)

Enterprise flight booking MCP server with end-to-end OAuth 2.1 authentication:

  • RFC 9068 JWT verification, PKCE flow, and Duffel flight booking API integration.
  • Built-in OAuthGuard and scope verification (createScopeGuard(['flights:read', 'flights:book'])).
  • Interactive flight selection widget with @nitrostack/widgets.
Bash
npx @nitrostack/cli init flight-booking --preset oauth

What It Creates

Text
my-project/
├── src/
│   ├── modules/            # Feature modules (controllers, tools, resources)
│   ├── health/             # Health check providers
│   ├── app.module.ts       # Root AppModule with @McpApp
│   ├── index.ts            # Application bootstrap (McpApplicationFactory)
│   └── widgets/            # Next.js interactive widget application
├── .env.example            # Environment template
├── tsconfig.json           # Modern TypeScript configuration
└── package.json            # Project dependencies (@nitrostack/core)

Additionally, init automatically installs NitroStack agent skills into .cursor/skills/, .claude/skills/, .codex/skills/, .gemini/skills/, .copilot/skills/, .opencode/skills/, and .agents/skills/.


Next Steps

  1. cd my-project
  2. Configure .env (copied automatically from .env.example)
  3. npm run dev to launch the MCP server and widget hot-reload server.