/intro

Introduction to NitroStack v3.0

Welcome to NitroStack v3.0! This guide will help you get started with building production-ready MCP (Model Context Protocol) servers using our revolutionary decorator-based architecture.

What is NitroStack?

NitroStack is a NestJS-inspired framework for building MCP servers with TypeScript. It provides powerful abstractions, excellent developer experience, and production-ready features out of the box.

Why NitroStack v3.0?

šŸŽÆ Decorator-Based Development

Write clean, declarative code:

@Tool({
  name: 'get_user',
  description: 'Get user by ID'
})
@UseGuards(JWTGuard)
async getUser(input: any, ctx: ExecutionContext) {
  return await this.userService.find(input.id);
}

šŸ—ļø Modular Architecture

Organize code into self-contained modules:

@Module({
  name: 'users',
  controllers: [UserTools],
  providers: [UserService]
})
export class UserModule {}

šŸ’‰ Dependency Injection

Built-in DI container for better testability:

export class UserTools {
  constructor(private userService: UserService) {}  // Auto-injected!
}

šŸ” Declarative Guards

Simple, powerful authentication:

@UseGuards(JWTGuard, AdminGuard)  // Stack multiple guards

šŸŽØ Beautiful Widgets

Create stunning UIs for your tools:

@Widget('user-profile')  // Attach UI component

Key Features

  • āœ… Decorator-Based - @Tool, @Module, @Widget, @UseGuards
  • āœ… Modular - Organize code logically
  • āœ… DI Container - Dependency injection for testability
  • āœ… Guards System - Declarative authentication
  • āœ… Middleware & Interceptors - Transform requests/responses
  • āœ… Pipes - Validate and transform inputs
  • āœ… Exception Filters - Centralized error handling
  • āœ… Caching - @Cache() decorator
  • āœ… Rate Limiting - @RateLimit() decorator
  • āœ… Event System - @OnEvent() for event-driven code
  • āœ… Type Generation - Auto-generate types from tools
  • āœ… Studio - Next.js-based visual testing
  • āœ… AI Integration - Test with GPT-4 or Gemini

Who is NitroStack for?

Perfect for:

  • Developers building MCP servers for AI applications
  • Teams needing modular, maintainable code
  • Projects requiring authentication and authorization
  • Apps needing beautiful UI components
  • Production systems requiring caching, rate limiting, etc.

Use Cases:

  • šŸ›ļø E-commerce chatbots
  • šŸ“Š Data analysis tools
  • šŸ”§ DevOps automation
  • šŸ“ Content management
  • šŸ¦ Financial services
  • šŸ„ Healthcare systems
  • šŸŽ“ Educational platforms

Architecture Overview

NitroStack v3.0 uses a layered architecture:

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│         Your Application           │
│  (@McpApp + @Module + @Tool)       │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│         NitroStack Core              │
│  (Decorators, DI, Guards, etc.)    │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│     Model Context Protocol SDK     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

What's New in v3.0?

Breaking Changes

v3.0 introduces a complete architectural redesign:

Before (v2.x):

const server = createServer({...});

server.tool(createTool({
  name: 'get_user',
  handler: async (input) => {...}
}));

After (v3.0):

@Module({...})
export class UserTools {
  @Tool({ name: 'get_user' })
  async getUser(input: any) {...}
}

Migration Guide

Migration guide coming soon!

Getting Started

Ready to dive in? Let's go!

  1. Installation - Install NitroStack CLI
  2. Quick Start - Create your first server
  3. Core Concepts - Learn the fundamentals

Community & Support

License

NitroStack is MIT licensed.


Next: Installation →