BigQuery subscription uses your Google Cloud credentials and your destination GCP project. It does not use
OCTO_API_KEY. The helper commands are part of the Python SDK’s optional bigquery extra.How access works
BigQuery subscription is a two-party flow:- Octogen grants listing access. Octogen publishes the catalog as an Analytics Hub listing and grants your Google principal
roles/analyticshub.subscriberon that listing. - You create the linked dataset. You run the subscription step from your own environment using Google Application Default Credentials. The linked dataset is created in your GCP project and billed to you.
- Octogen observes the subscription. After the linked dataset exists, Octogen refreshes the subscription status to
active.
pending to awaiting_subscription.
Prerequisites
1
Ask Octogen to enable BigQuery listing access
Your Octogen contact must enable BigQuery listing access for your organization.
2
Choose a subscriber principal
Choose the Google principal that will create linked datasets. For automation, use a service account such as:
3
Install the Python SDK with the BigQuery extra
The SDK ships from the public This installs
octogen-dev repository and is managed with uv. Clone the repository and sync the sdks/python project with the bigquery extra:octogen-bq-subscribe, octogen-bq-autosubscribe, and octogen-mcp-login into the project environment. Confirm the install:4
Authenticate to Google Cloud
For local testing:In production, run with service account credentials that can create linked datasets in the destination project.
Run the
octogen-bq-* and octogen-mcp-login commands below from the octogen-dev repository. Either activate the synced environment once with source sdks/python/.venv/bin/activate so the commands are on your PATH exactly as written, or prefix each one with uv run --project sdks/python --extra bigquery.Manual subscription
Useoctogen-bq-subscribe when you already have a listing resource name and want to subscribe one catalog.
1
Get the listing resource
Use the Platform UI or the MCP
list_bigquery_listing_resources tool. A listing resource looks like:2
Preview the subscription
The command is a dry run by default.
3
Apply
4
Query the linked dataset
Manual CLI options
Automatic subscription from cron
Useoctogen-bq-autosubscribe when you want automation that polls for new BigQuery listings and subscribes to anything ready.
The command performs one idempotent sync pass:
- Lists BigQuery listings granted to your organization.
- Lists your registered BigQuery subscribers.
- Registers your Reader if it is missing.
- Subscribes every catalog whose status is
awaiting_subscription. - Refreshes Octogen status after each linked dataset is created.
Bootstrap MCP OAuth credentials
octogen-bq-autosubscribe calls Octogen MCP to list and register subscriber state. Bootstrap MCP credentials once from an interactive terminal:
Dry run
Apply from cron
OCTOGEN_MCP_REFRESH_TOKEN_FILE should contain an Octogen MCP OAuth refresh token. If the identity provider rotates that refresh token during exchange, the command writes the replacement back to the same file while holding a sibling .lock file, so overlapping cron runs do not overwrite the same rotating token at once.
Autosubscribe options
MCP tools behind the automation
Agents and custom clients can implement the same flow through MCP tools:
Most customers should use
octogen-bq-autosubscribe instead of calling these tools directly. It handles idempotency, pending grants, existing subscriptions, and status refreshes for you.
Programmatic subscription
subscribe_to_listing is a synchronous Python helper that talks to Google Cloud using Application Default Credentials.
Result statuses
octogen-bq-autosubscribe --json returns one catalog result per granted or requested catalog.