█

AI/TLDR

Buy me a coffee
Buy me a coffee

NitroStack

A decorator-driven TypeScript framework for MCP servers, with dependency injection, auth and React widgets built in

Agent Frameworks & BuildersOpen source
Language
TypeScript
License
Apache-2.0
$npx @nitrostack/cli init my-server
IN SHORT

What is NitroStack?

NitroStack is an open-source TypeScript framework for building Model Context Protocol (MCP) servers — the backends that expose tools, resources and prompts to AI assistants. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in TypeScript and licensed Apache-2.0. To get started: scaffold a new project.

Overview

NitroStack is an open-source TypeScript framework for building Model Context Protocol (MCP) servers — the backends that expose tools, resources and prompts to AI assistants. Instead of wiring a server together by hand from a protocol SDK, you declare each tool as a decorated class method with a Zod input schema, and the framework handles registration, validation and the server runtime. Its README describes it as an opinionated, batteries-included framework, and the design borrows heavily from enterprise backend frameworks: modules, a dependency-injection container, guards, interceptors, pipes and exception filters.

The NitroStudio desktop app home screen, with Add Server and Generate buttons above a searchable list of recent MCP projects
NitroStudio's launcher: open or add an MCP server project, or generate a new one.NitroStack README ↗

The project is split into three npm packages: `@nitrostack/core` (decorators, DI and the server runtime), `@nitrostack/cli` (scaffolding, the dev server and code generators) and `@nitrostack/widgets` (a React SDK for interactive tool-output UIs). A companion desktop app, NitroStudio, is downloaded separately from the NitroStack site; you open a project folder in it to run the dev server, execute tools, inspect request and response payloads, preview widgets and chat with the server through a built-in AI assistant.

Two things distinguish it from a bare MCP SDK. Authentication is part of the framework — JWT, OAuth 2.1 and API keys are supported out of the box and applied per tool with guards. And a tool can carry a widget: a React component attached with a `@Widget` decorator, so the result renders as an interactive UI rather than raw JSON. A single decorator stack on one method can therefore define the API, validate input, enforce auth, cache the result and pick its UI.

Servers can speak STDIO for local clients, Streamable HTTP, and legacy SSE for older clients, and the CLI builds a production bundle you can run with Node.js, Docker or PM2. The framework is licensed Apache-2.0.

What it does

  • Decorator-driven definitions: tools, resources and prompts are declared on TypeScript classes with Zod schemas for end-to-end type safety
  • Modules and a dependency-injection container with singleton, transient and scoped lifecycles
  • Built-in JWT, OAuth 2.1 and API-key authentication, applied per tool with guards
  • An enterprise-style middleware pipeline: guards, interceptors, pipes, exception filters and caching
NitroStudio testing a show_pizza_list tool: input fields for price and rating filters on the left and the tool's widget rendered on the right as a pizza shop card with photo, rating, address and opening hours
Testing a tool in NitroStudio: fill in the inputs, execute, and see the result rendered through its React widget.NitroStack README ↗
  • UI widgets: React components attached to tool outputs so a result renders as an interactive view
  • A CLI that scaffolds projects from templates, runs a hot-reloading dev server, generates tools, modules and guards, and builds a production bundle

Getting started

NitroStack needs Node.js 20.18 or newer and npm 9 or newer. The CLI scaffolds a working MCP server you can run immediately and connect to any MCP-compatible client.

Scaffold a new project

The CLI's `init` command creates the project; the docs list `typescript-starter`, `typescript-pizzaz` and `typescript-oauth` templates. The result has an entry point in `src/index.ts`, a root module in `src/app.module.ts`, feature modules under `src/modules/` and widget components under `src/widgets/`.

bashbash
npx @nitrostack/cli init my-server
A macOS terminal running nitrostack-cli init to scaffold a new NitroStack project
Scaffolding a project with the NitroStack CLI.NitroStack README ↗

Start the dev server

Install dependencies and start developing; the dev server hot-reloads as you edit. If the port is taken, the docs suggest `nitrostack-cli dev --port 3002`.

bashbash
cd my-server
npm install
npm run dev

Define a tool

A tool is a decorated method with a Zod input schema. Guards, caching and a widget are further decorators on the same method.

tsts
import { McpApp, Module, ToolDecorator as Tool, z, ExecutionContext } from '@nitrostack/core';

export class SearchTools {
  @Tool({
    name: 'search_products',
    description: 'Search the product catalog',
    inputSchema: z.object({
      query: z.string().describe('Search query'),
      maxResults: z.number().default(10)
    })
  })
  @UseGuards(ApiKeyGuard)
  @Cache({ ttl: 300 })
  @Widget('product-grid')
  async search(input: { query: string; maxResults: number }, ctx: ExecutionContext) {
    ctx.logger.info('Searching products', { query: input.query });
    return this.productService.search(input.query, input.maxResults);
  }
}

Generate code and test it in NitroStudio

With the CLI installed globally, `generate` scaffolds tools, resources, prompts, modules, guards, middleware and more. Then download NitroStudio from nitrostack.ai/studio and open the project folder to execute tools, inspect payloads and chat with your server.

bashbash
npm i -g @nitrostack/cli
nitrostack-cli generate tool <name>

Build and run for production

`nitrostack-cli build` writes a production build to `dist/`, which the deployment checklist runs with Node.js directly (or under Docker or PM2).

bashbash
nitrostack-cli build
node dist/index.js

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Reach for it when an MCP server is growing past a handful of tools and you want modules, dependency injection and middleware instead of one long file of handlers
  • Reach for it when your MCP tools need real authentication — JWT, OAuth 2.1 or API keys — enforced per tool
  • Reach for it when tool results should render as interactive UI in the client, such as a product grid, rather than as plain JSON
  • Reach for it when your team already writes decorator-and-DI TypeScript backends and wants the same structure for AI-facing services

How NitroStack compares

NitroStack alongside other open-source agent frameworks & builders tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
DeepSeek Harness★ 289kDeepSeek AI's open-source agent harness (dsh), built on Cordis, where models, tools, skills, sessions, sandboxes, storage and the UI are all plugins composed through profiles.
AutoGPT★ 188kOne of the earliest autonomous agent projects, now a platform for building and running agents from reusable blocks and workflows.
DeerFlow★ 86kByteDance's open-source super agent harness built on LangGraph: skills, sub-agents, sandboxes, a filesystem and long-term memory for long-horizon research, coding and content tasks.
nanobot★ 50.5kLightweight self-hosted personal AI agent framework in Python, with a WebUI, terminal and chat-app channels, tools, long-term memory, MCP and scheduled automations.
LangGraph★ 45.6kA library from the LangChain team for building stateful, graph-based agent workflows with explicit control over steps, memory, and human-in-the-loop checkpoints.
Agno★ 43.3kA fast Python framework (formerly Phidata) for building agents with memory, tools, and multimodal inputs, plus a runtime for deploying them in production.
AgentGPT★ 36.3kAgentGPT lets you name a custom AI, give it a goal, and watch it plan tasks, run them, and learn from the results, all from a web browser.
NitroStack★ 2.6kA decorator-driven TypeScript framework for MCP servers, with dependency injection, auth and React widgets built in