CLI
npx threefold <command>
The CLI is a thin client. Apart from check, which runs locally, it only talks to the API and builds each call from the server's own schema. It uses https://api.threefold.eco unless you point it elsewhere.
If npx threefold reports that the package does not exist, the npm package has not been published yet.
Commands
| Command | What it does |
|---|---|
threefold mcp install [--client <name>] [--key <k>] [--oauth] [--url <url>] [--dry-run] | Writes the threefold MCP entry for Claude Code, Codex, Cursor, Gemini CLI, OpenCode and VS Code. See Install and connect. threefold mcp on its own prints this usage; it does not start a server. |
threefold check [path] --markets <locales> [--runtime web --url <url>] [--json] [--upload] | Runs the i18n readiness check on your machine |
threefold login [--url <base>] | Browser sign-in (OAuth 2.1 with PKCE). Every other command then uses the saved login, and the token is refreshed when it expires. |
threefold login --key <api-key> [--url <base>] | Saves an API key (tf_live_… or tf_test_…) instead, with no browser |
threefold whoami | Shows who the saved login or environment key belongs to |
threefold discover "<task>" [--limit N] | Ranked endpoints for a task in plain language |
threefold schema <endpoint-id> | Inputs, coverage, limits and price for one endpoint |
threefold call <endpoint-id> --<input> <value> ... | Calls an endpoint. Lists are comma-separated. |
The login is saved in ~/.config/threefold/credentials.json (or under $XDG_CONFIG_HOME) with owner-only permissions, and it is only ever sent to the server it was issued for. With an API key the CLI uses the REST API. With a browser login it calls the same endpoints as MCP tools over /mcp, so call takes the MCP tool's argument names (schema lists them under mcp_input_schema).
Environment
| Variable | Meaning |
|---|---|
THREEFOLD_BASE_URL | API base URL. Default: the server you logged in to, else https://api.threefold.eco. |
THREEFOLD_API_KEY or THREEFOLD_TOKEN | A Bearer credential that overrides the saved login. With neither and no login, library reads go through the keyless tier. |
Example
npx threefold login
npx threefold discover "which finance apps win in Mexico but not Spain"
npx threefold schema compare_markets
npx threefold call compare_markets --from es --to mx --niche finance
call prints the response body. Exit codes: 0 on success, 1 on an HTTP error or a bad command, 2 on a usage error. check exits 1 when the verdict is incomplete.
Local MCP server
threefold has no command that starts an MCP server. The local stdio server is node mcp/server.mjs, run from a checkout of the threefold repository. It is the server where the check tool with what: "repo" scans local files on the machine it runs on; on the hosted server at https://api.threefold.eco/mcp, check returns the readiness criteria for the agent to apply directly (see Agent tools).