Loading

Anypoint CLI commands to create API Instances and Deploy to Flex Instances in API Manager

Veröffentlichungsdatum: Aug 13, 2026
Beschreibung

The user wanted the exact Anypoint CLI command to create an API instance in Agent and tool instances in MuleSoft and deploy it in API Manager.

Lösung

Create the API instance through Anypoint CLI by following the required multi-step process rather than expecting a single command. First create the MCP API instance, then add the upstream, configure the MCP proxy settings such as deployment type, scheme, port, and path, and finally deploy the API instance to Flex Gateway. 

There are 4 steps to complete the whole process of creating and deploying instances

The required CLI operations are :

1. Create MCP API instance

anypoint-cli-v4 api-mgr:api:manage \
<ASSET_ID> \
<ASSET_VERSION> \
<GROUP_ID> \
--organization='<ORGANIZATION_ID>' \
--environment='<ENVIRONMENT_NAME>' \
--apiInstanceLabel='<API_INSTANCE_LABEL>' \
--type=mcp \
--isFlex

2. Create upstream

anypoint-cli-v4 api-mgr:upstream:add \
<API_INSTANCE_ID> \
'<UPSTREAM_URL>' \
--organization='<ORGANIZATION_ID>' \
--environment='<ENVIRONMENT_NAME>' \
--label='<UPSTREAM_LABEL>'

3. Configure MCP proxy (port and base path for api)

anypoint-cli-v4 api-mgr:api:edit \
<API_INSTANCE_ID> \
--organization='<ORGANIZATION_ID>' \
--environment='<ENVIRONMENT_NAME>' \
--isFlex \
--withProxy \
--type=mcp \
--deploymentType=hybrid \
--scheme=<HTTP_OR_HTTPS> \
--port=<PROXY_PORT> \
--path=<PROXY_PATH>

4. Deploy to Flex Gateway

anypoint-cli-v4 api-mgr:api:deploy \
<API_INSTANCE_ID> \
--organization='<ORGANIZATION_ID>' \
--environment='<ENVIRONMENT_NAME>' \
--target='<FLEX_GATEWAY_TARGET_ID>' \
--gatewayVersion='<GATEWAY_VERSION>'


This four-step sequence can be used to automate creation and deployment of an MCP API instance through Anypoint CLI.

NOTE: Please note that the above is for creating MCP Instance only, depending on your type ensure to change the values for type attribute

Anypoint CLI Commands - https://docs.mulesoft.com/anypoint-cli/latest/anypoint-platform-cli-commands

Zusätzliche Ressourcen

Anypoint CLI Commands Doc - https://docs.mulesoft.com/anypoint-cli/latest/anypoint-platform-cli-commands

Nummer des Knowledge-Artikels

005390972

 
Laden
Salesforce Help | Article