> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/mcp-servers.md).

# mcp-servers

Customer-built MCP (Model Context Protocol) server resources that expose a chosen slice of Celigo Tools and builder-mode APIs as an MCP endpoint for external AI clients (Cursor, Claude, ChatGPT, Windsurf, and anything else that speaks MCP).

What the UI calls **Capability Sets** is stored as `permissionSets[]` — an embedded array on the MCP server document, not a top-level resource. Each entry is `{_id, name, description?, _toolIds[], _apiIds[], _promptIds[], _resourceIds[]}`. An `accessLevel` is accepted but not stored. The server generates `_id`, the stable handle that end-user grants reference as `pset:<_id>`. A set's `name` is unique per server, ignoring case, and the tools, APIs, prompts, and resources a set lists must already be on the server.

End-user grants — direct grants on [end-users](https://developer.celigo.com/cli/commands/end-users.md), and the `resourceGrants` of [groups](https://developer.celigo.com/cli/commands/groups.md) and [roles](https://developer.celigo.com/cli/commands/roles.md) — take five capability kinds. `tool:`, `api:`, `prompt:`, and `resource:` each take an id on the server or `all`, and an `:all` covers only its own kind. `pset:<_id>` grants a capability set. Grant a prompt as `prompt:<prompts[]._id>`: an older `tool:<prompt id>` grant still validates, but effective access does not report it.

> ⚠️ **PUT erases capability sets.** The server resets `permissionSets` to `[]` on any full PUT that omits it, so an `update` whose body lacks the field deletes every capability set. Each `pset:` grant that pointed at an erased set is rewritten into the set's own `tool:`, `api:`, `prompt:`, and `resource:` capabilities, which its grantees keep. Erasing a set does not revoke access; change the grants for that. The same PUT clears `connections`, `tools`, `apis`, `prompts`, `resources`, and `policies` when it leaves them out, while `upstreamMcpConnections` and `_networkPolicyId` keep their stored values. Build the body from `get`, or prefer `set`: `name`, `disabled`, `policies`, `_networkPolicyId`, and since celigo-cli 2026.11.2 `logging.mode` and `logging.debugUntil` apply as an atomic PATCH, and every other field goes GET + modify + PUT with the complete document, which preserves them.

> ⚠️ **A PUT that carries `upstreamMcpConnections` approves changed upstream definitions.** A server can proxy remote MCP servers (`upstreamMcpConnections`). Each upstream tool, prompt, and resource row records the definition an administrator last approved, and discovery flags a row `changedSinceApproval` when the upstream's definition differs. Any PUT that carries `upstreamMcpConnections` approves every current definition. Reviewing and approving a changed definition is a person's decision. Since celigo-cli 2026.10.2, [`set`](#celigo-mcp-servers-set) refuses its GET + PUT while any row is flagged, and [`push`](https://developer.celigo.com/cli/local-tree/push.md) and [`promote`](https://developer.celigo.com/cli/local-tree/promote.md) refuse such an update too. An [`update`](#celigo-mcp-servers-update) body that includes `upstreamMcpConnections` approves the changes; one that leaves the field out keeps the stored attachments.

**Request logs:** `request-history <id>` lists the calls MCP clients made to a server, newest first, and `request-log-filters` lists the methods and outcomes its `--method` and `--status` filters take. A row has a `key` only when its payload was stored: the server's `logging.mode` decides, and `basic` and `noLogging` store none. `log-detail <id> <key>` opens a stored payload. `purge-request-logs` deletes the stored payloads in a time window and keeps the rows. Added in celigo-cli 2026.10.2; the routes went live with the platform's 2026.10.2 release. Since celigo-cli 2026.11.2, [`set`](#celigo-mcp-servers-set) changes the mode (`logging.mode`) and opens a debug window (`logging.debugUntil`) with one PATCH.

**Moving a server:** `download <id>` writes a server and what it depends on as a template ZIP. `preview-template --zip` shows what a ZIP would create, and `install-template --zip` installs it in the account and environment of the profile you run it with. That is how a server moves to another account or environment. `preview-template` and `install-template --zip` were added in celigo-cli 2026.11.2.

**The MCP registry:** `registry` lists the servers a credential can connect to, as the account's MCP registry publishes them, each with the URL an AI client connects to. Added in celigo-cli 2026.11.2.

**REST API**: [MCP Servers](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers)

```
celigo mcp-servers <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                                     | Purpose                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list`                                         | List every MCP server on the account.                                                                                                                                                                                                                                                                                        |
| `get <id>`                                     | Fetch one MCP server by ID.                                                                                                                                                                                                                                                                                                  |
| `create`                                       | Create from a JSON body (`--file <path>` or stdin).                                                                                                                                                                                                                                                                          |
| `update <id>`                                  | Full PUT replace from a JSON body (`--file <path>` or stdin).                                                                                                                                                                                                                                                                |
| `set <id> <key=value>...`                      | Safe field edit: `name`, `disabled`, `policies`, `_networkPolicyId`, and since celigo-cli 2026.11.2 `logging.mode` and `logging.debugUntil` via atomic PATCH, everything else GET + modify + PUT — which, since celigo-cli 2026.10.2, is refused while an upstream definition awaits approval. Supports `key=file://<path>`. |
| `delete <id>`                                  | Delete an MCP server.                                                                                                                                                                                                                                                                                                        |
| `dependencies <id>` (alias `used-by`)          | List resources that depend on this MCP server.                                                                                                                                                                                                                                                                               |
| `audit <id>`                                   | Show the MCP server's audit log (change history).                                                                                                                                                                                                                                                                            |
| `effective-access <id>`                        | Compile every end user who can reach this server, with each grant's source.                                                                                                                                                                                                                                                  |
| `connections <id> [--end-users]`               | List the connections the server attaches as full Connection documents; `--end-users` lists the end users' own `mcpChild` credential copies instead. Added in celigo-cli 2026.9.6.                                                                                                                                            |
| `registry`                                     | List the MCP servers this credential can connect to, as the account's MCP registry publishes them, each with the URL an AI client connects to. Added in celigo-cli 2026.11.2.                                                                                                                                                |
| `download <id> [-o <path>] [--force]`          | Download the server as a template ZIP: a manifest of the server with what it depends on, and no credentials. Added in celigo-cli 2026.9.6.                                                                                                                                                                                   |
| `preview-template --zip <path>`                | Preview a local MCP server template ZIP: the documents that installing it would create, without creating anything. Added in celigo-cli 2026.11.2.                                                                                                                                                                            |
| `install-template [templateId] [--zip <path>]` | Install an MCP server template: a published marketplace template by id (`templates marketplace --kind mcpserver`), or since celigo-cli 2026.11.2 a local template ZIP with `--zip`. Added in celigo-cli 2026.9.6.                                                                                                            |
| `assign-end-users <id> <ashareIds...>`         | Bulk-assign the server's capabilities to end users (replaces each listed user's grant).                                                                                                                                                                                                                                      |
| `assign-groups <id> <groupIds...>`             | Bulk-assign the server's capabilities to end-user groups (replaces each listed group's grant).                                                                                                                                                                                                                               |
| `request-history <id>`                         | List the server's request logs — the calls MCP clients made to it, newest first, 50 per page. Added in celigo-cli 2026.10.2.                                                                                                                                                                                                 |
| `log-detail <id> <key>`                        | Get the stored request and response of one request-log row. Added in celigo-cli 2026.10.2.                                                                                                                                                                                                                                   |
| `request-log-filters`                          | List the values that `request-history`'s `--method` and `--status` filters take. Added in celigo-cli 2026.10.2.                                                                                                                                                                                                              |
| `purge-request-logs <id>`                      | Delete the stored request-log payloads in a time window; the rows stay. Added in celigo-cli 2026.10.2.                                                                                                                                                                                                                       |

***

## `celigo mcp-servers list`

List every MCP server configured on the account. Rows are projected to `_id`, `name`, and the table columns by default; `--fields all` returns complete documents.

**Signature**

```bash
celigo mcp-servers list [flags]
```

**Arguments**

*None.*

**Flags**

| Flag              | Type    | Default   | Description                                                                                                                                                                                                                                                     |
| ----------------- | ------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--fields <spec>` | string  | `default` | Fields to request per row. `default` returns `_id`, `name`, and the table columns; `all` returns complete documents; a comma-separated list requests specific fields. See [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md). |
| `--limit <n>`     | integer | —         | Return at most `<n>` rows, fetching a single page.                                                                                                                                                                                                              |

Default table columns: `_id`, `name`, `relativeURI`, `disabled`, `lastModified`.

**Example**

```bash
celigo mcp-servers list --format table
```

**Corresponds to**: [`GET /v1/mcpservers`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers) (operationId: `listMcpServers`).

***

## `celigo mcp-servers get`

Fetch a single MCP server by ID, including its tools, APIs, and override settings.

**Signature**

```bash
celigo mcp-servers get <id>
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

*None beyond* [*global flags*](https://developer.celigo.com/cli/getting-started/global-flags.md)*.*

**Example**

```bash
celigo mcp-servers get 5f83a9b2c7d3e8f1a2b3c4d5 --format json | jq '{name,relativeURI,disabled}'
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers-_id) (operationId: `getMcpServerById`).

***

## `celigo mcp-servers create`

Create an MCP server from a JSON body. Read the body from a file with `-f, --file` (recommended), or pipe it on stdin. Servers are created disabled by default; at least one tool or API must be enabled before the server itself can be enabled.

**Signature**

```bash
celigo mcp-servers create --file <path>
celigo mcp-servers create < mcp-server.json     # or pipe on stdin
```

**Arguments**

*None.*

**Flags**

| Flag                | Type   | Default | Description                                                                                                  |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |

**Request body**

A JSON object matching the `POST /v1/mcpservers` request schema, including the `tools[]`, `apis[]`, `annotations`, and override fields.

**Example**

```bash
celigo mcp-servers create --file ./mcp-server.json
```

**Corresponds to**: [`POST /v1/mcpservers`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#post-v1-mcpservers) (operationId: `createMcpServer`).

***

## `celigo mcp-servers update`

Full PUT replace of an MCP server from a JSON body (`--file <path>` or stdin). Omitted fields are erased, except `upstreamMcpConnections` and `_networkPolicyId` — round-trip via `get` first, or prefer `set` for targeted edits.

> ⚠️ **`update` replaces the entire MCP server.** A full PUT clears `connections`, `tools`, `apis`, `prompts`, `resources`, and `policies` when the body leaves them out, and a body that omits `permissionSets` **erases every capability set** (the API resets the field to `[]`). Each `pset:` grant that pointed at an erased set is rewritten into the set's own `tool:`, `api:`, `prompt:`, and `resource:` capabilities, which its grantees keep. `upstreamMcpConnections` and `_networkPolicyId` keep their stored values when the body leaves them out. Build the body from `get`, or prefer `set`, which round-trips the full document and preserves them.

A capability set sent back without its `_id` keeps the `_id`, and the grants, of the stored set whose name matches, ignoring case. A renamed set is a new set, and the old set's `pset:` grants are rewritten as an erased set's are. A server not saved since capability sets existed has no `permissionSets` key on GET, and no sets to lose.

A body that includes `upstreamMcpConnections` approves every upstream tool, prompt, and resource definition that changed since it was last approved (`changedSinceApproval`). A body that leaves the field out keeps the stored attachments. `update` sends the body as given: unlike `set`, it does not refuse while a row is flagged. A body built from `get` always carries the field, so remove it unless a person who reviewed the changed definitions means to approve them. [`push`](https://developer.celigo.com/cli/local-tree/push.md) and [`promote`](https://developer.celigo.com/cli/local-tree/promote.md) refuse such an update (since celigo-cli 2026.10.2).

**Signature**

```bash
celigo mcp-servers update <id> --file <path>
celigo mcp-servers update <id> < mcp-server.json     # or pipe on stdin
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag                | Type    | Default | Description                                                                                                                           |
| ------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1.                          |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`"******"`) copied from a `GET` — four or more asterisks and nothing else. |

**Request body**

A JSON object matching the `PUT /v1/mcpservers/{_id}` request schema.

**Example**

```bash
# Leave upstreamMcpConnections out: a body that carries it approves changed upstream definitions
celigo mcp-servers get 5f83a9b2c7d3e8f1a2b3c4d5 --format json \
  | jq '.disabled = false | del(.upstreamMcpConnections)' \
  | celigo mcp-servers update 5f83a9b2c7d3e8f1a2b3c4d5
```

**Corresponds to**: [`PUT /v1/mcpservers/{_id}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#put-v1-mcpservers-_id) (operationId: `updateMcpServer`).

***

## `celigo mcp-servers set`

Safe field edit. Whitelisted fields — `name`, `disabled`, since celigo-cli 2026.9.6 `policies` and `_networkPolicyId`, and since celigo-cli 2026.11.2 `logging.mode` and `logging.debugUntil` — are applied via an atomic `PATCH`; every other field goes GET + in-memory mutation + PUT with the complete document — which preserves `permissionSets`, unlike a hand-written `update` body. Dot notation and array indexing are supported. A `null` RHS removes the field (or splices an array element). A `key=file://<path>` value loads that field's value from a file instead of the command line (a leading `~` and relative paths are supported).

`policies` replaces the whole array and is validated as a whole: a duplicate type + `keyResolver` pair or an invalid config rejects the patch.

`_networkPolicyId` assigns a [network policy](https://developer.celigo.com/cli/commands/network-policies.md), whose IP allow and deny lists gate the MCP requests that reach the server; `_networkPolicyId=null` unassigns it. `celigo network-policies dependencies <policyId>` lists every server, API token, listener export, and sign-in setting a policy is assigned to.

`logging.mode` sets what the server's request logs keep: `noLogging`, `basic`, `standard`, or `detailed`. `standard` and `detailed` need payload storage on the account. `logging.debugUntil` captures everything until a time you set: an ISO 8601 time in the future, at most the license's `logging.maxDebugDuration` minutes ahead. `logging.debugUntil=null` ends the window early. Since celigo-cli 2026.11.2, `set` sends both fields as a PATCH, so neither needs a PUT of the whole server. When the PATCH answers with no body, `set` prints nothing on stdout and `Updated mcp-server <id>.` on stderr. Earlier releases sent these fields with a GET + PUT and printed the document that the PUT answered with.

`set` of `disabled` or `logging.debugUntil` works in `operate` mode. Any other field needs `full` mode. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

Since celigo-cli 2026.10.2, `set` refuses its GET + PUT while the server has an upstream tool, prompt, or resource row flagged `changedSinceApproval`. The document a GET returns always carries `upstreamMcpConnections`, and a PUT that carries it approves every changed definition without review. The refusal comes after the GET and sends nothing. It names the changed rows as `<alias> <kind> <name>`, at most five, then a count of the rest:

```
Refusing to set tools[2] on mcp-server 5f83a9b2c7d3e8f1a2b3c4d5: this field needs a PUT of the whole server, and a PUT that carries upstreamMcpConnections approves every upstream definition that changed since it was last approved (crm tool search_contacts), so those changes would be served without review. Nothing was sent. Approving them is a decision for a person who has reviewed them: an agent must not approve them itself, with 'mcp-servers update' or any other write. Run the set again once they are approved. name, disabled, policies, _networkPolicyId, logging.mode and logging.debugUntil need no PUT — 'set' sends them as a PATCH, which approves nothing.
```

A `set` of PATCH fields only (`name`, `disabled`, `policies`, `_networkPolicyId`, `logging.mode`, `logging.debugUntil`) still applies, because a PATCH approves nothing. A `set` that mixes them with any other field takes the GET + PUT route and is refused as a whole. A server with no changed row is written as before.

**Signature**

```bash
celigo mcp-servers set <id> <key=value>...
```

**Arguments**

| Argument         | Type              | Required | Description                                                                 |
| ---------------- | ----------------- | -------- | --------------------------------------------------------------------------- |
| `<id>`           | string            | Yes      | MCP server ID.                                                              |
| `<key=value>...` | string (variadic) | Yes      | One or more assignments, e.g. `disabled=false` or `tools[0].disabled=true`. |

**Flags**

*None beyond* [*global flags*](https://developer.celigo.com/cli/getting-started/global-flags.md)*.*

**Example**

```bash
# Append a tool reference to the server
celigo mcp-servers set 5f83a9b2c7d3e8f1a2b3c4d5 \
  'tools[2]={"_toolId":"6a1b2c3d4e5f6a7b8c9d0e1f"}'

# Enable the server and rename it
celigo mcp-servers set 5f83a9b2c7d3e8f1a2b3c4d5 disabled=false 'name=Sales copilot (prod)'

# Attach a network policy, and replace the policies array from a file — one atomic PATCH
celigo mcp-servers set 5f83a9b2c7d3e8f1a2b3c4d5 \
  _networkPolicyId=7b2c3d4e5f6a7b8c9d0e1f2a policies=file://./policies.json

# Set the request-log mode, and capture everything until a set time — one atomic PATCH
celigo mcp-servers set 5f83a9b2c7d3e8f1a2b3c4d5 \
  logging.mode=standard logging.debugUntil=2026-12-01T18:00:00Z
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers-_id) + [`PUT /v1/mcpservers/{_id}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#put-v1-mcpservers-_id) (operationIds: `getMcpServerById`, `updateMcpServer`) — or an atomic `PATCH /v1/mcpservers/{_id}` when every assigned field is whitelisted.

***

## `celigo mcp-servers delete`

Delete an MCP server by ID. The server moves to the recycle bin.

> ⚠️ **Deleting an MCP server cuts off its clients.** External AI clients that connect through this server's endpoint immediately lose access.

**Signature**

```bash
celigo mcp-servers delete <id> [--yes]
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag          | Type | Default | Description                               |
| ------------- | ---- | ------- | ----------------------------------------- |
| `-y`, `--yes` | bool | `false` | Skip the interactive confirmation prompt. |

**Example**

```bash
celigo mcp-servers delete 5f83a9b2c7d3e8f1a2b3c4d5 --yes
```

**Corresponds to**: [`DELETE /v1/mcpservers/{_id}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#delete-v1-mcpservers-_id) (operationId: `deleteMcpServer`). To restore the server, use [recycle-bin](https://developer.celigo.com/cli/commands/recycle-bin.md).

***

## `celigo mcp-servers dependencies`

List resources that depend on this MCP server (alias: `used-by`). Use it to check whether a server is safe to delete — an empty result means nothing references it.

**Signature**

```bash
celigo mcp-servers dependencies <id>
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

*None beyond* [*global flags*](https://developer.celigo.com/cli/getting-started/global-flags.md)*.*

**Example**

```bash
celigo mcp-servers dependencies 5f83a9b2c7d3e8f1a2b3c4d5
```

**Corresponds to**: `GET /v1/mcpservers/{_id}/dependencies`.

***

## `celigo mcp-servers audit`

Show the audit log (change history) for one MCP server.

**Signature**

```bash
celigo mcp-servers audit <id>
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

*None beyond* [*global flags*](https://developer.celigo.com/cli/getting-started/global-flags.md)*.*

**Example**

```bash
celigo mcp-servers audit 5f83a9b2c7d3e8f1a2b3c4d5
```

**Corresponds to**: `GET /v1/mcpservers/{_id}/audit`.

***

## `celigo mcp-servers effective-access <id>`

Compile who can reach this MCP server: every end user with access, their effective tools, and the source of each grant (`direct`, `group:<name>`, `pset:<name>`, `role:<name>`). The per-user mirror is [`end-users effective-access`](https://developer.celigo.com/cli/commands/end-users.md#celigo-end-users-effective-access-less-than-ashareid-greater-than), which compiles the same picture for one person across every server.

**Signature**

```bash
celigo mcp-servers effective-access <id>
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Example**

```bash
celigo mcp-servers effective-access 6a1b2c3d4e5f6a7b8c9d0e1f --format json
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}/effective-access`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers)

***

## `celigo mcp-servers connections <id>`

List the connections an MCP server attaches — its `connections[]` and its tools' `overrides.connections[]` — as full Connection documents. With `--end-users`, list instead the end users' own copies of those connections: the credentials each end user supplied for a connection whose `endUserProvidedFields` asks for them (`connectionRole: mcpChild`; `_userId` is the end user). This is the only route that serves those copies — `connections list`/`get` never show them. Their ids feed [`end-users connection`](https://developer.celigo.com/cli/commands/end-users.md#celigo-end-users-connection-less-than-connectionid-greater-than) and [`end-users delete-connection`](https://developer.celigo.com/cli/commands/end-users.md#celigo-end-users-delete-connection-less-than-connectionid-greater-than). Added in celigo-cli 2026.9.6.

The endpoint pages through a `Link` header. Since celigo-cli 2026.10.1 the CLI follows it to the last page and prints every connection; it used to print the first page only.

**Signature**

```bash
celigo mcp-servers connections <id> [--end-users]
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag          | Type    | Default | Description                                                                                                                       |
| ------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `--end-users` | boolean | `false` | List the end users' `mcpChild` copies of the server's connections instead of the server's own. Sent as `connectionRole=mcpChild`. |

Default table columns: `_id`, `name`, `type`, `connectionRole`.

**Example**

```bash
# The account's own connections the server attaches
celigo mcp-servers connections 5f83a9b2c7d3e8f1a2b3c4d5 --format table

# Every end user's credential copy — the ids end-users connection / delete-connection take
celigo mcp-servers connections 5f83a9b2c7d3e8f1a2b3c4d5 --end-users --format table
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}/connections`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers) — with `connectionRole=mcpChild` as a query parameter under `--end-users`.

***

## `celigo mcp-servers registry`

List the MCP servers this credential can connect to, as the account's MCP registry publishes them (MCP Registry v0.1). Each entry's `server` carries `name`, `title`, `description`, and `remotes[].url`, the URL an AI client connects to. Runs in `read` mode. Added in celigo-cli 2026.11.2.

The registry is read-only and grants nothing. It lists every enabled server for a full-access API token, the account owner, and administrators. A custom-scoped token gets the servers selected for it, and everyone else gets the servers granted to them. Disabled, deleted, and sandbox servers are never listed. A credential that can reach nothing on the alias gets an empty list.

The registry is anchored on the account's MCP alias: the segment after `/mcp/` in the account's MCP server URLs. No API returns the alias, so pass `--alias`, or store it once in the profile's `account_alias`, which the `CELIGO_ACCOUNT_ALIAS` environment variable overrides (see the [Configuration reference](https://developer.celigo.com/cli/getting-started/configuration.md)). With no alias from any of them, the command stops before any request:

```
The MCP registry is anchored on the account's MCP alias, which no API returns: pass --alias <alias>, or store it once with 'celigo config set account_alias <alias>' — the segment after /mcp/ in the account's MCP server URLs.
```

An alias that no account owns answers `404`.

The registry is not an MCP server. Give an AI client a server's own `remotes[].url`. Give a registry-aware client the registry URL, which the command names on stderr:

```
Registry: https://api.integrator.io/mcp/acmecorp/registry
```

JSON output is the array of registry entries. `--format table` lists one server per row — `name`, `title`, `version`, `url`, `visibility` — with `name` and `url` printed whole. Under `--format table`, a `--jq` expression still reads the registry's entries, not the table's rows. When more entries exist, stderr names the next page, and the cursor goes to stderr only:

```
More servers: the next page is --cursor '<cursor>'.
```

**Signature**

```bash
celigo mcp-servers registry [--alias <alias>] [--search <text>] [--limit <n>] [--cursor <cursor>]
```

**Arguments**

*None.*

**Flags**

| Flag                | Type    | Default                       | Description                                                                                                               |
| ------------------- | ------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `--alias <alias>`   | string  | the profile's `account_alias` | The account's MCP alias, for this run.                                                                                    |
| `--search <text>`   | string  | —                             | Only entries whose name or title contains this text, in any letter case. Sent as `search`.                                |
| `--limit <n>`       | integer | `30`                          | Entries per page, 1–100. A larger value is refused before the request. Sent as `limit`.                                   |
| `--cursor <cursor>` | string  | —                             | Read the next page: the cursor a previous run printed on stderr (the response's `metadata.nextCursor`). Sent as `cursor`. |

A blank `--search` or `--cursor` (an unset shell variable) is refused before any request.

**Example**

```bash
# The servers this credential can connect to, with the URL each AI client uses
celigo mcp-servers registry --format table

# Another alias, filtered by name: each server's name and connect URL
celigo mcp-servers registry --alias acmecorp --search sales \
  --jq '.[] | {name: .server.name, url: .server.remotes[0].url}'
```

**Corresponds to**: [`GET /mcp/{alias}/registry/v0.1/servers`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-registry) on the profile's API host — with `search`, `limit`, and `cursor` as query parameters.

***

## `celigo mcp-servers download <id>`

Download an MCP server as a template ZIP: the whole server as a secret-free manifest, with what it depends on. The ZIP carries the server's tools and APIs with their exports, imports, connections, and scripts. It also carries inline prompts, the Celigo Storage files the server serves as resources, upstream MCP connections with their selected items, capability sets, and traffic policies. It never carries credentials, API tokens, end users, groups, roles, grants, network policies, or request-log settings, and the manifest's server is disabled.

The same ZIP installs the server into another account or environment with [`install-template --zip`](#celigo-mcp-servers-install-template-less-than-templateid-greater-than), and it is what a publisher uploads for a marketplace template. Resource files over the ZIP limit (32 MiB uncompressed) answer `413`. The CLI requests the template, follows the signed URL, and writes the file locally. Added in celigo-cli 2026.9.6.

Since celigo-cli 2026.10.1, `download` never replaces an existing file unless you pass `--force`. With `-o`, the check runs before any request; with the default name, it runs once the CLI has read the server's name, before it asks for the template. A directory is always refused, as is a path whose directory does not exist, and a leading `~` in `-o` means your home directory:

```
./templates/sales-copilot.zip already exists; refusing to overwrite it. Pass --force to replace it, or choose another destination.
```

A network failure while fetching the signed URL is reported with its cause, for example `Download failed: network request failed (ECONNRESET)`.

**Signature**

```bash
celigo mcp-servers download <id> [-o <path>] [--force]
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag                  | Type    | Default             | Description                                                                                                                       |
| --------------------- | ------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `-o, --output <path>` | string  | `<server-name>.zip` | Output file path. Without it, the CLI writes `<server-name>.zip` in the current directory, falling back to `mcp-server-<id>.zip`. |
| `--force`             | boolean | `false`             | Replace the destination file if it already exists. Added in celigo-cli 2026.10.1.                                                 |

**Example**

```bash
celigo mcp-servers download 5f83a9b2c7d3e8f1a2b3c4d5

# A stable path for a git-tracked export, replacing the previous copy
celigo mcp-servers download 5f83a9b2c7d3e8f1a2b3c4d5 -o ./templates/sales-copilot.zip --force
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}/template`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers), which returns a short-lived signed URL. The CLI then downloads the archive from that URL. Runs in `read` mode.

***

## `celigo mcp-servers preview-template`

Preview a local MCP server template ZIP — the file [`download`](#celigo-mcp-servers-download-less-than-id-greater-than) writes. The command prints the resource documents that installing the ZIP would create, and creates nothing. Run it before [`install-template --zip`](#celigo-mcp-servers-install-template-less-than-templateid-greater-than). Added in celigo-cli 2026.11.2.

The CLI uploads the ZIP to staging storage first, then asks for the preview. Because of that upload, the command needs `operate` or `full` mode, and `read` mode refuses it before anything is read or sent. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

The preview runs the install's own ZIP checks and answers with the same errors:

* `400` — the file is not a readable ZIP, or it holds an invalid entry.
* `413` — the ZIP is over a template limit: 32 MiB uncompressed, 500 entries, or a JSON entry over 1 MiB.
* `422` — the ZIP is not an installable MCP server template.

The output is one row per object: `model`, `_id`, `name`, and `adaptorType` in a table. `--model` keeps one object type, and `--summary` counts the objects per type. When the template needs a stack, stderr says so: `The template needs a stack (stackRequired).`

The CLI reads the ZIP before it asks for an upload URL, so a path that holds no file is refused before any request:

```
Cannot read the template zip './sales-copilot.zip' (the file --zip names): no file at that path.
```

A blank `--zip` or `--model` (an unset shell variable) is refused too.

**Signature**

```bash
celigo mcp-servers preview-template --zip <path> [--model <model>] [--summary]
```

**Arguments**

*None.*

**Flags**

| Flag              | Type    | Default | Description                                                                                                                          |
| ----------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--zip <path>`    | string  | —       | **Required.** The MCP server template `.zip` to preview. A leading `~` means your home directory.                                    |
| `--model <model>` | string  | —       | Keep one object type, such as `McpServer`, `Tool`, `Api`, `Export`, `Import`, `Script`, or `Connection`. Matched in any letter case. |
| `--summary`       | boolean | `false` | Print a `{model, count}` row per object type instead of the documents. With `--model`, counts only that type.                        |

**Example**

```bash
# What would this ZIP create? One count per object type
celigo mcp-servers preview-template --zip ./sales-copilot.zip --summary

# Only the connections the ZIP packs
celigo mcp-servers preview-template --zip ./sales-copilot.zip --model Connection --format table
```

**Corresponds to**: `GET /v1/s3SignedURL` for an upload URL, a `PUT` of the ZIP to that signed URL, then [`GET /v1/mcpservers/template/preview`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers) with the upload's `runKey` as a query parameter.

***

## `celigo mcp-servers install-template <templateId>`

Install an MCP server template, by one of two routes:

* **A published marketplace template, by id** — a template whose `type` is `mcpserver`; find them with [`templates marketplace --kind mcpserver`](https://developer.celigo.com/cli/commands/templates.md#celigo-templates-marketplace).
* **A local template ZIP, with `--zip <path>`** — the file [`download`](#celigo-mcp-servers-download-less-than-id-greater-than) writes. This is how a server moves to another account or environment, and [`preview-template`](#celigo-mcp-servers-preview-template) shows what the ZIP would create. Added in celigo-cli 2026.11.2.

The command takes no body: the ZIP is the source of truth, and the server's `name` and `relativeURI` come from it. A `relativeURI` that is already taken gets a `-2`, `-3`, … suffix. A prompt-only template creates the server immediately, disabled (`destination.resourceType: mcpservers`). A template that packs dependencies, such as a connection, hands off to an integration in install mode (see [integrations](https://developer.celigo.com/cli/commands/integrations.md)). That integration has an install step per packed connection, and its final step creates the server. The installed server carries no end user, group, role, grant, credential, or network policy: nobody can call it until an owner or administrator grants access and enables it. A template that packs resource files is refused in a sandbox account (`422`).

Every call starts a new install — do not retry an ambiguous failure blindly. Since celigo-cli 2026.10.1 the CLI itself never resends the request after a timeout or a 5xx answer, and since celigo-cli 2026.11.1 not after a `429` either, which earlier releases retried. Integration templates use [`templates install`](https://developer.celigo.com/cli/commands/templates.md#celigo-templates-install) instead; this path returns `404` for them. Since celigo-cli 2026.10.2, `templates preview` of an MCP server template, and `templates install`'s refusal of one, name this command. Requires `full` mode. Added in celigo-cli 2026.9.6.

Before any request, the CLI refuses a command that names neither route, or both:

```
Provide a template id, or --zip <path> to install a local bundle.
Pass either a template id or --zip <path>, not both.
```

A blank `--zip` (an unset shell variable) is refused as its own mistake, never read as no `--zip`. The CLI reads the ZIP before it asks for an upload URL, so a path that holds no file is refused before any request.

**Signature**

```bash
celigo mcp-servers install-template <templateId>
celigo mcp-servers install-template --zip <path>
```

**Arguments**

| Argument       | Type   | Required    | Description                                                                                                                        |
| -------------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `[templateId]` | string | Conditional | Published template `_id` from `templates marketplace --kind mcpserver`. Omit it with `--zip`. Optional since celigo-cli 2026.11.2. |

**Flags**

| Flag           | Type   | Default | Description                                                                                                                                       |
| -------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--zip <path>` | string | —       | Install from a local MCP server template `.zip` instead of a template id. A leading `~` means your home directory. Added in celigo-cli 2026.11.2. |

**Example**

```bash
# 1. Find the template
celigo templates marketplace --kind mcpserver --format table

# 2. Install it — a prompt-only template creates the server right away, disabled
celigo mcp-servers install-template 6405b9d73496e05ff253d587

# Move a server to another account: download it, then preview and install the ZIP there
celigo mcp-servers download 5f83a9b2c7d3e8f1a2b3c4d5 -o ./sales-copilot.zip
celigo --profile acme-eu mcp-servers preview-template --zip ./sales-copilot.zip --summary
celigo --profile acme-eu mcp-servers install-template --zip ./sales-copilot.zip
```

**Corresponds to**: [`POST /v1/mcpservers/template/{_templateId}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers) with an empty body. With `--zip`: `GET /v1/s3SignedURL` for an upload URL, a `PUT` of the ZIP to that signed URL, then [`POST /v1/mcpservers/template`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers) with the upload's `runKey`.

***

## `celigo mcp-servers assign-end-users <id> <ashareIds...>`

Bulk-assign this server's capabilities to end users — up to 100 per call. Requires `full` mode.

The assignment **replaces, not appends**: each listed end user's grant for *this* server becomes exactly the given `--capabilities` — whatever they previously had on this server is dropped. Grants for other servers, wildcard all-server grants, and end users not listed are untouched. A mid-batch failure stops the batch: the response lists the end users already updated plus the error.

**Signature**

```bash
celigo mcp-servers assign-end-users <id> <ashareIds...> --capabilities <cap,...>
```

**Arguments**

| Argument         | Type              | Required | Description                                                                                                                                   |
| ---------------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `<id>`           | string            | Yes      | MCP server ID.                                                                                                                                |
| `<ashareIds...>` | string (variadic) | Yes      | End-user access-record ids from [`end-users list`](https://developer.celigo.com/cli/commands/end-users.md#celigo-end-users-list) (up to 100). |

**Flags**

| Flag                    | Type   | Default | Description                                                                                                                                                                                                                                                                   |
| ----------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--capabilities <caps>` | string | —       | **Required.** Capabilities to grant on this server, comma-separated: `tool:`, `api:`, `prompt:`, or `resource:`, each with an id on this server or `all` (an `:all` covers only its own kind), or `pset:<permissionSetId>` (a capability set's `_id` from `mcp-servers get`). |

**Example**

```bash
celigo mcp-servers assign-end-users 6a1b2c3d4e5f6a7b8c9d0e1f 68f0a9b2c7d3e8f1a2b3c4d5 \
  --capabilities tool:all,pset:6c2d3e4f5a6b7c8d9e0f1a2b
```

**Corresponds to**: [`PUT /v1/mcpservers/{_id}/endusers`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers)

***

## `celigo mcp-servers assign-groups <id> <groupIds...>`

Bulk-assign this server's capabilities to end-user groups — up to 100 per call. Requires `full` mode.

Same replace semantics as `assign-end-users`: each listed group's grant for *this* server becomes exactly the given `--capabilities`; grants for other servers, wildcard grants, and groups not listed are untouched. Member end users receive the change through membership. A mid-batch failure stops the batch and reports the groups already updated.

**Signature**

```bash
celigo mcp-servers assign-groups <id> <groupIds...> --capabilities <cap,...>
```

**Arguments**

| Argument        | Type              | Required | Description                                                                                                         |
| --------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| `<id>`          | string            | Yes      | MCP server ID.                                                                                                      |
| `<groupIds...>` | string (variadic) | Yes      | Group ids from [`groups list`](https://developer.celigo.com/cli/commands/groups.md#celigo-groups-list) (up to 100). |

**Flags**

| Flag                    | Type   | Default | Description                                                                                                                                                                                                                 |
| ----------------------- | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--capabilities <caps>` | string | —       | **Required.** Capabilities to grant on this server, comma-separated: `tool:`, `api:`, `prompt:`, or `resource:`, each with an id on this server or `all` (an `:all` covers only its own kind), or `pset:<permissionSetId>`. |

**Example**

```bash
celigo mcp-servers assign-groups 6a1b2c3d4e5f6a7b8c9d0e1f 68a1b2c3d4e5f6a7b8c9d0e1 \
  --capabilities pset:6c2d3e4f5a6b7c8d9e0f1a2b
```

**Corresponds to**: [`PUT /v1/mcpservers/{_id}/groups`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers)

***

## `celigo mcp-servers request-history <id>`

List an MCP server's request logs: one row per call an MCP client made to the server, newest first, 50 per page. Filter the rows by time, JSON-RPC method, outcome, and capability name. Runs in `read` mode. Added in celigo-cli 2026.10.2; the routes went live with the platform's 2026.10.2 release.

A row has a `key` only when its payload was stored (`hasPayload: true`). The server's `logging.mode` decides: `basic` and `noLogging` store none. Pass a row's `key` to [`log-detail`](#celigo-mcp-servers-log-detail-less-than-id-greater-than-less-than-key-greater-than) to read the stored request and response. A [purge](#celigo-mcp-servers-purge-request-logs-less-than-id-greater-than) keeps the row and drops its `key`.

Rows record the method with `/` as `_` (`tools_call`), and `--method` takes either form.

JSON output is the API's envelope (`requests`, `nextPageURL`). `--format table` lists one call per row — `key` (printed whole, as `log-detail` takes it), `time`, `method`, `entityName`, `status`. When more rows exist, the table names the next page on stderr:

```
Note: more requests exist; repeat the command with --next-page-token '<token>'.
```

**Signature**

```bash
celigo mcp-servers request-history <id> [--time-gt <ms-or-iso>] [--time-lte <ms-or-iso>] [--method <method>] \
  [--status <status>] [--entity-name <name>] [--next-page-token <token>]
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag                        | Type                          | Default | Description                                                                                                                                                                                                                                                                     |
| --------------------------- | ----------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--time-gt <ms-or-iso>`     | Unix ms or ISO 8601           | —       | Only calls recorded after this time (exclusive). An ISO datetime is sent as Unix milliseconds. Sent as `time_gt`.                                                                                                                                                               |
| `--time-lte <ms-or-iso>`    | Unix ms or ISO 8601           | —       | Only calls recorded at or before this time (inclusive). An ISO datetime is sent as Unix milliseconds. Sent as `time_lte`.                                                                                                                                                       |
| `--method <method>`         | string                        | —       | JSON-RPC method, such as `tools/call`. `tools/call` and `tools_call` match the same rows. [`request-log-filters`](#celigo-mcp-servers-request-log-filters) lists the methods the platform offers, but `--method` also takes methods that list leaves out, such as `initialize`. |
| `--status <status>`         | `success \| error \| blocked` | —       | Outcome of the call. Since celigo-cli 2026.11.2, any other value is refused before the request.                                                                                                                                                                                 |
| `--entity-name <name>`      | string                        | —       | Exact capability name: `params.name`, or `params.uri` for `resources/read`. Sent as `entityName`.                                                                                                                                                                               |
| `--next-page-token <token>` | string                        | —       | Cursor from the previous page's `nextPageURL` (a table names it on stderr). Sent as `nextPageToken`.                                                                                                                                                                            |

A time bound that is neither Unix milliseconds nor an ISO datetime is refused before the request. Since celigo-cli 2026.11.2, so is a blank `--method`, `--status`, `--entity-name`, or `--next-page-token` (an unset shell variable); earlier releases sent it as an empty parameter.

**Example**

```bash
# The 50 most recent calls
celigo mcp-servers request-history 5f83a9b2c7d3e8f1a2b3c4d5 --format table

# Failed tool calls since October 1
celigo mcp-servers request-history 5f83a9b2c7d3e8f1a2b3c4d5 \
  --method tools/call --status error --time-gt 2026-10-01T00:00:00Z

# The calls to one tool, then the next page, with the token the table named on stderr
celigo mcp-servers request-history 5f83a9b2c7d3e8f1a2b3c4d5 --entity-name get_customer --format table
celigo mcp-servers request-history 5f83a9b2c7d3e8f1a2b3c4d5 --entity-name get_customer --format table \
  --next-page-token '<token>'
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}/logs`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers-_id-logs) with the filters above as query parameters.

***

## `celigo mcp-servers log-detail <id> <key>`

Get the stored request and response of one request-log row. Pass the `key` exactly as [`request-history`](#celigo-mcp-servers-request-history-less-than-id-greater-than) returns it; a row without a `key` has no stored payload. The platform masks the stored `Authorization` header, and since celigo-cli 2026.11.1 the CLI prints every other credential the request carries as `********` too: the value of each credential header, and the request URL's userinfo and credential query parameters (see [Credentials in a run's result](https://developer.celigo.com/cli/using-the-cli/output-formats.md#credentials-in-a-runs-result)). A purged payload answers `422 log_file_unavailable`. Runs in `read` mode. Added in celigo-cli 2026.10.2.

**Signature**

```bash
celigo mcp-servers log-detail <id> <key>
```

**Arguments**

| Argument | Type   | Required | Description                                          |
| -------- | ------ | -------- | ---------------------------------------------------- |
| `<id>`   | string | Yes      | MCP server ID.                                       |
| `<key>`  | string | Yes      | Log key from `request-history`, exactly as returned. |

**Flags**

*None beyond* [*global flags*](https://developer.celigo.com/cli/getting-started/global-flags.md)*.*

**Example**

```bash
celigo mcp-servers log-detail 5f83a9b2c7d3e8f1a2b3c4d5 5465373387655-3f2a9c0d1e4b4c6f8a7b9d0e1f2a3b4c-tools_call-S
```

**Corresponds to**: [`GET /v1/mcpservers/{_id}/logs/{key}`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers-_id-logs-key)

***

## `celigo mcp-servers request-log-filters`

List the values that `request-history`'s filters take, as the platform offers them: `{method, status}`, the JSON-RPC methods for `--method` and the closed set of outcomes for `--status`. The method list is not an allow-list: `--method` also takes the underscore form (`tools_call`) and methods the list leaves out, such as `initialize`. The options are the same for every MCP server, so the command takes no id. Runs in `read` mode. Added in celigo-cli 2026.10.2.

**Signature**

```bash
celigo mcp-servers request-log-filters [--type method|status]
```

**Arguments**

*None.*

**Flags**

| Flag            | Type               | Default | Description                                                                      |
| --------------- | ------------------ | ------- | -------------------------------------------------------------------------------- |
| `--type <list>` | `method \| status` | —       | Return only one of the two lists. Any other value is refused before the request. |

**Example**

```bash
# Both lists
celigo mcp-servers request-log-filters

# Only the outcomes --status takes
celigo mcp-servers request-log-filters --type status
```

**Corresponds to**: [`GET /v1/mcpservers/logs/filter-options`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#get-v1-mcpservers-logs-filter-options) — with `type` as a query parameter under `--type`.

***

## `celigo mcp-servers purge-request-logs <id>`

Delete an MCP server's stored request-log payloads in a time window, at most 10,000 per call — narrow the window when it holds more. The rows stay in `request-history`, without a `key`. Prompts for confirmation unless you pass `-y`. Requires `operate` mode. Added in celigo-cli 2026.10.2.

Both bounds are inclusive. Each takes an ISO datetime or Unix epoch milliseconds, and the CLI sends both as ISO; a value that is neither is refused before the request. A window that ends in the future is refused: the API answers `400`. Since celigo-cli 2026.11.2 the CLI refuses that window itself, before the prompt and the request, and also a window whose start is after its end:

```
--time-lte must not be in the future (got '2099-01-01T00:00:00Z').
--time-gte must not be after --time-lte.
```

The command prints `{purged, errors}`. `purged` lists the keys whose payloads were deleted. `errors` lists any tool on the server whose run logs could not be queued for deletion; the purge still succeeds. When `--jq` cannot transform that answer, stderr says the request succeeded and prints the answer untransformed, and the command exits `1` — see [When `--jq` fails after a write](https://developer.celigo.com/cli/getting-started/global-flags.md#when-jq-fails-after-a-write).

**Signature**

```bash
celigo mcp-servers purge-request-logs <id> --time-gte <ms-or-iso> --time-lte <ms-or-iso> [-y]
```

**Arguments**

| Argument | Type   | Required | Description    |
| -------- | ------ | -------- | -------------- |
| `<id>`   | string | Yes      | MCP server ID. |

**Flags**

| Flag                     | Type                | Default | Description                                                                                             |
| ------------------------ | ------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `--time-gte <ms-or-iso>` | ISO 8601 or Unix ms | —       | **Required.** Start of the window, inclusive. Sent as `time_gte`, in ISO form.                          |
| `--time-lte <ms-or-iso>` | ISO 8601 or Unix ms | —       | **Required.** End of the window, inclusive. Must not be in the future. Sent as `time_lte`, in ISO form. |
| `-y, --yes`              | boolean             | `false` | Skip the confirmation prompt.                                                                           |

**Example**

```bash
# Delete September's stored payloads; the rows stay
celigo mcp-servers purge-request-logs 5f83a9b2c7d3e8f1a2b3c4d5 \
  --time-gte 2026-09-01T00:00:00Z --time-lte 2026-09-30T23:59:59Z -y
```

**Corresponds to**: [`POST /v1/mcpservers/{_id}/logs/purge`](https://developer.celigo.com/api/api-reference/ai-and-mcp/mcp-servers#post-v1-mcpservers-_id-logs-purge) with the window as the `time_gte` and `time_lte` query parameters.

***

## Gotchas

* **This resource is not the Celigo Platform MCP.** The `mcp-servers` command manages builder-side MCP endpoints *you* create to expose a chosen slice of your Tools and builder-mode APIs. For the first-party hosted MCP server that AI agents use to manage your whole account, see the [MCP docs](https://developer.celigo.com/mcp).
* **Editing tools, APIs, or credentials is a body edit, not a dedicated subcommand.** There is no `tools add`, `tools remove`, `apis add`, or `tokens rotate` — mutate `tools[]` / `apis[]` via `set` (for append/patch) or `update` (for full replace).
* **Every connection a Tool's steps run on needs a pair in the tool entry's `overrides.connections[]`**, even one that keeps the authored connection: `{"_abstractId": "<id>", "_id": "<id>"}`. Since celigo-cli 2026.11.2, `celigo lint` checks it; see [Logic rules](https://developer.celigo.com/cli/local-tree/lint-and-resolve.md#logic-rules).
* **`update` is a full PUT replace.** It clears `connections`, `tools`, `apis`, `prompts`, `resources`, `policies`, and `permissionSets` when the body leaves them out, while `upstreamMcpConnections` and `_networkPolicyId` keep their stored values. Always round-trip via `get` + `jq` first, or reach for `set`.
* **A PUT that omits `permissionSets` erases every capability set, but not the access the sets granted.** The API resets the field to `[]`, and every `pset:` grant that pointed at an erased set is rewritten into the set's own `tool:`, `api:`, `prompt:`, and `resource:` capabilities, which its grantees keep. To revoke access, change the grants. A set sent back without its `_id` keeps the stored set's `_id` and grants when the names match, ignoring case; a renamed set is new. `set` is the safe editor.
* **A PUT that carries `upstreamMcpConnections` approves changed upstream definitions.** A GET always returns the field, so a body built from `get` approves every upstream row flagged `changedSinceApproval`. Since celigo-cli 2026.10.2, `set` refuses its GET + PUT while a row is flagged, and `push` and `promote` refuse such an update. `update` sends what you give it; a body that leaves the field out keeps the stored attachments.
* **Grant a prompt as `prompt:<id>`.** Each `:all` covers only its own kind, so `tool:all` grants no prompts or resources. An older `tool:<prompt id>` grant still validates, but effective access does not report it.
* **`policies` and `_networkPolicyId` PATCH atomically since celigo-cli 2026.9.6.** They join `name` and `disabled` on `set`'s whitelist, so changing them no longer round-trips the document. `policies` replaces the whole array and is validated as a whole — a duplicate type + `keyResolver` pair or an invalid config rejects the patch. Since celigo-cli 2026.11.2, `logging.mode` and `logging.debugUntil` are on the whitelist too.
* **End users' credential copies are visible only through `connections --end-users`.** When a server connection has `endUserProvidedFields`, each end user supplies their own credentials, stored as an `mcpChild` connection with `_userId` set to them. `connections list`/`get` never show these copies; `mcp-servers connections <id> --end-users` is the only route that does, and its ids are what `end-users connection` (inspect one, credentials masked) and `end-users delete-connection` (force a reconnect with fresh credentials) take.
* **`download` carries the whole server, but never its secrets or its access.** The ZIP holds the server's tools, APIs, inline prompts, resource files, upstream MCP connections, capability sets, and traffic policies. It leaves out credentials, API tokens, end users, groups, roles, grants, network policies, and request-log settings. Resource files over 32 MiB uncompressed answer `413`.
* **`download` never overwrites a file without `--force`.** Since celigo-cli 2026.10.1 an existing destination is refused — before any request when you pass `-o` — and a directory is refused even with `--force`.
* **`install-template` starts a new install on every call.** The CLI never resends it after a timeout or a 5xx (since celigo-cli 2026.10.1), or after a `429` (since celigo-cli 2026.11.1). Do not retry an ambiguous failure blindly — check for the server (or the install-mode integration) first. A prompt-only template creates the server immediately, disabled; one that packs dependencies, such as a connection, hands off to an integration in install mode, with an install step per packed connection. Integration templates return `404` here — install them with `templates install`.
* **An installed server starts with no access.** `install-template` creates the server without end users, groups, roles, grants, credentials, or a network policy. Nobody can call it until an owner or administrator grants access and enables it.
* **The registry is not an MCP server.** `registry` lists what a credential can connect to and grants nothing. Give an AI client a server's own `remotes[].url`, and give a registry-aware client the registry URL that the command names on stderr.
* **The `assign-*` commands replace, not append.** Each listed end user's or group's grant for the server becomes exactly the given `--capabilities`. To add a capability, read the current grant from `effective-access` first and pass the complete list.
* **Servers start disabled, and need at least one enabled child.** A freshly created server's `disabled` cannot be flipped to `false` until one of its `tools[]` or `apis[]` entries is enabled.
* **`relativeURI` is unique per account** and must match `/<segment>` (alphanumerics, underscores, hyphens). A collision is rejected with `422 Unprocessable Entity`.
* **A request-log row has a `key` only when its payload was stored.** The server's `logging.mode` decides: `basic` and `noLogging` store none, and `log-detail` needs a key. Since celigo-cli 2026.11.2, `set <id> logging.mode=standard` changes the mode with one PATCH. `purge-request-logs` deletes stored payloads and keeps the rows, without a key.
* **The two log commands bound time differently.** `request-history` takes an exclusive `--time-gt` and an inclusive `--time-lte`, and sends Unix milliseconds. `purge-request-logs` takes an inclusive `--time-gte` and an inclusive `--time-lte`, and sends ISO datetimes. Each flag accepts either form.
* **No CLI surface for `/preview`.** That endpoint exists at `/api/mcpservers/{id}/preview` but is session-auth only and not reachable via bearer token — use the UI for preview. Request logs are reachable with a bearer token: since celigo-cli 2026.10.2, `request-history`, `log-detail`, `request-log-filters`, and `purge-request-logs` read and purge them.

## Related

* [tools](https://developer.celigo.com/cli/commands/tools.md) — the primary building block MCP servers expose; create tools first, then reference them from `tools[]`.
* [apis](https://developer.celigo.com/cli/commands/apis.md) — builder-mode APIs can also be exposed through an MCP server via `apis[]`.
* [end-users](https://developer.celigo.com/cli/commands/end-users.md) — the external people granted access; `effective-access` here mirrors their per-user view, and `connections --end-users` lists the `mcpChild` copies that `end-users connection`/`delete-connection` take.
* [groups](https://developer.celigo.com/cli/commands/groups.md) / [roles](https://developer.celigo.com/cli/commands/roles.md) — bundle grants that reference this server's tools, APIs, prompts, resources, and capability sets.
* [connections](https://developer.celigo.com/cli/commands/connections.md) — the account's own connections `connections[]` attaches; `endUserProvidedFields` (settable with `connections set`) names the fields end users supply themselves.
* [templates](https://developer.celigo.com/cli/commands/templates.md) — `templates marketplace --kind mcpserver` lists the MCP-server templates `install-template` installs; `download` produces the ZIP that a publisher uploads and that `install-template --zip` installs.
* [network-policies](https://developer.celigo.com/cli/commands/network-policies.md) — the IP allow and deny lists `set <id> _networkPolicyId=<policyId>` assigns to a server.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/mcp-servers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
