Core Concepts

Transports

How messages travel between a client and your server, and which transport to use.

A transport is the channel that carries MCP messages. Your tools don't change between transports; you choose one based on where the server runs and who connects to it.

STDIOnpm run dev
Local clientClaude Desktop, Cursor
NitroStack serverstdin and stdout
HTTPnpm start
Remote clientsWeb apps, many at once
NitroStack serverlocalhost:3000/mcp
The same server code, reached two ways.
TransportHow it worksBest for
STDIOThe client starts your server as a child process and talks over standard input and outputLocal, single-user clients: Claude Desktop, Cursor, NitroStudio
HTTPYour server listens on a port; clients send requests to its /mcp endpointRemote servers, web clients, and several clients at once
DualSTDIO and HTTP at the same timeServing local and remote clients from one process

What the CLI uses

npm run dev runs your server over STDIO, because local tools like NitroStudio and Cursor start it as a process. The widget dev server runs separately on port 3001.

npm start builds the project and serves it over HTTP at http://localhost:3000/mcp. Use this to test the way a deployed server behaves, or to call it with curl as shown in the Quickstart.

Setting it in code

You can fix the transport in @McpApp. If you leave it out, NitroStack picks one from the environment, as described above.

src/app.module.ts
@McpApp({
  module: AppModule,
  server: { name: 'my-server', version: '1.0.0' },
  transport: {
    type: 'dual', // 'stdio' | 'http' | 'dual'
    http: { port: 3000, host: '0.0.0.0', basePath: '/mcp' },
  },
})

Protect HTTP servers

A STDIO server is only reachable by the process that started it. An HTTP server is reachable by anything that can reach its port, so add authentication before exposing it beyond your machine.

Go deeper

On this page