Skip to content

API reference · More

The vectro CLI

The vectro serve command serves a folder of data files over HTTP, PostgreSQL and Flight SQL; vectro-mcp serves it to AI assistants.

NodeBrowserEdge

The vectrojs package installs two commands. vectro serve makes every data file in a folder a table and serves it with serve, servePg and serveFlight, with no code. vectro-mcp is the MCP server for AI assistants. Both need Node 20 or later.

npx vectro serve --root ./data                 # or: npm install -g vectrojs, then vectro serve ...
npx vectro-mcp --root ./data

vectro serve

vectro serve --root <folder> [options]

Every CSV, TSV, JSON-lines, Arrow / Feather and .vectro file directly in the folder becomes a table named after its file (loaded as openTables loads it). HTTP is on by default; PostgreSQL and Flight SQL start when given a port. All of them share one set of tables.

Flag Default Meaning
--root <folder> the current folder The data folder.
--host <address> 127.0.0.1 The address every server listens on. 0.0.0.0 listens on every network, and then PostgreSQL and Flight SQL need --password.
--quiet off No log lines on stderr.

HTTP and OData (Excel, Power BI’s Web connector, Google Sheets, pandas):

Flag Default Meaning
--port <n> $PORT, else 8787 The HTTP port.
--no-http off No HTTP server.
--token <secret> $VECTRO_TOKEN Requests need Authorization: Bearer <secret> (or Basic with the secret as the password, or &token=).
--cors off Allow pages from other sites.

PostgreSQL (Power BI, Tableau, Metabase, Grafana, psql):

Flag Default Meaning
--pg <port> off Also speak the PostgreSQL protocol on this port (5433 is usual).
--user <name> any name The only user name accepted.
--password <secret> $VECTRO_PG_PASSWORD The password. Without one, only this machine may connect.
--auth <method> scram scram, md5 or password.
--tls-cert <file>, --tls-key <file> off Encrypted connections; both are needed.
--database <name> vectro The database name reported.
--log-queries off Print every statement clients send.

Arrow Flight SQL (pandas, Polars, DuckDB through ADBC):

Flag Default Meaning
--flight <port> off Also serve Flight SQL on this port (grpc://host:port). Takes --user, --password, --tls-cert, --tls-key, --database and --log-queries as above.

On start it logs each server’s address and the tables with their row counts. POST /reload on the HTTP server reads the folder again. Ctrl-C (SIGINT) or SIGTERM closes the servers and exits. A flag without its value prints the usage and exits with status 2; a failure to start (a port in use, a missing folder, --host 0.0.0.0 with --pg and no password) prints vectro: <reason> and exits with status 1. vectro, vectro help and vectro --help print the usage; any other command prints it and exits with status 2. Unknown flags are ignored.

npx vectro serve --root ~/data --pg 5433 --user me --password secret
curl 'http://127.0.0.1:8787/sql?q=SELECT region, COUNT(*) AS n FROM orders GROUP BY 1&format=csv'
psql -h 127.0.0.1 -p 5433 -U me vectro
npx vectro serve --root ~/data --no-http --flight 31337 --host 0.0.0.0 --password secret

See Serving and BI tools for connecting each tool.

vectro-mcp

vectro-mcp [--root <folder>]

The Model Context Protocol server: it speaks JSON-RPC 2.0 over stdin and stdout (one message per line) with no dependencies, so an assistant such as Claude can load data files and query them with Vectro, locally, on every core. It also runs as node <package>/mcp/server.mjs.

Flag Default Meaning
--root <folder> the current folder The only folder the assistant may read files from. Paths outside it, through links included, are refused.

It logs to stderr ([vectro-mcp] ready; data folder ...), never to stdout, and exits when stdin closes. Calls are handled one at a time, in order.

# Claude Code
claude mcp add vectro -- npx vectro-mcp --root ~/data
{ "mcpServers": { "vectro": { "command": "npx", "args": ["vectro-mcp", "--root", "/Users/you/data"] } } }

The second is for Claude Desktop’s claude_desktop_config.json. The tools it offers are listed in MCP tools; setup for other clients is in MCP server.