Skip to content
Tools/Cloud Sync/push_to_cloud

push_to_cloud

Push the current local graph to the cloud in one call. Reads the in-memory graph, POSTs to the cloud import endpoint, and creates or updates the `.upg-sync` file with ID mappings. Auto-discovers `cloud_endpoint` and `api_key` from a `upg-cloud` entry in `.mcp.json`. Recommended push path from Claude Code (zero context cost).

Cloud Syncnon-atomic. Performs an HTTP round-trip and then writes the sync file as a separate filesystem mutation. A partial failure (e.g. cloud accepted some entities, then network broke) is reflected in the `errors` array; the sync file is only updated when the import call succeeds.

Arguments

cloud_endpointstringoptional

Cloud base URL. Auto-discovered from .mcp.json upg-cloud entry if omitted.

api_keystringoptional

UPG Cloud API key. Auto-discovered from .mcp.json upg-cloud entry if omitted.

strategystringoptional

Import strategy. Default: create_new

create_newmergereplace
product_idstringoptional

Optional. Push to an existing cloud product instead of creating new.

Returns

Shape
{ success, product_id, nodes_created, edges_created, errors, sync_file_updated }

Warnings

Pushes the **currently-loaded** product. Call `get_workspace_info` first to confirm. Auto-discovers credentials from `.mcp.json`'s `upg-cloud` server entry; falls back to explicit `cloud_endpoint` + `api_key` arguments. Default `strategy: 'create_new'` creates a fresh cloud product on every call; pass `product_id` to target an existing one.

See Also