markets CLI
A single static binary for macOS, Linux, and Windows that puts markets.sh in your terminal: run data agents and background tasks, read your connected data sources, and plug everything into any MCP client. Built for humans and AI agents alike — stable output contracts, JSON on stdout, meaningful exit codes.
Install
curl -fsSL https://markets.sh/install | shInstalls to ~/.local/bin/markets after verifying the binary's SHA-256 checksum. Self-updates with markets update. Binaries for all platforms are listed in the release manifest.
Sign in
markets loginOpens your browser for OAuth sign-in (the CLI discovers the authorization server and registers itself — no configuration). For headless or CI use, create an API key under account → API keys and use markets login --key msh_live_… or the MARKETS_API_KEY environment variable.
Quickstart
markets list # every tool available to your account
markets call company_search '{"q": "Siemens", "country": "DE"}'
markets task listmarkets list --json prints each tool's full JSON Schema input contract — the authoritative reference for call and task create.
Run agents and wait for results
Tasks are server-side agent runs. With --await, the CLI behaves like any long-running unix process: progress on stderr, the final result as JSON on stdout, outcome in the exit code. AI agents: run it as a background shell and wait for it to exit — no status polling needed; markets task await TASK_ID re-attaches to an already-running task.
markets task create '{
"name": "German industrials",
"query": "Find 10 German industrial companies; write company_name, website, hq_city per row.",
"type": "smart_list_builder",
"workbook_id": 7, "output_sheet_name": "Companies",
"mcp_servers": ["basic", "hypertable", "task_tools", "company_data"]
}' --await- exit
0— task finished successfully - exit
2— task failed, was cancelled, or timed out server-side - exit
3— your--timeoutwait limit elapsed first; the task keeps running — re-attach withmarkets task await TASK_ID
Task types: free_form_agent (open-ended research), smart_list_builder (find entities, one row each), sheet_row_agent (run one agent per row of an existing sheet — enrichment at scale).
Connected data sources
Everything you connect on the Connections page (Google Calendar, YouTube, HubSpot, Pipedrive, LinkedIn, …) is reachable through three broker tools — the surface stays the same no matter how many sources you connect:
markets call connections_list
markets call connection_describe '{"connector": "calendar"}'
markets call connection_fetch '{"connector": "calendar", "resource": "events", "operation": "list", "params": {}}'Use with MCP clients (Claude, Cursor, …)
markets mcp serve runs a Model Context Protocol server on stdio that forwards to markets.sh with your credentials — works in every MCP client, including ones that only support the stdio transport:
claude mcp add markets -- markets mcp serveClients that speak MCP over HTTP can skip the CLI and connect directly to https://markets.sh/api/mcp with an Authorization: Bearer API key.
Command reference
markets login Sign in (browser OAuth, or --key for API keys)
markets logout Remove stored credentials
markets whoami Show the authenticated profile
markets list [--json] List available tools (+ JSON Schemas)
markets call TOOL [JSON_ARGS] Call a tool
markets task list List your tasks
markets task create JSON [--await] Create and start a task
markets task run TASK_ID [--await] Re-run an existing task
markets task status TASK_ID Latest run status + row progress
markets task await TASK_ID Block until the task finishes
markets mcp serve MCP server on stdio
markets update [--check] Self-update to the latest release
markets help COMMAND Detailed help with examplesOutput contract everywhere: results (JSON where applicable) on stdout; progress and errors on stderr. Configuration lives in ~/.markets-sh/config.json; --url / --key flags and MARKETS_API_URL / MARKETS_API_KEY env vars override it.
More
- REST API documentation
- Installer script (inspect before piping to sh)