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.
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
Anypoint CLI Commands Doc - https://docs.mulesoft.com/anypoint-cli/latest/anypoint-platform-cli-commands
005390972

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.