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.
npm run devnpm start| Transport | How it works | Best for |
|---|---|---|
| STDIO | The client starts your server as a child process and talks over standard input and output | Local, single-user clients: Claude Desktop, Cursor, NitroStudio |
| HTTP | Your server listens on a port; clients send requests to its /mcp endpoint | Remote servers, web clients, and several clients at once |
| Dual | STDIO and HTTP at the same time | Serving 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.
@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.
