---
schema_version: "1"
id: 0a6e34469123cf2606d4b59612a56985195719526536d6d7041d1283bd7bce46
title: agent mcp create (Developer Preview)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/agent/cli_reference_agent_mcp_create.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_mcp_create.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fde572aef7cd78da00e965437c3466c7fc4787349cb69179f353e269b2473740
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# agent mcp create (Developer Preview)

Create 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 create

Registers an external Model Context Protocol (MCP) server with the API Catalog and discovers its assets (tools, prompts, and resources). Provide the server URL and, when the server requires it, OAuth authorization details. When the authorization type is OAUTH you must supply the identity provider, client ID, client secret, and scope.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;auth&#8209;type</code> | N/A | **Type:** Value<br>**Valid Values:** `OAUTH`, `NO_AUTH`<br>**Default value:** `NO_AUTH`<br><br>Authorization type to use when connecting to the MCP server. |
| <code>&#8209;&#8209;client&#8209;id</code> | N/A | **Type:** Value<br><br>OAuth client ID. Required when auth-type is OAUTH. |
| <code>&#8209;&#8209;client&#8209;secret</code> | 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. |
| <code>&#8209;&#8209;description</code> | N/A | **Type:** Value<br><br>Description of the MCP server. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;identity&#8209;provider</code> | N/A | **Type:** Value<br><br>Identity provider to use for OAuth authorization. Required when auth-type is OAUTH. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;label</code> | N/A | **Type:** Value<br><br>Human-readable label for the MCP server. |
| <code>&#8209;&#8209;name</code> | <code>&#8209;n</code> | **Type:** Value<br>**Required**<br><br>Unique name of the MCP server. |
| <code>&#8209;&#8209;scope</code> | N/A | **Type:** Value<br><br>OAuth scope to request. Required when auth-type is OAUTH. |
| <code>&#8209;&#8209;server&#8209;url</code> | N/A | **Type:** Value<br>**Required**<br><br>URL of the external MCP server. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **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 create

Create an MCP server with no authentication:

```shell
sf agent mcp create --name myServer --server-url https://mcp.example.com --target-org myOrg
```

Create an MCP server that uses OAuth authentication, piping the client secret from stdin to keep it out of shell history:

```shell
cat secret.txt | sf agent mcp create --name myServer --server-url https://mcp.example.com --auth-type OAUTH --identity-provider myIdp --client-id abc123 --client-secret - --scope "read write" --target-org myOrg
```
<!-- prettier-ignore-end -->
