---
schema_version: "1"
id: 41646a79c057562401b468f90973846ba8b61e72fa957c3f2099208bc40f57aa
title: agent mcp fetch (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_fetch.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_mcp_fetch.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 84a4c7060730942e737b5a2fd67e2ffbe3e30ce7a57c879b52fa1a5cb0933b28
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# agent mcp fetch (Developer Preview)

Fetch the live assets (tools, prompts, resources) advertised by an MCP server.

**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 fetch

Performs a live fetch against the configured MCP server identified by its ID, returning the assets (MCP tools, prompts, and resources) it currently advertises along with their status and activation state. Use this to refresh the view of what an MCP server exposes before activating its assets as agent actions.

## 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;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;mcp&#8209;server&#8209;id</code> | <code>&#8209;i</code> | **Type:** Value<br>**Required**<br><br>ID of the MCP server to fetch assets from. |
| <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 fetch

Fetch the assets advertised by an MCP server in the default target org:

```shell
sf agent mcp fetch --target-org myOrg --mcp-server-id 0XSxx0000000001
```

Fetch MCP server assets and output as JSON:

```shell
sf agent mcp fetch --target-org myOrg --mcp-server-id 0XSxx0000000001 --json
```
<!-- prettier-ignore-end -->
