struct mcp install --client <claude|cursor|codex> | Add Struct to Claude Code, Cursor or Codex using only the server URL; the agent signs in to Struct itself. For Codex it writes [mcp_servers.struct] to ~/.codex/config.toml (or $CODEX_HOME/config.toml); then run codex mcp login struct. --print prints the command, link or configuration instead. |
struct mcp url | Print the Struct MCP server URL for any other MCP client. |
struct connect <provider> | Connect Datadog, Grafana, Loki, Prometheus, Axiom, Better Stack, Mezmo, SumoLogic or Render with its API key, for example DATADOG_API_KEY=… DATADOG_APP_KEY=… struct connect datadog --site us5. Struct checks the key with the tool, saves it and tests the saved connection; connection.health says whether the access Struct needs is there. struct connections catalog <provider> lists each tool’s flags and environment variables. Secrets come from environment variables, stdin (--api-key-stdin and the like, or --stdin) or a hidden prompt; a secret given as a flag works with a warning. --name and --instructions are optional. Connecting the same account again updates its connection ("created": false). Needs permission to change connections. |
struct connect postgres|planetscale|bigquery | Connect a database, for example PGPASSWORD=… struct connect postgres --host db.example.com --database app --user struct_reader, PLANETSCALE_PASSWORD=… struct connect planetscale --host … --database … --user … or struct connect bigquery --project my-project --key-file sa.json. Struct connects to the database first and saves nothing if that fails (credentials_rejected, missing_access, connection_failed). Passwords come from environment variables; --connection-string-env <NAME> reads a whole PostgreSQL connection string from the variable you name (any secret takes --<flag>-env <NAME>). --test-only checks the values and saves nothing. For an SSH tunnel, --trust-host-key SHA256:… names the bastion key you checked; without it the command exits 3 with the fingerprint Struct read. BigQuery needs the Pro plan (plan_required). See PostgreSQL, PlanetScale and BigQuery. |
struct connect snowflake | Connect Snowflake with a key pair Struct makes and keeps (you never see the private key). First struct connect snowflake --print-commands --account myorg-myaccount [--user STRUCT_READER] [--warehouse COMPUTE_WH] prints the setup SQL with the public key and a key pair ID (sfk_…, valid 24 hours); run all of it in Snowsight as an admin. Then struct connect snowflake --account myorg-myaccount --user STRUCT_READER --key-pair sfk_… --name "Snowflake" tests the key and saves the connection (nothing is saved if the test fails; run the SQL and try again with the same key pair). Without --key-pair (or SNOWFLAKE_KEY_PAIR) it exits 2 with missing_fields. --test-only checks without saving. See Snowflake. |
struct connections rotate <id> --print-commands, struct connections rotate <id> --key-pair sfk_… | Replace a Snowflake connection’s key without downtime. --print-commands makes a new key pair for that connection and prints the ALTER USER … SET RSA_PUBLIC_KEY_2 (or RSA_PUBLIC_KEY) statement that adds it next to the current key; run it in Snowsight. --key-pair then tests the new key, switches to it and tells you how to remove the old one. No secret is read (--stdin is refused). |
struct connect custom-mcp --url <url> --auth none|bearer|header|oauth | Connect a remote MCP server, for example MCP_AUTH_VALUE=… struct connect custom-mcp --url https://mcp.example.com/mcp --auth bearer --name "Docs MCP". The token or header value comes from MCP_AUTH_VALUE; a custom header also takes --auth-header-name. Struct lists the server’s tools first and saves nothing if that fails (connection_failed). With --auth oauth the CLI prints a sign-in link (and opens it when this machine has a browser), waits up to 10 minutes while you approve Struct on the MCP server, then saves; the sign-in works only for you, in this workspace, for this URL. A declined sign-in exits 1 with oauth_failed, an expired one with oauth_session_expired. See Custom MCP connectors. |
struct connections enable <id>, struct connections disable <id> | Include a custom MCP server in agent runs, or keep it out without removing it. |
struct connections ssh-host-key --ssh-host <host> | Show an SSH bastion’s host key fingerprint, read without logging in, to check before --trust-host-key. --ssh-port (default 22); for a bastion behind an EC2 Instance Connect Endpoint, --ssh-endpoint-id, --ssh-instance-id and --ssh-aws-connection <id> instead of --ssh-host. |
struct connect github|slack|sentry|linear|jira|asana|notion | Connect an app you approve in a browser. Prints the link first, opens it when this machine has a browser, then waits. Open it in a browser signed in to Struct as the same user the CLI is logged in as: it works once, in that one browser, for 10 minutes. An app that is already connected says so (GitHub still applies --repo if supplied); --reauth reconnects it (same organization, site or workspace). When your login reaches several, choose in the browser or pass --org (GitHub, Sentry), --site (Jira) or --workspace (Asana). --repo owner/name (GitHub) also sets the default repository. --no-browser, --timeout <seconds> (default 600). Linear, Jira and Asana need the Pro plan (plan_required). Needs the configure permission. |
struct notion pages <connection-id> / configure <connection-id> | Notion is in private preview and read-only; check availability with struct connections catalog notion. Connecting grants no page access until you configure it: pages lists the configured roots, or explores candidates with --scope workspace (optionally --query), and configure --root <page-id> --mode read saves page roots and tools, keeping omitted settings. See Notion. |
struct github repos, struct github set-repo <owner/name> | List the repositories the Struct GitHub App can access (* marks the default), or set the default; it must be one the app can access (repository_not_found). |
struct sentry orgs, struct sentry set-org <slug> | List the organizations the connected Sentry user belongs to, or choose the one Struct reads (organization_not_found otherwise). |
struct slack channels list, struct slack channels join <channel> | Search the workspace’s channels (--query <text>, --archived, --limit <1-100>, --cursor), or have Struct’s bot join a public channel by id, #name or link (safe to repeat; invite it to private channels in Slack: private_channel). |