NodeTool exposes a single TypeScript HTTP + WebSocket server runtime built on Node.js. The same process serves REST API routes, WebSocket workflow execution endpoints, and OpenAI-compatible /v1 routes.
The server is implemented in the @nodetool/websocket package (packages/websocket/src/server.ts).
Key Modules
server.ts– HTTP/WebSocket server entry point. Registers all API routes and starts listeners.unified-websocket-runner.ts– Handles WebSocket connections for workflow execution and chat.http-api.ts– Core REST API routes (workflows, jobs, assets, etc.).models-api.ts– Model management and provider registration.settings-api.ts– Settings and configuration endpoints.storage-api.ts– File upload and asset storage endpoints.mcp-server.ts– Model Context Protocol (MCP) server integration.openai-api.ts– OpenAI-compatible/v1/chat/completionsendpoint.debug-api.ts– Debug endpoints (local development only).
Running the Server
# Development (from repo root)
npm run build:packages
npm run dev:server # PORT=7777 HOST=127.0.0.1 node packages/websocket/dist/server.js
# Or directly:
PORT=7777 HOST=127.0.0.1 node packages/websocket/dist/server.js
# Via CLI:
nodetool serve --host 127.0.0.1 --port 7777
Configuration
The server is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
PORT |
7777 |
HTTP listen port |
HOST |
127.0.0.1 |
Bind address |
DB_PATH |
~/.local/share/nodetool/nodetool.sqlite3 |
SQLite database path |
ANTHROPIC_API_KEY |
— | Anthropic API key |
OPENAI_API_KEY |
— | OpenAI API key |
GEMINI_API_KEY |
— | Google Gemini API key |
OLLAMA_API_URL |
http://localhost:11434 |
Ollama server URL |
Health Check
GET /health
Returns 200 OK with { status: "ok" } when the server is ready.
For mode and deployment setup, see Deployment Guide and Authentication.