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
| Option | Description | Default |
|---|---|---|
--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 project | My awesome MCP server |
--author <author> | Author string for package.json | "" |
--skip-install | Skip automatic npm install and widget dependency setup | false |
--force | Overwrite existing agent skill files if present | false |
Template Matrix & Preset Aliases
| Full Template Name | Preset Alias | Primary Focus & Subsystems |
|---|---|---|
typescript-starter | starter | Calculator tool, Next.js widget, health checks, ConfigModule |
typescript-enterprise-search | enterprise-search | BM25SearchTransform, @Controller namespacing, token reduction |
typescript-code-mode | code-mode | QuickJS WebAssembly sandbox, worker thread pool, local script execution |
typescript-pizzaz | pizzaz | Mapbox map widget, multi-widget shop workflow, MCP resources |
typescript-oauth | oauth | OAuth 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.
@McpAppand@Modulearchitecture withConfigModule.forRoot().- System health checks under
health://checks.
Bash
npx @nitrostack/cli init my-calculator --preset starter
2. typescript-enterprise-search (Preset: enterprise-search)
An enterprise service featuring progressive tool discovery:
- Organizes finance, inventory, and support capabilities with
@Controllernamespacing. - Integrates
BM25SearchTransformto collapse raw tools into syntheticsearch_toolsandcall_tool. - Reduces prompt token consumption by up to 98% for large enterprise toolsets.
- Demonstrates
alwaysVisiblebypass 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
CodeModeTransformwith QuickJS WebAssembly sandboxing. - Executes multi-step batch scripts in an isolated Node.js worker pool.
- Exposes
search,get_schema, andexecutemeta-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
OAuthGuardand 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
cd my-project- Configure
.env(copied automatically from.env.example) npm run devto launch the MCP server and widget hot-reload server.