Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command-Line Reference

You don't normally launch nimlangserver by hand — editors and AI tools start it automatically based on their configuration. This page is a reference for when you do need direct control: debugging, socket mode, scripting, or integrating with a tool not covered by the existing configs.

Synopsis

nimlangserver [options]

Options

OptionDescription
--lspRun in LSP server mode. This is the default.
--mcpRun in MCP server mode.
--stdioUse stdio transport. This is the default for both modes.
--socketUse socket transport.
--port=<port>Port to listen on when using socket transport. If omitted, a free port is chosen automatically and printed to the console.
--clientProcessId=<pid>Exit automatically when the process with the given PID terminates. Editors pass this to tie the server lifetime to their own.
--version, -vPrint version information and exit.
--help, -hPrint a help message and exit.

Mode and transport combinations

nimlangserver                          # LSP over stdio (default)
nimlangserver --lsp --socket           # LSP over socket, auto port
nimlangserver --lsp --socket --port=6000

nimlangserver --mcp                    # MCP over stdio
nimlangserver --mcp --socket           # MCP over socket, auto port
nimlangserver --mcp --socket --port=6001

stdio is the right choice when the client launches nimlangserver as a subprocess (the normal case for both editors and AI agents).

socket is useful when the server and client run in separate environments — for example, a native Windows editor connecting to a server running inside WSL, or when you want a single running server to be reachable from multiple clients.