agent mcp create (Developer Preview)

<!-- prettier-ignore-start -->

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>‑‑api‑version</code> N/A Type: Value<br><br>Override the api version used for api requests made by this command
<code>‑‑auth‑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>‑‑client‑id</code> N/A Type: Value<br><br>OAuth client ID. Required when auth-type is OAUTH.
<code>‑‑client‑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>‑‑description</code> N/A Type: Value<br><br>Description of the MCP server.
<code>‑‑flags‑dir</code> N/A Type: Value<br><br>Import flag values from a directory.
<code>‑‑identity‑provider</code> N/A Type: Value<br><br>Identity provider to use for OAuth authorization. Required when auth-type is OAUTH.
<code>‑‑json</code> N/A Type: Boolean<br><br>Format output as json.
<code>‑‑label</code> N/A Type: Value<br><br>Human-readable label for the MCP server.
<code>‑‑name</code> <code>‑n</code> Type: Value<br>Required<br><br>Unique name of the MCP server.
<code>‑‑scope</code> N/A Type: Value<br><br>OAuth scope to request. Required when auth-type is OAUTH.
<code>‑‑server‑url</code> N/A Type: Value<br>Required<br><br>URL of the external MCP server.
<code>‑‑target‑org</code> <code>‑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:

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:

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 -->