# agent mcp asset replace (Developer Preview)

Replace the asset set of an MCP server in the API Catalog.

:::note
This command is available as a developer preview. The command isn't generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don't implement functionality developed with these commands or tools.
:::

## Description for agent mcp asset replace

Replaces the full set of assets (tools, prompts, resources) for an MCP server with the asset items you supply. Provide the assets either inline with `--assets` (a JSON string, or `-` to read from stdin) or from a file with `--assets-file`. The JSON must be either an array of asset items or an object of the form `{ "assets": [...] }`. Each asset item may include `id`, `name`, `label`, `description`, `active`, and `kind`. This is a full replacement: existing assets not present in the supplied set are removed, so provide the complete desired asset set (read the current set first with `agent mcp asset list` or `agent mcp fetch`).

## Flags

| Flag Name (Long)  | Flag Name (Short) | Description                                                                                                                                         |
| ----------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-version`   | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                          |
| `--assets`        | N/A               | **Type:** Value<br><br>The desired asset allowlist as a JSON string (or "-" to read from stdin). Mutually exclusive with --assets-file.             |
| `--assets-file`   | N/A               | **Type:** Value<br><br>Path to a JSON file containing the desired asset allowlist. Mutually exclusive with --assets.                                |
| `--flags-dir`     | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                         |
| `--json`          | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                     |
| `--mcp-server-id` | `-i`              | **Type:** Value<br>**Required**<br><br>ID of the MCP server whose assets you want to replace.                                                       |
| `--target-org`    | `-o`              | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for agent mcp asset replace

Replace the assets inline with a JSON string:

```shell
sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets '{"assets":[{"name":"McpTool__add","active":true}]}' --target-org myOrg
```

Replace the assets from a JSON file:

```shell
sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets-file ./assets.json --target-org myOrg
```

Pipe the assets from stdin:

```shell
cat assets.json | sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets - --target-org myOrg
```
