@nitrostack/cli 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,78 +1,64 @@
1
- # @nitrostack/cli
1
+ # @nitrostack/cli
2
2
 
3
- **The command-line powerhouse for NitroStack — Scaffold, generate, and develop MCP servers at the speed of light.**
3
+ Official NitroStack CLI for scaffolding, developing, and maintaining MCP server
4
+ projects.
4
5
 
5
- [![CLI Tool](https://img.shields.io/badge/NitroStack-CLI-orange?style=for-the-badge&logo=none)](https://nitrostack.ai)
6
- [![License](https://img.shields.io/badge/License-Apache%202.0-red?style=for-the-badge&logo=none)](https://opensource.org/licenses/Apache-2.0)
7
- [![Documentation](https://img.shields.io/badge/Docs-docs.nitrostack.ai-brightgreen?style=for-the-badge&logo=none)](https://docs.nitrostack.ai)
6
+ [![npm version](https://img.shields.io/npm/v/@nitrostack/cli?style=flat-square)](https://www.npmjs.com/package/@nitrostack/cli)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@nitrostack/cli?style=flat-square)](https://www.npmjs.com/package/@nitrostack/cli)
8
+ [![license](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
8
9
 
9
- `@nitrostack/cli` is the official toolkit for managing the NitroStack development lifecycle. From bootstrapping new projects with enterprise-ready templates to generating code and types, the CLI is your best friend when building MCP servers.
10
-
11
- ---
12
-
13
- ## ✨ Key Features
14
-
15
- - **🏗️ Instant Scaffolding**: Bootstrap new MCP servers from professional templates in seconds.
16
- - **🛠️ Code Generators**: Generate Modules, Tools, Guards, and Middleware with a single command.
17
- - **🔄 Live Reload**: Powerful dev server with hot-reloading for rapid development.
18
- - **🏷️ Type Generation**: Automatically generate TypeScript interfaces from your tool schemas.
19
- - **🎨 Visual Studio**: Launch the built-in NitroStudio to test inputs/outputs and preview widgets.
20
-
21
- ---
22
-
23
- ## 📦 Installation
24
-
25
- We recommend installing the CLI globally to access the `nitrostack-cli` command anywhere:
10
+ ## Installation
26
11
 
27
12
  ```bash
28
13
  npm install -g @nitrostack/cli
29
14
  ```
30
15
 
31
- ---
32
-
33
- ## 🚀 Commands Overview
16
+ ## Quick Start
34
17
 
35
- ### Initialize a New Project
36
18
  ```bash
37
- nitrostack-cli init my-project
19
+ nitrostack-cli init my-project --template typescript-starter
20
+ cd my-project
21
+ npm run dev
38
22
  ```
39
23
 
40
- ![nitrocli init](./assets/gif/nitrocli.gif)
24
+ ## Core Commands
41
25
 
42
- ### Start Development Server
43
26
  ```bash
27
+ nitrostack-cli init <project-name> [--template <name>]
44
28
  nitrostack-cli dev
45
- ```
46
-
47
- ### Scaffold a New Tool
48
- ```bash
49
- nitrostack-cli generate tool my-tool --module users
50
- ```
51
-
52
- ### Build for Production
53
- ```bash
54
29
  nitrostack-cli build
30
+ nitrostack-cli start
31
+ nitrostack-cli generate <type> [name] [--module <name>]
32
+ nitrostack-cli install
33
+ nitrostack-cli upgrade
55
34
  ```
56
35
 
57
- ---
58
-
59
- ## 🎨 NitroStudio
36
+ ## Templates
60
37
 
61
- NitroStudio works seamlessly with your projects. You don't even need to run a dev command—**opening your project in NitroStudio starts the server automatically.**
38
+ - `typescript-starter`
39
+ - `typescript-oauth`
40
+ - `typescript-pizzaz`
62
41
 
63
- ![NitroStudio](./assets/gif/nitrostudio-main.gif)
42
+ ## NitroStudio
64
43
 
65
- **[Download NitroStudio](https://nitrostack.ai/studio)**
44
+ NitroStudio is the recommended companion app for testing and debugging MCP
45
+ servers built with NitroStack.
66
46
 
67
- ---
47
+ - Download: <https://nitrostack.ai/studio>
48
+ - Studio: <https://nitrostack.ai/studio>
68
49
 
69
- ## 📖 Useful Links
50
+ ## Links
70
51
 
71
- - **[GitHub Repository](https://github.com/nitrocloudofficial/nitrostack)**
72
- - **[Documentation](https://docs.nitrostack.ai)**
73
- - **[Blog & Tutorials](https://blog.nitrostack.ai)**
74
- - **[NPM Package](https://www.npmjs.com/package/@nitrostack/cli)**
52
+ - CLI docs: <https://docs.nitrostack.ai/cli/overview>
53
+ - Full docs: <https://docs.nitrostack.ai>
54
+ - Source: <https://github.com/nitrocloudofficial/nitrostack>
55
+ - npm: <https://www.npmjs.com/package/@nitrostack/cli>
56
+ - Blog: <https://blog.nitrostack.ai>
75
57
 
76
- ---
58
+ ## Community
77
59
 
78
- Built with ⚡ by the **NitroStack Team**.
60
+ - Discord: <https://discord.gg/uVWey6UhuD>
61
+ - X: <https://x.com/nitrostackai>
62
+ - YouTube: <https://www.youtube.com/@nitrostackai>
63
+ - LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
64
+ - GitHub: <https://github.com/nitrostackai>
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAmOvD"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAgPvD"}
@@ -76,6 +76,17 @@ export async function buildCommand(options) {
76
76
  if (fs.existsSync(APP_DIR)) {
77
77
  findWidgetPages(APP_DIR);
78
78
  }
79
+ // Linked @nitrostack/widgets often has its own node_modules/react (e.g. v19) while this app
80
+ // uses v18. Esbuild resolves from the realpath of the symlinked package, so without aliases
81
+ // the widget bundle can contain two Reacts and render blank in MCP hosts. Next.js can use
82
+ // webpack aliases in next.config.js; production `nitrostack-cli build` mirrors that here.
83
+ const widgetsNm = path.join(widgetsPath, 'node_modules');
84
+ const widgetReactAliases = {
85
+ react: path.join(widgetsNm, 'react'),
86
+ 'react-dom': path.join(widgetsNm, 'react-dom'),
87
+ 'react/jsx-runtime': path.join(widgetsNm, 'react', 'jsx-runtime.js'),
88
+ 'react/jsx-dev-runtime': path.join(widgetsNm, 'react', 'jsx-dev-runtime.js'),
89
+ };
79
90
  // Bundle each widget
80
91
  for (const widget of widgetPages) {
81
92
  const tempEntry = path.join(OUT_DIR, `_temp_${widget.outputName}.jsx`);
@@ -118,7 +129,8 @@ function init() {
118
129
  jsx: 'automatic',
119
130
  jsxImportSource: 'react',
120
131
  external: [],
121
- nodePaths: [path.join(widgetsPath, 'node_modules')],
132
+ nodePaths: [widgetsNm],
133
+ alias: widgetReactAliases,
122
134
  define: {
123
135
  'process.env.NODE_ENV': '"production"'
124
136
  },
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAiUA,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHvG"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAgUA,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHvG"}
@@ -17,13 +17,12 @@ const TEMPLATES = {
17
17
  @Middleware()
18
18
  export class ${name} implements MiddlewareInterface {
19
19
  async use(context: ExecutionContext, next: () => Promise<any>) {
20
- // Before handler
21
- console.log(\`[\${context.toolName}] Started\`);
22
-
20
+ // Use context.logger instead of console.log — console breaks JSON-RPC over stdio in MCP mode
21
+ context.logger.info(\`[\${context.toolName}] Started\`);
22
+
23
23
  const result = await next();
24
-
25
- // After handler
26
- console.log(\`[\${context.toolName}] Completed\`);
24
+
25
+ context.logger.info(\`[\${context.toolName}] Completed\`);
27
26
 
28
27
  return result;
29
28
  }
@@ -293,7 +293,7 @@ async function createProjectFromScratch(targetDir, projectName, answers) {
293
293
  };
294
294
  fs.writeJSONSync(path.join(targetDir, 'tsconfig.json'), tsconfig, { spaces: 2 });
295
295
  fs.mkdirSync(path.join(targetDir, 'src'), { recursive: true });
296
- const indexTs = `import { createServer, createTool, z } from '@nitrostack/core';
296
+ const indexTs = `import { createServer, Tool, z } from '@nitrostack/core';
297
297
 
298
298
  const server = createServer({
299
299
  name: '${projectName}',
@@ -302,7 +302,7 @@ const server = createServer({
302
302
  });
303
303
 
304
304
  server.tool(
305
- createTool({
305
+ new Tool({
306
306
  name: 'hello',
307
307
  description: 'Say hello to someone',
308
308
  inputSchema: z.object({
@@ -347,7 +347,7 @@ npm run build
347
347
  npm start
348
348
  \`\`\`
349
349
 
350
- Built with [NitroStack](https://nitrostack.dev) ⚡
350
+ Built with [NitroStack](https://nitrostack.ai) ⚡
351
351
  `;
352
352
  fs.writeFileSync(path.join(targetDir, 'README.md'), readme);
353
353
  }
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAiBA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAwFvD"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAiBA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBA0FvD"}
@@ -35,6 +35,8 @@ export async function startCommand(options) {
35
35
  { label: 'Server', value: `http://localhost:${port}` },
36
36
  { label: 'Mode', value: 'Production' },
37
37
  { label: 'Transport', value: 'HTTP + STDIO (dual)' },
38
+ { label: 'Streamable HTTP', value: `http://localhost:${port}/mcp` },
39
+ { label: 'Legacy SDK SSE', value: `http://localhost:${port}/sse` },
38
40
  ...(hasBuiltWidgets ? [{ label: 'Widgets', value: 'Bundled' }] : []),
39
41
  ]));
40
42
  log('Starting server...', 'info');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitrostack/cli",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "CLI for NitroStack - Create and manage MCP server projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -68,4 +68,4 @@
68
68
  "url": "https://github.com/nitrocloudofficial/nitrostack/issues"
69
69
  },
70
70
  "homepage": "https://nitrostack.ai"
71
- }
71
+ }
@@ -1,3 +1,7 @@
1
+ # NitroStack Configuration
2
+ NITRO_LOG_LEVEL=info
3
+ NITROSTACK_APP_MODE=openai
4
+
1
5
  # OAuth 2.1 MCP Server Configuration
2
6
  # =============================================================================
3
7
  # TRANSPORT MODE (AUTO-CONFIGURED)
@@ -24,4 +28,4 @@ TOKEN_AUDIENCE=https://mcplocal
24
28
  # Expected token issuer (your Auth0 tenant domain with trailing slash)
25
29
  TOKEN_ISSUER=https://dev-5dt0utuk315713tjm.us.auth0.com
26
30
 
27
- DUFFEL_API_KEY=duffel_test_-w0wGDHB0M3DU9k-sBeUbxLqwcibUQqfEbjWDTKNnly
31
+ DUFFEL_API_KEY=your-duffel-api-key
@@ -1,70 +1,56 @@
1
- # ✈️ NitroStack Flight Booking
1
+ # NitroStack OAuth Template
2
2
 
3
- A production-ready template showcasing real-time flight search and booking with **Duffel API** integration. Learn how to build complex, authenticated MCP servers with high-impact visual widgets.
3
+ Template for OAuth 2.1-enabled MCP servers, including auth-aware tool patterns
4
+ and a production-style project structure.
4
5
 
5
- ## Features
6
+ ## What This Template Includes
6
7
 
7
- - **Real-time Search** Powered by the Duffel API (300+ airlines).
8
- - **Seat Selection** Interactive visual cabin maps with seat pickers.
9
- - **Secure Payments** — Simulated secure booking and confirmation flows.
10
- - **Advanced Auth** — Optional OAuth 2.1 support for protected MCP servers.
8
+ - OAuth 2.1 oriented project setup
9
+ - Tool and module structure for protected workflows
10
+ - Environment-based configuration (`.env`)
11
+ - Widget-ready frontend integration
11
12
 
12
- ---
13
-
14
- ## 🚀 Quick Start
15
-
16
- ### 1. Initialize Your Project
17
-
18
- ```bash
19
- npx nitrostack init my-flight-app --template typescript-oauth
20
- cd my-flight-app
21
- ```
22
-
23
- ### 2. Install Dependencies
13
+ ## Quick Start
24
14
 
25
15
  ```bash
26
- npm run install:all
16
+ npx @nitrostack/cli init my-oauth-app --template typescript-oauth
17
+ cd my-oauth-app
18
+ npm run dev
27
19
  ```
28
20
 
29
- ### 3. Get NitroStudio
21
+ ## Configuration
30
22
 
31
- Experience the visual seat selection and flight search as your users would see it.
23
+ 1. Copy `.env.example` to `.env`
24
+ 2. Configure OAuth provider values
25
+ 3. (Optional) Configure provider-specific API keys
32
26
 
33
- ![NitroStudio](../../../../assets/gif/nitrostudio-main.gif)
27
+ For detailed setup, see `OAUTH_SETUP.md`.
34
28
 
35
- 1. **Download NitroStudio**: [nitrostack.ai/studio](https://nitrostack.ai/studio)
36
- 2. **Open Project**: Launch NitroStudio and select your project folder.
29
+ ## Common Commands
37
30
 
38
- ---
39
-
40
- ## ⚙️ Configuration
41
-
42
- ### 1. Duffel API Key
43
-
44
- You need a free Duffel API key to see live flight data:
31
+ ```bash
32
+ npm run dev
33
+ npm run build
34
+ npm start
35
+ ```
45
36
 
46
- 1. Sign up at [duffel.com](https://duffel.com/).
47
- 2. Copy your **Test Token** from the dashboard.
48
- 3. Create `.env` from the example:
49
- ```bash
50
- cp .env.example .env
51
- ```
52
- 4. Update `DUFFEL_API_KEY` in your `.env`.
37
+ ## NitroStudio
53
38
 
54
- ### 2. OAuth (Optional)
39
+ Use NitroStudio to test auth flows, inspect tool requests, and validate behavior.
55
40
 
56
- For production scenarios requiring user authentication, refer to [OAUTH_SETUP.md](./OAUTH_SETUP.md).
41
+ - Download: <https://nitrostack.ai/studio>
42
+ - Studio: <https://nitrostack.ai/studio>
57
43
 
58
- ---
44
+ ## Links
59
45
 
60
- ## 🛠️ Commands
46
+ - Docs: <https://docs.nitrostack.ai>
47
+ - OAuth docs: <https://docs.nitrostack.ai/sdk/typescript/11-oauth-authentication>
48
+ - Main repository: <https://github.com/nitrocloudofficial/nitrostack>
61
49
 
62
- - `npm run dev` — Start the development ecosystem.
63
- - `npm run build` — Bundle TypeScript and widgets for deployment.
64
- - `npm run upgrade` — Keep NitroStack core up to date.
50
+ ## Community
65
51
 
66
- ---
67
- **Official Resources**
68
- - [Website](https://nitrostack.ai)
69
- - [Docs](https://docs.nitrostack.ai)
70
- - [Duffel API](https://duffel.com/docs)
52
+ - Discord: <https://discord.gg/uVWey6UhuD>
53
+ - X: <https://x.com/nitrostackai>
54
+ - YouTube: <https://www.youtube.com/@nitrostackai>
55
+ - LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
56
+ - GitHub: <https://github.com/nitrostackai>
@@ -19,7 +19,8 @@
19
19
  "dotenv": "^16.3.1",
20
20
  "@duffel/api": "^4.21.0",
21
21
  "axios": "^1.7.9",
22
- "date-fns": "^4.1.0"
22
+ "date-fns": "^4.1.0",
23
+ "@modelcontextprotocol/ext-apps": ">=0.1.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@nitrostack/cli": "^1",
@@ -12,7 +12,8 @@
12
12
  "next": "^14.2.5",
13
13
  "react": "^18.3.1",
14
14
  "react-dom": "^18.3.1",
15
- "@nitrostack/widgets": "^1"
15
+ "@nitrostack/widgets": "^1",
16
+ "@modelcontextprotocol/ext-apps": ">=0.1.0"
16
17
  },
17
18
  "devDependencies": {
18
19
  "@types/node": "^20",
@@ -1,3 +1,7 @@
1
+ # NitroStack Configuration
2
+ NITRO_LOG_LEVEL=info
3
+ NITROSTACK_APP_MODE=openai
4
+
1
5
  # Mapbox Configuration (Optional)
2
6
  # =============================================================================
3
7
  # The map widget uses Mapbox GL for interactive maps.
@@ -1,79 +1,54 @@
1
- # 🍕 NitroStack Pizza Shop Finder
1
+ # NitroStack Pizzaz Template
2
2
 
3
- A high-performance interactive template showcasing discovery with maps, lists, and detailed views. This template demonstrates the **NitroStack Widget SDK** for building beautiful, tool-driven visual experiences.
3
+ Template focused on rich, interactive widget experiences (map/list/detail flows)
4
+ using the NitroStack widget SDK patterns.
4
5
 
5
- ## Features
6
+ ## What This Template Includes
6
7
 
7
- - **Mapbox Integration** Interactive maps with custom markers.
8
- - **Real-time State** Shared state between server and widgets.
9
- - **Responsive Layouts** Auto-adapting heights and display modes (Inline, PiP, Fullscreen).
10
- - **Interactive UI** — Sorting, filtering, and favorites persistence.
8
+ - Widget-heavy module and UI structure
9
+ - Interactive examples for advanced frontends
10
+ - Optional map provider integration pattern
11
+ - Studio-friendly development workflow
11
12
 
12
- ---
13
-
14
- ## 🚀 Quick Start
15
-
16
- ### 1. Initialize Your Project
17
-
18
- ```bash
19
- npx nitrostack init my-pizza-app --template typescript-pizzaz
20
- cd my-pizza-app
21
- ```
22
-
23
- ### 2. Install Dependencies
13
+ ## Quick Start
24
14
 
25
15
  ```bash
26
- npm run install:all
16
+ npx @nitrostack/cli init my-pizzaz-app --template typescript-pizzaz
17
+ cd my-pizzaz-app
18
+ npm run dev
27
19
  ```
28
20
 
29
- ### 3. Step Up NitroStudio
30
-
31
- NitroStudio provides the best experience for visual testing of widgets and maps.
32
-
33
- ![NitroStudio](../../../../assets/gif/nitrostudio-main.gif)
34
-
35
- 1. **Download NitroStudio**: [nitrostack.ai/studio](https://nitrostack.ai/studio)
36
- 2. **Open Project**: Launch NitroStudio and select your project folder.
37
- 3. **View Maps**: Use the chat or visual tools to explore your pizza shops.
38
-
39
- ---
21
+ ## Optional Configuration
40
22
 
41
- ## ⚙️ Configuration
23
+ If this project uses a map provider, configure API tokens in widget `.env` files
24
+ as documented in the template source.
42
25
 
43
- ### Mapbox (Optional)
44
-
45
- To enable the interactive map, add your Mapbox token:
46
-
47
- 1. Get a free token at [mapbox.com](https://www.mapbox.com/).
48
- 2. Create `src/widgets/.env` and add:
49
- ```env
50
- NEXT_PUBLIC_MAPBOX_TOKEN=pk.your_token_here
51
- ```
52
-
53
- ---
54
-
55
- ## 🛠️ Commands
26
+ ## Common Commands
56
27
 
57
28
  ```bash
58
- # Start dev server with Studio integration
59
29
  npm run dev
60
-
61
- # Build for production
62
30
  npm run build
63
-
64
- # Manage widgets directly
31
+ npm start
65
32
  npm run widget <command>
66
33
  ```
67
34
 
68
- ## 📁 Structure
35
+ ## NitroStudio
36
+
37
+ NitroStudio is the fastest way to test and debug interactive widget output.
38
+
39
+ - Download: <https://nitrostack.ai/studio>
40
+ - Studio: <https://nitrostack.ai/studio>
41
+
42
+ ## Links
43
+
44
+ - Docs: <https://docs.nitrostack.ai>
45
+ - Widgets docs: <https://docs.nitrostack.ai/sdk/typescript/ui/widgets>
46
+ - Main repository: <https://github.com/nitrocloudofficial/nitrostack>
69
47
 
70
- - `src/modules/pizzaz/` — Core logic and pizza shop data.
71
- - `src/widgets/app/pizza-map/` — Next.js Map widget.
72
- - `src/widgets/app/pizza-list/` — Filterable shop list.
73
- - `src/widgets/app/pizza-shop/` — Detail view with actions.
48
+ ## Community
74
49
 
75
- ---
76
- **Official Resources**
77
- - [Website](https://nitrostack.ai)
78
- - [Docs](https://docs.nitrostack.ai)
79
- - [Download Studio](https://nitrostack.ai/studio)
50
+ - Discord: <https://discord.gg/uVWey6UhuD>
51
+ - X: <https://x.com/nitrostackai>
52
+ - YouTube: <https://www.youtube.com/@nitrostackai>
53
+ - LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
54
+ - GitHub: <https://github.com/nitrostackai>
@@ -25,7 +25,8 @@
25
25
  "dependencies": {
26
26
  "@nitrostack/core": "^1",
27
27
  "zod": "^3.22.4",
28
- "dotenv": "^16.3.1"
28
+ "dotenv": "^16.3.1",
29
+ "@modelcontextprotocol/ext-apps": ">=0.1.0"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@nitrostack/cli": "^1",
@@ -1,6 +1,20 @@
1
1
  import { ToolDecorator as Tool, Widget, ExecutionContext, Injectable, z } from '@nitrostack/core';
2
2
  import { PizzazService } from './pizzaz.service.js';
3
3
 
4
+ /**
5
+ * Pizzaz widget metadata for ChatGPT / MCP Apps (CSP for Unsplash images, optional border).
6
+ * For production ChatGPT submission, set `domain` to your app HTTPS origin per OpenAI Apps SDK docs.
7
+ */
8
+ function pizzazWidget(route: string) {
9
+ return {
10
+ route,
11
+ prefersBorder: true,
12
+ csp: {
13
+ resourceDomains: ['https://images.unsplash.com'],
14
+ },
15
+ };
16
+ }
17
+
4
18
  const ShowMapSchema = z.object({
5
19
  filter: z.enum(['open_now', 'top_rated', 'all']).optional().describe('Filter to apply'),
6
20
  });
@@ -67,7 +81,7 @@ export class PizzazTools {
67
81
  }
68
82
  }
69
83
  })
70
- @Widget('pizza-map')
84
+ @Widget(pizzazWidget('pizza-map'))
71
85
  async showPizzaMap(args: z.infer<typeof ShowMapSchema>, ctx: ExecutionContext) {
72
86
  let shops;
73
87
 
@@ -122,7 +136,7 @@ export class PizzazTools {
122
136
  }
123
137
  }
124
138
  })
125
- @Widget('pizza-list')
139
+ @Widget(pizzazWidget('pizza-list'))
126
140
  async showPizzaList(args: z.infer<typeof ShowListSchema>, ctx: ExecutionContext) {
127
141
  const shops = this.pizzazService.getShopsFiltered(args);
128
142
 
@@ -180,7 +194,7 @@ export class PizzazTools {
180
194
  }
181
195
  }
182
196
  })
183
- @Widget('pizza-shop')
197
+ @Widget(pizzazWidget('pizza-shop'))
184
198
  async showPizzaShop(args: z.infer<typeof ShowShopSchema>, ctx: ExecutionContext) {
185
199
  const shop = this.pizzazService.getShopById(args.shopId);
186
200
 
@@ -13,6 +13,7 @@
13
13
  "react": "^18.3.1",
14
14
  "react-dom": "^18.3.1",
15
15
  "@nitrostack/widgets": "^1",
16
+ "@modelcontextprotocol/ext-apps": ">=0.1.0",
16
17
  "mapbox-gl": "^3.0.1",
17
18
  "framer-motion": "^10.16.16",
18
19
  "lucide-react": "^0.294.0"
@@ -1,7 +1,3 @@
1
- # NitroStack Starter Environment
2
- # =============================================================================
3
- # Add your environment variables here.
4
- # =============================================================================
5
-
6
- # Example:
7
- # API_KEY=your_api_key_here
1
+ # NitroStack Configuration
2
+ NITRO_LOG_LEVEL=info
3
+ NITROSTACK_APP_MODE=openai
@@ -1,89 +1,49 @@
1
- # NitroStack Starter Template
1
+ # NitroStack Starter Template
2
2
 
3
- **The definitive starter template** Learn the fundamentals of the NitroStack MCP framework with a clean, well-documented calculator example.
3
+ Minimal template for learning NitroStack fundamentals with a calculator-focused
4
+ MCP server and basic widgets.
4
5
 
5
- ## 🎯 What's Inside
6
+ ## What This Template Includes
6
7
 
7
- This template is designed to showcase core NitroStack features with zero friction:
8
+ - `calculator` module with tools, resources, and prompts
9
+ - TypeScript + Zod validation setup
10
+ - Widget-ready project structure
11
+ - Production-friendly npm scripts
8
12
 
9
- - **Modular Architecture** — Clean separation of concerns with a dedicated Calculator module.
10
- - **Interactive Tools** — A `calculate` tool for performing arithmetic operations.
11
- - **Dynamic Resources** — A `calculator://operations` resource for discovering capabilities.
12
- - **Prompt Library** — Context-aware prompts for guiding users.
13
- - **Pre-built UI Widgets** — Beautiful, high-performance UI components for results and listings.
14
- - **Production-Ready** — Uses TypeScript, Zod for validation, and best-in-class logging.
15
-
16
- ---
17
-
18
- ## 🚀 Quick Start
19
-
20
- ### 1. Initialize Your Project
21
-
22
- If you haven't already, scaffold your project using the NitroStack CLI:
13
+ ## Quick Start
23
14
 
24
15
  ```bash
25
- npx nitrostack init my-server --template typescript-starter
16
+ npx @nitrostack/cli init my-server --template typescript-starter
26
17
  cd my-server
18
+ npm run dev
27
19
  ```
28
20
 
29
- ### 2. Install Dependencies
30
-
31
- Install all project dependencies (including the visual widget SDK) in one step:
32
-
33
- ```bash
34
- npm run install:all
35
- ```
36
-
37
- ### 3. Get NitroStudio
38
-
39
- NitroStudio is the recommended visual client for running, testing, and managing your NitroStack projects.
40
-
41
- ![NitroStudio](../../../../assets/gif/nitrostudio-main.gif)
42
-
43
- 1. **Download NitroStudio**: [nitrostack.ai/studio](https://nitrostack.ai/studio)
44
- 2. **Open Project**: Launch NitroStudio and open this project folder.
45
- 3. **Run**: NitroStudio handles the rest!
46
-
47
- ---
48
-
49
- ## 🛠️ Development
50
-
51
- If you prefer using the command line:
21
+ ## Common Commands
52
22
 
53
23
  ```bash
54
- # Start development server (Server + Widgets + Studio)
55
24
  npm run dev
56
-
57
- # Build for production
58
25
  npm run build
59
-
60
- # Start production server
61
26
  npm start
62
27
  ```
63
28
 
64
- ## 📁 Project Structure
29
+ ## NitroStudio
65
30
 
66
- ```text
67
- src/
68
- ├── modules/
69
- │ └── calculator/
70
- │ ├── calculator.module.ts # @Module definition
71
- │ ├── calculator.tools.ts # @Tool implementations
72
- │ ├── calculator.resources.ts # @Resource definitions
73
- │ └── calculator.prompts.ts # @Prompt templates
74
- ├── widgets/ # Visual SDK UI components
75
- ├── app.module.ts # Root application module
76
- └── index.ts # Server entry point
77
- ```
31
+ NitroStudio is the recommended way to test and debug this template during
32
+ development.
33
+
34
+ - Download: <https://nitrostack.ai/studio>
35
+ - Studio: <https://nitrostack.ai/studio>
78
36
 
79
- ## 🎨 Next Generation MCP
37
+ ## Links
80
38
 
81
- NitroStack is more than just a server; it's a full-stack MCP ecosystem.
39
+ - Docs: <https://docs.nitrostack.ai>
40
+ - Templates docs: <https://docs.nitrostack.ai/templates/01-starter-template>
41
+ - Main repository: <https://github.com/nitrocloudofficial/nitrostack>
82
42
 
83
- - **Website**: [nitrostack.ai](https://nitrostack.ai)
84
- - **Documentation**: [docs.nitrostack.ai](https://docs.nitrostack.ai)
85
- - **Discord**: [Join our community](https://nitrostack.ai/discord)
43
+ ## Community
86
44
 
87
- ---
88
- **Happy Coding! 🎉**
89
- Build something amazing with NitroStack.
45
+ - Discord: <https://discord.gg/uVWey6UhuD>
46
+ - X: <https://x.com/nitrostackai>
47
+ - YouTube: <https://www.youtube.com/@nitrostackai>
48
+ - LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
49
+ - GitHub: <https://github.com/nitrostackai>
@@ -16,7 +16,8 @@
16
16
  "dependencies": {
17
17
  "dotenv": "^16.3.1",
18
18
  "@nitrostack/core": "^1",
19
- "zod": "^3.22.4"
19
+ "zod": "^3.22.4",
20
+ "@modelcontextprotocol/ext-apps": ">=0.1.0"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@nitrostack/cli": "^1",
@@ -12,7 +12,8 @@
12
12
  "next": "^14.2.5",
13
13
  "react": "^18.3.1",
14
14
  "react-dom": "^18.3.1",
15
- "@nitrostack/widgets": "^1"
15
+ "@nitrostack/widgets": "^1",
16
+ "@modelcontextprotocol/ext-apps": ">=0.1.0"
16
17
  },
17
18
  "devDependencies": {
18
19
  "@types/node": "^20",