Cursor Command
Overview
The cursor command automatically configures your NitroStack MCP server inside Cursor IDE, allowing AI agents in Cursor to immediately discover and invoke your tools.
It writes configuration directly to .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global).
Usage
Bash
npx @nitrostack/cli cursor [options]
# or using alias:
nitrostack-cli c [options]
When run without flags in an interactive terminal, the command displays a guided prompt to select the connection type and scope.
Options
| Option | Shorthand | Description | Default |
|---|---|---|---|
--global | -g | Install configuration globally to ~/.cursor/mcp.json | false |
--local | -l | Install configuration locally to .cursor/mcp.json | true |
--type <type> | -t | Connection type: command, legacy-sse, or streamable-http | command |
--url <url> | -u | Custom HTTP URL for legacy-sse or streamable-http | Auto-generated |
--port <port> | -p | Server port used to generate default HTTP URL | 3000 |
--force | Overwrite existing configuration if server name already exists | false |
Connection Types
1. Direct Command (command) — Default for Local Dev
Cursor spawns the MCP server directly as a subprocess over standard I/O (STDIO):
JSON
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["/path/to/my-server/dist/index.js"]
}
}
}
Bash
nitrostack-cli cursor --type command
2. Streamable HTTP (streamable-http)
Connects Cursor to a running NitroStack server using the modern Streamable HTTP endpoint:
JSON
{
"mcpServers": {
"my-server": {
"url": "http://localhost:3000/mcp"
}
}
}
Bash
nitrostack-cli cursor --type streamable-http --port 3000
3. Legacy SSE (legacy-sse)
Connects Cursor to the legacy Server-Sent Events endpoint:
JSON
{
"mcpServers": {
"my-server": {
"url": "http://localhost:3000/sse"
}
}
}
Bash
nitrostack-cli cursor --type legacy-sse --port 3000
Next Steps
- Dev Command — Running your server with hot reload
- Dual Transport Guide — Understanding STDIO and HTTP transports