Build Production-ReadyMCP Servers
The open-source polyglot framework for Model Context Protocol. Build in TypeScript or Python with Code Mode sandbox orchestration, stateless tasks, and zero-session edge scalability.
Zero Network Bloat. Up to 98% Fewer Tokens. Pure Execution.
Traditional MCP forces models to ingest hundreds of tool schemas and hop through serialized network round-trips. Code Mode transforms this: an in-memory QuickJS WebAssembly sandbox where AI models write and execute orchestration scripts atomically.
Up to 98% Reduction
Collapses 100+ raw tool schemas (15,000–40,000 tokens) down to 3 meta-tools (~300 tokens).
Single Network Hop
Chains multi-step pipelines in a single atomic request instead of 6+ serialized HTTP calls over the wire.
In-Memory Speed
Tools resolve in-memory inside the pre-warmed worker pool with zero HTTP serialization latency.
Sandboxed Safety
Strict WebAssembly memory caps, 15s CPU timeout, and zero Node.js/system API leakage.
Interactive Architecture Comparison
See how Code Mode transforms multi-step AI tool interactions in real numbers.
// Model writes JS; NitroStack evaluates in QuickJS WASM sandbox
async function executePipeline() {
// 1. In-memory micro-tool execution (zero network latency)
const items = await callTool('inventory_check_stock', { warehouseId: 'W-9' });
// 2. Filter & aggregate without sending intermediate payloads to the model
const urgent = items.records.filter(i => i.qty < i.reorderThreshold);
const audit = await callTool('finance_audit_ledger', {
skus: urgent.map(u => u.sku)
});
// 3. Return ONLY the computed insight to the agent
return {
reorderCount: urgent.length,
estimatedCost: audit.totalProjectedCost,
recommendedBatchId: audit.batchReference
};
}
return await executePipeline();The model searches tools with search, fetches parameter schemas with get_schema, and dispatches the script to execute.
process, fs, or native sockets.search(query)
Queries tool catalog keywords and descriptions without returning bulky schemas. The model discovers relevant tools dynamically on demand.
get_schema(tool_names)
Fetches exact Zod or Pydantic parameter schemas only for the specific tools needed for the pending workflow script.
execute(script)
Evaluates JavaScript in the isolated QuickJS WebAssembly worker. Executes in-memory tool chains and returns only the final computed summary.
Engineered for Stateless Scale & Enterprise Security
Say goodbye to sticky TCP sessions and hanging SSE streams. NitroStack brings horizontally scalable cloud architecture to the Model Context Protocol.
Stateless by Default
Zero session headers (Mcp-Session-Id eliminated). Any server replica can answer any tool call, enabling horizontal autoscaling across Kubernetes, serverless, and edge runtimes.
- No sticky load balancing or session affinity needed
- Deploys seamlessly on AWS Lambda, Cloudflare, or Docker
- Zero memory bloat from dangling TCP connections
// Atomic per-request evaluation
POST /mcp HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
{ "jsonrpc": "2.0", "method": "tools/call", ... }Background Tasks Engine
Long-running operations decoupled from HTTP connection lifetimes. Pluggable TaskStore backends coordinate async executions across distributed nodes.
- Pluggable stores: Redis, PostgreSQL, DynamoDB, Memory
- Survives pod restarts and load balancer re-routing
- Standardized task polling and status elicitation
@Tool({ name: 'process_dataset' })
async process(input, ctx: ExecutionContext) {
return ctx.taskManager.startTask({
status: 'working',
statusMessage: 'Processing 100k items...'
});
}Edge Caching & Zero-Body Routing
Cache discovery metadata at edge CDNs for ~2ms responses. Enterprise API gateways inspect Mcp-Method and Mcp-Name headers without JSON body parsing.
- Sub-2ms server/discover via CDN cache hints
- Rate-limit individual expensive tools at gateway layer
- Envoy, Kong, and AWS ALB native header routing
Mcp-Method: tools/call Mcp-Name: financial_summary Cache-Control: public, max-age=300
Polyglot: TypeScript & Python
Complete architectural parity between TypeScript and Python. Choose your team's preferred language with zero compromise on features or developer experience.
- TypeScript: Zod schemas, NestJS-inspired decorators
- Python: Pydantic v2 models, uv lockfiles, nitrostack-py CLI
- Automated agent skills scaffolding (.cursor, .claude)
# Python CLI $ pip install nitrostack $ nitrostack-py init my-server --template python-starter # TypeScript CLI $ npx @nitrostack/cli init my-server --preset code-mode
Defense-in-Depth Security
Zero-trust authentication evaluated per request. Client ID Metadata Documents (CIMD) eliminate dynamic client registration sprawl with strict anti-mixup protection.
- RFC 9207 Issuer Anti-Mixup & JWKS validation
- SSRF protection on external resource resolvers
- Declarative @Guard decorators protecting sensitive tools
@UseGuards(OAuthGuard)
@Tool({ name: 'transfer_funds' })
async transfer(input, ctx: ExecutionContext) {
// Verified user claims in ctx.auth
}Transforms Pipeline Engine
Intercept tools/list and tools/call requests. Dynamically reshape catalogs, gate tenant-specific capabilities, or attach BM25 semantic discovery.
- BM25SearchTransform for progressive tool discovery
- VisibilityTransform for tenant or role capability gating
- CodeModeTransform for sandboxed QuickJS execution
@McpApp({
transforms: [
new VisibilityTransform(),
new CodeModeTransform({ workerPoolSize: 4 })
]
})Why Developers Choose NitroStack
The patterns you already trust, the efficiency breakthroughs AI models demand, and the stateless cloud primitives enterprise production requires.
Code Mode Orchestration
Slash token consumption by up to 98% and collapse multi-step tool calls into a single network round-trip. AI models execute JavaScript inside an isolated QuickJS WebAssembly sandbox with sub-20ms local chaining.
First-Class Polyglot DX
Complete architectural parity across TypeScript and Python. Use decorators, Zod or Pydantic schemas, dependency injection, and hot reload. One framework, two world-class ecosystems.
Stateless by Default
Fully aligned with MCP 2026-07-28. Zero sticky sessions, zero dangling SSE streams. Long-running tasks decouple cleanly via pluggable Redis and Postgres TaskStores with sub-2ms edge CDN caching.
Enterprise Defense-in-Depth
OAuth 2.1, Client ID Metadata Documents (CIMD), SSRF protection, and RFC 9207 anti-mixup validation evaluated per request. Declarative guards protect tools before execution ever begins.
From Zero to Production in Minutes
Pick your language. Scaffold with one command. Run locally with hot reload and test in NitroStudio.
Step 1
Step 1
Initialize your project
Scaffold a production-ready MCP server with our official CLI. Pick starter templates or activate Code Mode presets with a single command.
$ npx @nitrostack/cli init my-server --preset code-mode $ cd my-server && npm run dev
Step 2
Step 2
Define tools, resources & prompts
Declare tools with type-safe schemas. TypeScript uses Zod validation; Python uses Pydantic v2 models with automatic JSON schema generation.
@Tool({
name: 'calculate_tax',
description: 'Compute regional tax rates',
inputSchema: z.object({
amount: z.number(),
state: z.string().length(2)
})
})
async calculateTax(input) {
return { tax: input.amount * 0.08 };
}Step 3
Step 3
Configure Modules & Stateless Scale
Group controllers cleanly into modules, configure stateless HTTP transport, or attach Code Mode transforms in TypeScript.
@McpApp({
transforms: [
new CodeModeTransform({
workerPoolSize: 4,
memoryLimitMb: 128,
timeoutMs: 15000,
allowDestructive: false
})
],
taskStore: new RedisTaskStore({ url: process.env.REDIS_URL })
})
@Module({ controllers: [TaxController] })
export class AppModule {}Step 4
Step 4
Test visually & deploy
Inspect tools, run guest sandbox scripts, and verify auth tokens in NitroStudio before deploying to serverless or Kubernetes.
$ npx @nitrostack/cli dev # Connected to NitroStudio at http://localhost:4567/mcp-test-server
Your next MCP server starts here.
Open source. Polyglot TypeScript and Python. Code Mode and Stateless ready.