nitrostack
v1.0.70
Published
NitroStack - Build powerful MCP servers with TypeScript
Maintainers
Readme
NitroStack ⚡
Build production‑ready MCP (Model Context Protocol) servers with TypeScript — fast.
NitroStack is a batteries‑included toolkit for creating real, shippable MCP servers. It combines a clean, declarative programming model with a built‑in visual Studio, authentication modules, widget UI system, hot‑reload dev workflow, and production‑grade tooling — all focused on one goal: let you build great MCP servers with minimal ceremony.
Why NitroStack
Developers typically struggle with:
- Boilerplate and wiring: scattered logic, ad‑hoc conventions, manual glue code
- Auth and security: JWT, OAuth 2.1 (PKCE), API keys, token validation, scopes, multi‑auth
- Testing UX: no clean way to visually exercise tools, resources, prompts
- Performance & reliability: caching, rate limiting, predictable runtime pipeline
- DX & iteration: hot reload, consistent CLIs, starter templates, type generation
NitroStack solves these pain points out of the box.
What you get (inbuilt capabilities)
- Declarative building blocks
@Tool,@Widget,@Resource,@Prompt,@Module@UseGuards,@UseMiddleware,@UseInterceptors,@UsePipes,@UseFilters
- Authentication modules (drop‑in)
JWTModule(simple JWT)OAuthModule(OAuth 2.1 with PKCE, discovery, scopes, dual transport ready)ApiKeyModule(service‑to‑service keys)- Multi‑auth patterns (either/both) supported via guards
- Studio (built‑in visual test bench)
- Run and debug tools, browse resources, test prompts, preview widgets
- AI chat integration and auto‑form generation from schemas
- Widgets UI system
- Attach Next.js pages to tools with
@Widgetfor instant interactive demos
- Attach Next.js pages to tools with
- Runtime pipeline
- Middleware, Interceptors, Pipes, Exception Filters for predictable request flow
- Performance controls
@Cache()and@RateLimit()decorators
- Type safety
- CLI generates types from tool definitions for use across code and widgets
- Dev experience
- Hot reload, templates, code generators, dual transport (STDIO + HTTP) for flexibility
Requirements
- Node.js: >= 18.0.0 (LTS versions recommended)
- npm: >= 9.0.0
✅ Tested on Node.js 18.x, 20.x, and 22.x
Install
npm i -g nitrostackOr use once without global install:
npx nitrostack init my-mcp-serverQuick Start (3 steps)
- Initialize a project
nitrostack init my-server --template typescript-starter
cd my-server
npm install- Start the dev environment
nitrostack devStudio opens at http://localhost:3000 (widgets at http://localhost:3001).
- Add your first tool
// src/modules/hello/hello.tools.ts
import { Tool, z, ExecutionContext, Module } from 'nitrostack';
export class HelloTools {
@Tool({
name: 'say_hello',
description: 'Greets a user',
inputSchema: z.object({ name: z.string() })
})
async sayHello(input: { name: string }, ctx: ExecutionContext) {
return { message: `Hello, ${input.name}!` };
}
}
@Module({ name: 'hello', controllers: [HelloTools] })
export class HelloModule {}Register the module in app.module.ts, save — and call the tool in Studio.
Authentication (inbuilt)
- JWTModule: Simple and fast token auth for user/session flows
- OAuthModule: Full OAuth 2.1 with PKCE, discovery endpoints, scopes, and dual‑transport support (STDIO for MCP + HTTP for OAuth metadata)
- ApiKeyModule: Issue and validate API keys for services and automations
- Multi‑auth: compose guards so a tool can require one or multiple schemes
Studio (visual workflow)
- AI chat to drive tools
- Auto‑generated forms from schemas
- Resource browser & prompt explorer
- Widget previews connected to live tool outputs
CLI highlights
# Create a project from templates
nitrostack init <name> --template typescript-starter
nitrostack init <name> --template typescript-oauth
# Dev / Build
nitrostack dev
nitrostack build
# Generators
nitrostack generate module <name>
nitrostack generate tool <name> --module <module>
nitrostack generate guard <name>
nitrostack generate middleware <name>
nitrostack generate interceptor <name>
nitrostack generate pipe <name>
nitrostack generate filter <name>
# Types from tools
nitrostack generate types --output src/types/generated-tools.tsTemplates
typescript-starter— clean starter with widgets and example toolstypescript-auth— JWT auth flows and end‑to‑end examplestypescript-auth-api-key— API key auth patterns and multi‑authtypescript-oauth— OAuth 2.1 (PKCE, discovery, scopes) with dual transport
Use any template with nitrostack init and start iterating immediately.
Production
npm run build
NODE_ENV=production node dist/index.jsConsider enabling caching, rate limits, structured logging, and health checks for production. See the docs for deployment recipes and checklists.
Documentation
Full docs: https://docs.nitrostack.ai/
- Getting started, SDK guides, decorators, CLI reference, templates, deployment
License
Apache License 2.0 — see LICENSE. © 2025 Abhishek Pandit
Links
- Website:
https://nitrostack.ai/ - Docs:
https://docs.nitrostack.ai/ - GitHub:
https://github.com/abhishekpanditofficial/nitrostack - npm:
https://www.npmjs.com/package/nitrostack - Model Context Protocol:
https://modelcontextprotocol.io
Build boldly. Ship MCP servers people love. ⚡
