# agent mcp update (Developer Preview)

Update an MCP server registered 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 update

Updates an existing MCP server in the API Catalog. Only the fields you provide are changed; omitted fields are left untouched. You can update the label, description, and server URL, and replace the authorization configuration. When setting `--auth-type OAUTH`, you must also provide `--identity-provider`, `--client-id`, `--client-secret`, and `--scope`. When setting `--auth-type NO_AUTH`, no authorization credentials are required. At least one updatable field must be supplied.

## 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                                                                |
| `--auth-type`         | N/A               | **Type:** Value<br>**Valid Values:** `OAUTH`, `NO_AUTH`<br><br>Authorization type to apply to the MCP server (OAUTH or NO_AUTH).                          |
| `--client-id`         | N/A               | **Type:** Value<br><br>OAuth client ID (required when --auth-type is OAUTH).                                                                              |
| `--client-secret`     | N/A               | **Type:** Value<br><br>OAuth client secret (required when --auth-type is OAUTH). Pass "-" to read it from stdin (piped) and keep it out of shell history. |
| `--description`       | N/A               | **Type:** Value<br><br>New description for the MCP server.                                                                                                |
| `--flags-dir`         | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                               |
| `--identity-provider` | N/A               | **Type:** Value<br><br>Identity provider name for OAuth authorization (required when --auth-type is OAUTH).                                               |
| `--json`              | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                           |
| `--label`             | N/A               | **Type:** Value<br><br>New display label for the MCP server.                                                                                              |
| `--mcp-server-id`     | `-i`              | **Type:** Value<br>**Required**<br><br>ID of the MCP server to update.                                                                                    |
| `--scope`             | N/A               | **Type:** Value<br><br>OAuth scope (required when --auth-type is OAUTH).                                                                                  |
| `--server-url`        | N/A               | **Type:** Value<br><br>New endpoint URL of the MCP server.                                                                                                |
| `--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 update

Update the label and description of an MCP server in the default target org:

```shell
sf agent mcp update --mcp-server-id 0XSxx0000000001 --label "Orders MCP" --description "Order tooling" --target-org myOrg
```

Update the server URL and switch the authorization to OAuth, piping the client secret from stdin and outputting as JSON:

```shell
cat secret.txt | sf agent mcp update --mcp-server-id 0XSxx0000000001 --server-url https://mcp.example.com --auth-type OAUTH --identity-provider MyIdp --client-id abc --client-secret - --scope "read write" --target-org myOrg --json
```
