Next-Generation MCP SDK for Gen AI

Build Cutting-Edge
Gen AI Applications

with Modern SDK

NitroStack brings decorator-based architecture, dependency injection, and modular design to the Model Context Protocol. Build scalable, production-ready AI-powered applications that push the boundaries of what's possible.
Part of the Nitrocloud ecosystem.

Live Code
|
Connected to MCP Server
Quick Install
Ready
$npm install -g nitrostack
$nitrostack init my-server --template typescript-auth
Latest version: v3.0.0

Built for the Next Generation

Everything you need to build world-class Gen AI applications, batteries included.

Decorator-Based

Clean, declarative code with TypeScript decorators. @Tool, @Widget, @UseGuards - write less, do more.

@Tool({ name: 'analyze' })

Modular Architecture

Organize code into feature modules with @Module. Clear separation of concerns for scalable applications.

@Module({ imports: [...] })

Enterprise Security

Built-in JWT, OAuth 2.1, and API Key authentication with declarative guards. Secure by default.

@UseGuards(JWTGuard)

Dependency Injection

Constructor injection for clean, testable code. Built-in DI container manages all dependencies.

constructor(private service: Service)

Beautiful UI Widgets

Create stunning Next.js widgets with @Widget decorator. Rich UIs that integrate seamlessly with AI models.

@Widget('dashboard')

Built-in Studio

Next.js-based testing environment with AI chat (GPT-4, Gemini), tool testing, and widget preview.

nitrostack studio

Advanced Features

Caching, rate limiting, middleware, interceptors, pipes, event system - all with decorators.

@Cache({ ttl: 300 })

Type Generation

Auto-generate TypeScript types from Zod schemas. Full type safety for widgets and tools.

z.object({ ... })

Production Ready

Health checks, logging, error handling, testing utilities. Docker support and deployment guides.

@HealthCheck()

Simple. Elegant. Powerful.

Write clean, maintainable code with our decorator-based API

src/modules/weather/weather.tools.ts
TypeScript
Active
import { Tool, Widget, Cache, UseGuards, ExecutionContext } from 'nitrostack';
import { z } from 'zod';
import { JWTGuard } from '../../guards/jwt.guard.js';

export class WeatherTools {
  constructor(private weatherService: WeatherService) {}

  @Tool({
    name: 'get_weather',
    description: 'Get current weather for a location',
    inputSchema: z.object({
      location: z.string().describe('City name'),
      units: z.enum(['celsius', 'fahrenheit']).optional(),
    }),
    examples: {
      request: { location: 'New York', units: 'celsius' },
      response: { temp: 22, conditions: 'Sunny', humidity: 65 }
    }
  })
  @Widget('weather-card')           // 🎨 Beautiful UI
  @Cache({ ttl: 300 })              // ⚡ 5-min cache
  @UseGuards(JWTGuard)              // 🔐 Auth required
  async getWeather(input: any, ctx: ExecutionContext) {
    const weather = await this.weatherService.fetch(input.location);
    ctx.logger.info('Weather fetched', { location: input.location });
    return {
      temperature: weather.temp,
      conditions: weather.conditions,
      humidity: weather.humidity,
    };
  }
}
MCP Protocol v1.0
Type-safe
32 lines

Decorator-Based Development

NitroStack brings a revolutionary decorator-based architecture to the Model Context Protocol. Write clean, declarative code that's easy to understand and maintain.

  • @Tool - Define tools with schema validation
  • @Widget - Attach beautiful UI components
  • @UseGuards - Declarative authentication
  • @Cache - Automatic response caching
  • @Module - Organize code into features

Production Features

Built-in features that take your Gen AI application from prototype to production-ready in minutes, not weeks.

  • JWT, OAuth 2.1, API Key authentication
  • Middleware, interceptors, pipes for request/response
  • Built-in caching and rate limiting
  • Event system with @OnEvent decorator
  • Health checks and monitoring
  • Testing utilities for unit and integration tests
0%
Type Safe
<5min
Setup Time
0+
Decorators
Possibilities
template
init

Start with a Template

Production-ready templates to kickstart your Gen AI project

Starter Template

Simple calculator example. Perfect for learning NitroStack fundamentals. No authentication, no database - just pure MCP goodness.

  • One module with tools, resources, prompts
  • Two beautiful UI widgets
  • Health checks
  • Perfect for beginners
$ nitrostack init my-calc --template typescript-starter
Learn More

E-commerce Template

Full-featured e-commerce server with JWT auth, SQLite database, and 20+ tools. Production-ready architecture.

  • JWT authentication with guards
  • 5 feature modules (auth, products, cart, orders)
  • 20+ UI widgets
  • SQLite with seed data
$ nitrostack init my-shop --template typescript-auth
Learn More

Ready to Build the Future?

Join developers worldwide who are building cutting-edge Gen AI applications with NitroStack.
Part of the Nitrocloud ecosystem.