Loading...
Loading...
Secure an MCP server by applying a policy from the catalog. Handles multiple starting points: from an existing API Manager instance, from an MCP server asset in Exchange, or from scratch by publishing the MCP server first. Use when the user wants to secure an MCP server, add rate limiting, apply OAuth2, enforce IP allowlisting, or protect any MCP server with a policy — regardless of where they are in the setup process.
npx skill4agent add mulesoft/mulesoft-dx secure-mcp-serversequenceDiagram
participant User
participant Exchange
participant API Manager
participant Omni Gateway
participant Policy Catalog
User->>Exchange: Publish MCP Server spec
User->>Exchange: Find MCP Server asset
Exchange-->>User: groupId, assetId, version
User->>API Manager: Create Instance
API Manager-->>User: instanceId
User->>Omni Gateway: Deploy Instance
Omni Gateway-->>User: Deployment active
User->>Policy Catalog: Browse compatible policies
Policy Catalog-->>User: Policy template + config schema
User->>API Manager: Apply policy with config
API Manager-->>Omni Gateway: Policy enforcedcreateLoginPOST /accounts/loginurn:api:access-management{"username":"...","password":"..."}listMeGET /accounts/api/meurn:api:access-managementorganizationId$.user.organization.idflowchart TD
Start{What do you have?} -->|MCP server spec only| Full[Full Setup]
Start -->|Asset in Exchange| FromExchange[From Exchange]
Start -->|API Manager instance| PolicyOnly[Apply Policy Only]
Full --> S1[Step 1: Publish to Exchange]
S1 --> S2[Step 2: Find in Exchange]
FromExchange --> S2
S2 --> S3[Step 3: Select Environment]
S3 --> S4[Step 4: Select Gateway Target]
S4 --> S5[Step 5: Create API Instance]
S5 --> S6[Step 6: Deploy to Gateway]
PolicyOnly --> S3b[Step 3: Select Environment]
S3b --> S7[Step 7: List MCP Instances]
S6 --> S8[Step 8: Browse Policies]
S7 --> S8
S8 --> S9[Step 9: Apply Policy]
S9 --> Done[✓ MCP Server Protected]organizationIdorganizationIdorganizationIdapi: urn:api:exchange-experience
operationId: uploadAsset
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Your organization's Business Group GUID
groupId:
userProvided: true
description: The group ID for the asset (typically matches your organization ID)
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
assetId:
userProvided: true
description: A unique identifier for the asset in kebab-case
example: "my-mcp-server"
version:
userProvided: true
description: Semantic version for the asset
example: "1.0.0"
outputs:
- name: groupId
path: $.groupId
description: The group ID of the published asset
- name: assetId
path: $.assetId
description: The asset ID of the published asset
- name: assetVersion
path: $.version
description: The version of the published assetapi: urn:api:exchange-experience
operationId: searchAssets
inputs:
types:
value: "mcp"
description: Filter for MCP server assets only
outputs:
- name: groupId
path: $[*].groupId
labels: $[*].name
description: Group ID of the selected MCP server asset
- name: assetId
path: $[*].assetId
description: Asset ID of the selected MCP server asset
- name: assetVersion
path: $[*].version
description: Version of the selected MCP server assetapi: urn:api:access-management
operationId: listEnvironments
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID from Prerequisites
outputs:
- name: environmentId
path: $.data[*].id
labels: $.data[*].name
description: Selected environment ID (e.g., Production, Sandbox)status: "RUNNING"api: urn:api:api-portal-xapi
operationId: getGatewayTargets
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID
environmentId:
from:
variable: environmentId
description: Environment ID from Step 3
outputs:
- name: targetId
path: $.rows[*].id
labels: $.rows[*].name
description: Selected gateway target ID
- name: targetName
path: $.rows[*].name
description: Name of the selected gateway target
- name: gatewayVersion
value: "1.0.0"
description: Gateway version to use for deployment. The targets response may return "-" instead of a real version; use "1.0.0" as the default.isCloudHubnullfalsefalseapi: urn:api:api-manager
operationId: createApiInstance
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Your organization's Business Group GUID
environmentId:
from:
variable: environmentId
description: Target environment ID from Step 3
groupId:
from:
variable: groupId
description: Exchange asset group ID from Step 2
assetId:
from:
variable: assetId
description: Exchange asset ID from Step 2
assetVersion:
from:
variable: assetVersion
description: Exchange asset version from Step 2
instanceLabel:
userProvided: true
description: A human-readable label for this API instance (e.g., "my-mcp-server-v1")
example: "my-mcp-server-v1"
technology:
value: "flexGateway"
description: Gateway technology — this skill targets Omni Gateway deployments
endpoint.isCloudHub:
value: null
description: "Must be null for flexGateway technology (not false — false causes a validation error)"
endpoint.proxyUri:
userProvided: true
description: "The proxy listener URI. Ask the user which port the Omni Gateway should listen on, then use http://0.0.0.0:<port>/"
example: "http://0.0.0.0:8081/"
endpoint.uri:
userProvided: true
optional: true
description: The upstream backend URL for the MCP server. Ask the user if they want to provide it now or configure it later.
example: "https://backend.example.com/mcp/v1"
outputs:
- name: environmentApiId
path: $.id
description: The API instance ID in API Managertargetapi: urn:api:proxies-xapi
operationId: createProxyDeployment
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID
environmentId:
from:
variable: environmentId
description: Environment ID from Step 3 (used in both the URL path and the request body for HY deployment type)
environmentApiId:
from:
variable: environmentApiId
description: API instance ID from Step 5
type:
value: "HY"
description: "Deployment type for self-managed Omni Gateway (HY = Hybrid)"
targetId:
from:
variable: targetId
description: Omni Gateway target ID from Step 4
targetName:
from:
variable: targetName
description: Omni Gateway target name from Step 4
gatewayVersion:
value: "1.0.0"
description: "Gateway version for deployment. Use \"1.0.0\" as the default."
overwrite:
value: false
description: "Whether to overwrite an existing deployment"
outputs:
- name: deploymentId
path: $.id
description: The ID of the proxy deploymenttarget{
"type": "HY",
"targetId": "<from Step 4>",
"targetName": "<from Step 4>",
"gatewayVersion": "1.0.0",
"environmentId": "<from Step 3>",
"overwrite": false
}"Field environmentId is required for deployment type HY"environmentId"Field gatewayVersion is required for deployment type HY"getGatewayTargets"Policy implementations cannot be set because runtime version is unknown"gatewayVersionGET .../deploymentsfamily=agenticapi: urn:api:api-manager
operationId: listApiInstances
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID
environmentId:
from:
variable: environmentId
description: Environment ID from Step 3
family:
value: "agentic"
description: Filter for MCP server (agentic) instances only
outputs:
- name: environmentApiId
path: $.assets[*].apis[*].id
labels: $.assets[*].apis[*].autodiscoveryInstanceName
description: The MCP server instance ID in API ManagergroupIdassetIdassetVersionapi-portal-xapigetExchangePolicyTemplateslistPolicyTemplatesapiInstanceIdenvironmentIdapi: urn:api:api-portal-xapi
operationId: getExchangePolicyTemplates
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID
apiInstanceId:
from:
variable: environmentApiId
description: API instance ID from Step 5 or Step 7 (filters for compatible templates)
environmentId:
from:
variable: environmentId
description: Environment ID from Step 3
latest:
value: "true"
description: Return only the latest version of each template
includeConfiguration:
value: "true"
description: Include the configuration schema for each template
outputs:
- name: policyGroupId
path: $[*].groupId
labels: $[*].assetId
description: Exchange group ID of the selected policy template
- name: policyAssetId
path: $[*].assetId
description: Exchange asset ID of the selected policy template
- name: policyAssetVersion
path: $[*].version
description: Exchange version of the selected policy template (gateway-compatible)
- name: policyConfiguration
path: $[*].configuration
description: Configuration schema with gateway-compatible property names and defaultspolicyConfigurationapiInstanceIdenvironmentIdlistPolicyTemplatespolicyConfigurationconfigurationDataapi: urn:api:api-manager
operationId: applyApiInstancePolicy
inputs:
organizationId:
from:
api: urn:api:access-management
operation: listMe
field: $.user.organization.id
description: Organization ID
environmentId:
from:
variable: environmentId
description: Environment ID from Step 3
environmentApiId:
from:
variable: environmentApiId
description: API instance ID from Step 5 or Step 7 (or provided manually)
groupId:
from:
variable: policyGroupId
description: Policy Exchange group ID from Step 8
assetId:
from:
variable: policyAssetId
description: Policy Exchange asset ID from Step 8
assetVersion:
from:
variable: policyAssetVersion
description: Policy Exchange version from Step 8
outputs:
- name: policyId
path: $.id
description: The ID of the applied policy instancegetExchangePolicyTemplatespolicyConfigurationcredentialsOriginHasHttpBasicAuthenticationHeadercredentialsOrigin?allowDuplicated=truegetExchangePolicyTemplatesapiInstanceIdname"The policy to be created is missing at least one of the following properties related to the policy template: 'groupId', 'assetId', 'assetVersion'."listPolicyTemplatesgetExchangePolicyTemplatesapi-portal-xapimcp