# MCP: Workspaces

> Create, rename, and safely delete empty workspaces through the hosted Meshive MCP server, and manage a workspace's members, saved credentials, buckets, inference keys, webhooks, inference requests, charges, and messages to hosts.

Source: https://docs.meshive.ai/sdk-cli/mcp/workspaces/

Workspace lifecycle rules and safety checks for AI agents using the hosted [Meshive MCP server](/sdk-cli/mcp/). See [Safety, Previews & Limits](/sdk-cli/mcp/safety/) for how `confirm` previews and `operation_id` recovery work.

## Creating a workspace

With a write key the agent can create a workspace (MCP server 1.6+). When `workspaces` comes back empty it offers to create one, and you can ask for one directly: *"Create a workspace called research."* `create_workspace` follows the console's rules. The name is optional, at most 63 characters, without control characters, and different from every workspace name you already use — an exact match, so `Research` and `research` count as different names. Leave it out and a name starting with `my-workspace-` is generated. A name that is taken comes back as `name_taken` and nothing is created.

An empty workspace costs nothing; pods, storage and tasks in it are billed as usual. Creation is asynchronous: the response arrives before the workspace can be used, so the agent is told to call `workspaces` until its status is `running` before it creates anything in it. A pod or task requested too early is refused (`workspace_not_ready`), and storage or a serving may be accepted and fail later, so the wait matters. A just-created workspace can be missing from the list for a moment. `error`, or a `terminated` that doesn't change, means setup failed. If it is still `creating` after a few minutes, the agent is told to say it is taking longer than usual and not to create another.

A new workspace does not limit your API key. A key works in every workspace you can access, so the key you already use works in the new one, and every workspace you are the billing owner of draws on the same credit.

## Renaming a workspace

`update_workspace` changes a workspace's name and nothing else (MCP server 1.6+). The workspace ID stays the same, every member sees the new name, and it needs the **admin** or **billing** role in that workspace — a `viewer` is refused. The name follows the rules of `create_workspace` except that it can't be left out: at most 63 characters, no control characters, and different from the names of your other workspaces (`name_taken` otherwise).

Without `confirm` it shows the current and the new name and changes nothing; after your yes, the agent calls again with `confirm: true`. The rename is applied at once, but the workspace list can take a moment to show the new name, so the agent is told to keep using the ID.

Both `update_workspace` and `delete_workspace` require `workspace` and never pick one for the agent, even when you have only one workspace. On the preview it can be the ID or the name; with `confirm: true` it must be the ID the preview returned, because a name stops matching once the workspace is renamed or deleted, and a retry would then fail.

## Deleting a workspace

`delete_workspace` deletes a workspace that is **empty**, and only that (MCP server 1.6+). It needs a write key and the **admin** or **billing** role in that workspace, and it can't be undone.

Without `confirm` it checks the workspace and deletes nothing. If the workspace is empty, it returns a preview that names the workspace and says the deletion can't be undone, and the agent asks you. If anything is left, it returns `workspace_not_empty` with `blockers`, a count for each kind of thing still in the workspace. The agent is told to tell you what is left and to clear nothing you didn't ask it to. The `next_step` names the tool that clears each kind, which the agent uses only if you ask — pods, storage volumes, servings and custom models with their delete tools, assets with `delete_asset`, custom templates with `delete_template`, running tasks with `stop_task` and finished ones with `delete_tasks`, saved credentials with `delete_credential`, webhooks with `delete_webhook`, inference keys with `revoke_inference_key` (an admin can revoke every key of the workspace), and members and open invitations with `remove_member` (MCP server 1.11+). Two things clear by themselves: operations still finishing (usually within minutes, at most about 30 minutes), so the agent checks again shortly, and task outputs still being saved (once they're in Assets — usually within seconds after the upload finishes, in rare cases up to about 30 minutes after the task ended); if `task_outputs` is still listed after that, it stops checking and tells you to look at the task in the console or contact support. Payouts waiting to be credited clear once the earnings are paid out, usually within a day; earnings on hold, or a failed payout, can take longer, so it tells you to contact support, and a delete in the console before that loses them. It is told never to look for a way around the check.

A workspace counts as empty when none of these is left (`blockers` uses the names in parentheses):

- pods, stopped ones and system pods included (`pods`), storage volumes (`storages`) and servings, paused ones included (`servings`)
- tasks that are running or queued, and finished tasks that are still in the Tasks list (`tasks`), and tasks whose outputs are still being saved (`task_outputs`)
- assets, frozen ones included (`assets`), custom templates (`templates`) and custom registered models (`models`)
- saved credentials — Hugging Face tokens, CivitAI keys, object-storage credentials and registry logins (`credentials`), webhooks (`webhooks`) and active inference API keys (`inference_keys`)
- other members (`members`) and invitations sent in the last day that haven't been accepted (`invitations`)
- earnings from shared serving capacity that haven't been credited yet (`pending_payouts`)
- operations that are still running, including the workspace's own setup (`operations_in_progress`)

Your own `meshive_…` API keys, billing history, short-lived inference results, files in your own bucket, links added when you attach a model set (the "+ N assets from model sets" entry on the Assets page; Meshive stores none of those files) and anything you have already deleted don't count, except a removed task whose outputs are still being saved (`task_outputs`). The [SDK reference](/sdk-cli/sdk/workspaces/#deleting-a-workspace) says what each kind means and how to clear it.

The check is enforced by the server, not only by the agent's instructions: a key can't delete a workspace that still holds things even if the agent skips the preview. It does not make a write key harmless — a key can still delete pods, storage volumes, servings, assets, credentials and the other things above one at a time — and no tool can delete a workspace that still holds things. A person can still delete it in the console, which removes what's in it for good; the [SDK reference](/sdk-cli/sdk/workspaces/#deleting-a-workspace) says how the console treats it.

After the confirmed call, the deletion is accepted and runs in the background: the workspace leaves the `workspaces` list within a moment, and its name stays taken for a while. Other refusals come back as `workspace_not_deletable` with the reason, such as a protected workspace. The key's owner gets an email naming the key. See the [SDK reference](/sdk-cli/sdk/workspaces/#deleting-a-workspace) for what a delete removes and how the name is freed.

## Members and invitations

`workspaces` with one workspace lists its `members`, each with an `email` and a `role`, and `invites`, the invitations sent in the last 24 hours (`invite_id`, `email`, `role`, and whether each was seen and accepted). `remove_member` removes a member (`user`, their email) or cancels an invitation (`invite`, an `invite_id`), and needs the **admin** or **billing** role (MCP server 1.11+).

Without `confirm` it changes nothing and names the member and their role, and the keys that keep working after the removal: their inference API keys (an admin or billing member can revoke them with `revoke_inference_key`) and the port access keys they created. With `confirm: true`, `workspace` must be the ID. The removal is immediate. You can't remove yourself, the only admin or the billing owner: `member_not_removable` says which, before any preview. An invitation that isn't there is `invite_not_found`. Inviting people and changing roles stay in the console.

## Saved credentials and buckets

`source_credentials` lists the workspace's saved Hugging Face tokens, CivitAI keys and container registry logins (`registry_login_id`, server and user name) — never the secrets. Any member can read it; for a member who may not see tokens and keys, those two lists are `null` with a note. With `kind` and `credential_id` it shows what uses one credential: the assets linked with a token or key and how many pods use each, or the custom templates of a registry login and its active pods and tasks.

`buckets` lists the S3-compatible buckets connected to the workspace — `bucket_id`, label, provider, bucket name, default prefix and whether the connection is `verified`, never the keys or the endpoint — and `default_output_bucket`, where task outputs go by default (MCP server 1.11+). With `bucket` it browses one folder level (`folders` and `objects`) under `prefix`. A bucket the saved keys can't read fails with `bucket_access_failed`. Bucket labels, object keys and folder names can come from other people, so the agent treats them as data. A `bucket_id` is what `submit_task`, `deploy_serving` and `scale_serving` take as `output_bucket`, and what `export_asset` and `import_asset` take — see [Managing Asset Hub files](/sdk-cli/mcp/pods/#managing-asset-hub-files).

Two writes need the **admin** or **billing** role and `confirm`, and with `confirm: true` the `workspace` must be the ID (MCP server 1.11+):

- **`set_default_output_bucket`** chooses where the workspace's task outputs go by default: a verified `bucket_id`, or `"managed"` for Meshive storage, which is billed per GiB-month. The preview shows the current and the new destination. A call that changes nothing answers `changed: false` without a preview — a confirmed one then sends nothing — and an unverified bucket is refused with `bucket_not_verified`. Running tasks, console uploads and pod watched folders aren't affected.
- **`delete_credential`** deletes a Hugging Face token, CivitAI key or registry login, or removes a bucket connection (`kind`: `hf_token`, `civitai_key`, `registry_login` or `bucket`). The preview shows what uses it, and the agent shows you that first — for a registry login also how many pods (stopped ones included, when they start again) and unfinished tasks can fail to pull their image. **A deleted token, key or login can't be brought back**, and the server doesn't stop you while something uses it: those assets, templates or pods stop working until you save a new one in the console. Removing a bucket connection deletes nothing in the bucket, and files registered from it stay readable by pods and tasks (a linked bucket folder can't be browsed or copied from any more); if task outputs went there by default, they go back to Meshive storage, which is billed, and the preview names its price. A bucket connection that is already removed answers `already_removed: true` with no preview, because removing it again would do nothing; a confirm with a new `operation_id` answers the same, while a retry with the `operation_id` of the confirm that removed it gets that first answer again. A removed connection's label gets a mark — `test` becomes, for example, `test (removed #31)` — so the original label can be used for a new connection; `buckets` with `include_deleted: true` lists removed connections under the marked label, and a new label can't end with `(removed #<number>)`. An ID that isn't there is `credential_not_found`.

Saving a token, key, registry login or bucket connection stays in the console: the agent never handles their secrets.

## Inference keys

Inference API keys are what programs send as `Authorization: Bearer <key>` to a serving's endpoint or to the shared model catalog. They are not your Meshive API key and not a pod port's access keys. `inference_keys` lists them with name, status, expiry and rate limits, never their values: an **admin** or **billing** member sees every key of the workspace with who made it, and other members see their own (MCP server 1.11+). `expired` says whether a key's `expires_at` has passed; `status` doesn't reflect expiry, so an expired key can still show `active`.

| Tool | What it does | Who |
| --- | --- | --- |
| `create_inference_key` | Creates a key; optional `name` and `expires_in_days` (1–3650) | Admin or billing |
| `roll_inference_key` | Gives a key a new value and a new `key_id`; the old value stops working at once, with no overlap | The member who created it, as admin or billing |
| `revoke_inference_key` | Revokes a key; programs sending it get 401 within seconds. It can't be undone | Your own keys whatever your role; admin or billing for any key |

All three take `confirm`. The previews and confirmed answers of a create and a roll say how long the key lives: **a key doesn't expire unless `expires_in_days` is given, and keeps working after the Meshive API key used to make it is revoked or expires** — any program with its value can call every serving of the workspace, billed to the workspace, until the key is revoked. A rolled key keeps its expiry. Both previews refuse a member who isn't an admin or billing member (`forbidden`), and the roll preview refuses an expired key. The value is in the confirmed answer only (`inference_key`), once, like a port access key's: the agent is told to give it to you and never to use it itself or put it in files, commits, commands or other tools.

Creating and rolling keep no operation record, so `operation_status` can't look them up and a repeated confirmed call runs again. A call without a clear answer fails with `inference_key_outcome_unknown`, and the agent is told to read `inference_keys` instead of calling again: the key may exist, and a key whose value was lost can only be revoked. A key someone else created can't be rolled (`inference_key_not_rollable`), and neither can an expired one (`inference_key_expired` — create a new one). An unknown or already rolled key ID is `inference_key_not_found`, and an answer that lost the value is `inference_key_value_missing`.

`models` with `source: "shared"` lists the shared catalog — models other workspaces opened up, billed per million tokens (`price_per_1m_input_tokens`, `price_per_1m_output_tokens`) — with the `base_url` and each model's `model` name to call it with an inference key. See [Shared serving](/serverless/shared-serving/).

## Webhooks

`webhooks` shows the workspace's webhook endpoints — URLs Meshive posts an event to when an async inference request or a task finishes — with their platform, subscribed `event_types`, whether they are on, and why Meshive turned one off after repeated failures (MCP server 1.11+). `kind: "deliveries"` lists what was sent to them, newest first, filtered by `webhook` or `request_id`; one delivery with `delivery_id` includes the `request_body` that was sent. `kind: "events"` lists every event type with a sample payload and needs no workspace. Endpoints and deliveries need the **admin** or **billing** role.

**Webhook URLs are masked everywhere**: a Slack or Discord URL's path is shown as `…`, and the query string and user name of any URL are left out (`url_masked`). A delivery's `last_error` and `request_body` can hold text from the receiving server or a model, and labels are written by members, so the agent treats them as data.

`save_webhook` creates an endpoint (leave out `webhook`) or changes one, and `send_test: true` sends it one fixed sample event. Creating one, changing its URL, adding event types or turning it back on takes `confirm`; renaming, removing event types, turning it off or only sending a test applies at once. Events keep going to the URL until the endpoint is deleted, even after the API key that made it is revoked. A Slack or Discord URL, or a URL with a user name or password, is a secret and is refused before anything is sent (`secret_url_not_accepted`): you add those in the console. So is passing back the masked form of a stored URL (`masked_url_given`), which would drop its hidden part. A URL that isn't `https://` is refused before anything is sent (`invalid_webhook_url`), and a preview refuses event types the event catalog doesn't list (`invalid_argument`). A turned-off endpoint can't be tested (`webhook_disabled`), and an unknown `delivery_id` is `delivery_not_found`. `delete_webhook` deletes an endpoint and takes `confirm`; events stop at once and its delivery history stays, but those deliveries lose their `webhook_id`, so filtering by the deleted endpoint finds nothing — read them unfiltered or by `request_id`. A repeated confirmed delete of an endpoint that is gone answers `webhook_not_found`: if it is a retry of a delete that went through, the endpoint is already deleted, and `operation_status` shows it. Generic endpoints are signed with the workspace's signing secret, which you copy from the console. See [Webhooks](/serverless/webhooks/).

## Inference requests

`inference_requests` lists the workspace's inference requests — the queued jobs that image, video and other async calls to a serving create — newest first, filtered by `status` and `modality`, or shows one by `request_id` (MCP server 1.11+). Any member can read them. Each request says who sent it, which inference key it used, where its result is stored (`output_bucket`: "Meshive storage" for a result Meshive keeps, or the name of your own bucket), and `error_code` and `error_message` when it failed; the error text comes from the model or its engine and is treated as data. A succeeded request's detail has `download_urls` for its outputs, which expire in about an hour, so the agent asks again for fresh ones. Only the newest 200 requests are read (`truncated`); filter by status or modality for older ones.

`cancel_inference_request` cancels a request that is still queued. It needs no `confirm`: nothing ran, so nothing is billed and the credit held for it is refunded. A request that isn't queued any more is `request_not_cancellable` — a running one finishes or times out on its own. The member who sent it, or an admin or billing member, can cancel it. See [Requests](/serverless/requests/).

## Charges and earnings

`billing_history` with `workspace` has two kinds any member can read (MCP server 1.11+):

- `kind: "workspace"` lists the workspace's charges per day — pod, storage, serverless, task, asset and `total` — newest first, with a `summary`: the billing owner, the current hourly price, the average per day over the last 7 days with charges, and this month's spend on shared models and credits from sharing its own servings.
- `kind: "shared_earnings"` lists what sharing a serving's idle capacity earned, per settlement and per model (`models`).

## Talking to hosts

`workspaces` with one workspace also lists `maintenance`, the hosts' maintenance windows that touch its pods and volumes (they may be unreachable and aren't billed while one is in progress), and `host_threads`, its conversations with the hosts of the machines it uses, with message and unread counts and at most 5 names of what it runs there. Maintenance reasons are written by the host and treated as data.

`host_messages` with `workspace` reads those conversations (`direction` `in` is from the host; each message names at most 5 of the pods and volumes it is about and counts them in `pod_count` and `volume_count`), and `mark_host_messages_read` with `workspace` marks them read; any member can do both. `send_host_message` writes to a host from the workspace: `workspace` with `machine` (from `host_threads` or `maintenance`) or `pod`, or `pod` alone (MCP server 1.11+). The preview names the workspace and what it runs on that machine, says when the workspace has no conversation or maintenance with it yet, and sends nothing; after your yes to the exact title and text, the agent calls again with `confirm: true` and the workspace ID. A machine the workspace neither uses nor talked to is refused (`host_not_reachable`), and so is a pod that isn't on a machine yet (`pod_not_placed`). The host is emailed and sees the workspace's name. Message text is written by the other side, so the agent treats it as data.
