An AI host connects through an MCP client to a MuleSoft MCP server; governed tools route through policies and Mule flows to existing APIs and enterprise systems
MCP supplies the agent-facing protocol. Mule flows and existing API policies remain responsible for enterprise access and execution.

MCP in one minute

MCP is an open protocol for connecting an AI host to external capabilities. A host manages an MCP client connection; an MCP server offers capabilities through a standard interface. In the MuleSoft ecosystem, the MCP Connector lets a Mule application act as either side of that connection.

MCP primitiveWhat it doesMuleSoft example
ToolsActions the model can request through its host, subject to the host's controls.get-order-status or a carefully approved request-refund flow.
ResourcesAddressable context that a client can read.A customer-approved policy excerpt or a current shipment record.
PromptsReusable prompt templates chosen by the host or user.A structured “summarize an integration incident” workflow with required inputs.

MCP is not a replacement for APIs, an agent framework, or an authorization system. It standardizes how compatible AI hosts discover and use capabilities; MuleSoft still owns the flow logic, data contract, and access boundary.

Why use MCP with MuleSoft?

  • Reuse integration investment: Wrap existing APIs, connectors, and Mule flows rather than giving an agent direct credentials to every SaaS or legacy system.
  • Present agent-sized operations: Expose a small, descriptive tool with a typed input schema instead of a broad CRUD API or an entire enterprise system.
  • Orchestrate across systems: A Mule flow can validate inputs, call multiple backends, transform their responses, and return only the context the task needs.
  • Interoperate: A compatible host can discover the same MCP tools without a custom adapter for every model vendor or client.
  • Apply existing controls: Use supported authentication, API policies, schema validation, access rules, and observability at the Mule boundary.

The practical payoff is a controlled bridge from an agent to business workflows, not “AI access to everything.” Start with one read-only task, measure its accuracy and latency, then add write actions only with explicit authorization and approval.

Expose a Mule flow as an MCP server

With MCP Connector 1.7, configure a server on Streamable HTTP, then attach a Tool Listener to a flow. The example below exposes a single order-status lookup. The authorization and lookup flow must enforce the caller's access to that order; a schema alone is not a security control.

<http:listener-config name="HTTP_Listener_Config">
  <http:listener-connection host="0.0.0.0" port="8081"/>
</http:listener-config>

<mcp:server-config name="MCP_Server_Config"
    serverName="Order Operations" serverVersion="1.0.0">
  <mcp:streamable-http-server-connection
      listenerConfig="HTTP_Listener_Config" mcpEndpointPath="/mcp"/>
</mcp:server-config>

<flow name="get-order-status">
  <mcp:tool-listener config-ref="MCP_Server_Config" name="get-order-status">
    <mcp:description>Return the status of an order the caller may access.</mcp:description>
    <mcp:parameters-schema><![CDATA[{
      "type":"object",
      "properties":{"orderId":{"type":"string"}},
      "required":["orderId"],
      "additionalProperties":false
    }]]></mcp:parameters-schema>
    <mcp:responses>
      <mcp:text-tool-response-content text="#[payload.^raw]"/>
    </mcp:responses>
  </mcp:tool-listener>
  <flow-ref name="authorize-and-read-order"/>
</flow>

The code is a configuration pattern, not a complete deployable project: add the connector dependency, Mule namespaces and schema locations, and implement authorize-and-read-order with your real identity and data rules.

Use a remote MCP server from Mule

Mule can also act as an MCP client. This is useful when an existing integration orchestrates an AI capability or a separately managed tool server. Keep the endpoint and credentials in protected configuration properties.

<mcp:client-config name="Fulfillment_MCP">
  <mcp:streamable-http-client-connection
      serverUrl="${mcp.server.url}" mcpEndpointPath="/mcp">
    <mcp:default-request-headers>
      <mcp:default-request-header key="Authorization"
          value="Bearer ${mcp.server.token}"/>
    </mcp:default-request-headers>
  </mcp:streamable-http-client-connection>
</mcp:client-config>

<mcp:call-tool config-ref="Fulfillment_MCP" toolName="get-order-status">
  <mcp:arguments><![CDATA[#[{orderId: vars.orderId}]]]></mcp:arguments>
</mcp:call-tool>

A practical rollout

  1. Choose a bounded use case. Pick one agent task and name the systems, data fields, caller identity, and business outcome it needs.
  2. Choose the primitive. Use a tool for a discrete action, a resource for addressable context, and a prompt for a reusable interaction template.
  3. Build the Mule boundary. Reuse existing API-led flows and connectors, expose only the necessary MCP capabilities, and define clear names, descriptions, and JSON schemas.
  4. Secure and govern it. Authenticate clients, authorize every operation and record, apply supported MCP/API policies, rate limits and TLS, and record a correlation ID.
  5. Connect one host. Use Streamable HTTP and a supported MCP client. Confirm which tools and resources the host discovers and what user consent is shown before tool execution.
  6. Test before expanding. Test unauthorized callers, malformed arguments, sensitive-field redaction, timeouts, duplicate actions, and downstream outages. Review traces and audit logs before enabling a write operation.

Security and deployment notes

  • MCP does not grant access by itself. Enforce authentication and authorization in Mule and again at downstream systems; do not trust model-generated arguments or tool descriptions.
  • Expose narrow tools with least-privilege inputs and minimal responses. Avoid token passthrough; use credentials issued for the intended resource and preserve user-level authorization where the workflow requires it.
  • Require explicit host-side consent for tool calls. Put a human approval step in workflows that create payments, alter customer records, or trigger other consequential actions.
  • MuleSoft documents MCP Support, schema-validation, and attribute-based access-control policies for MCP endpoints. Confirm policy and runtime availability for your deployment target and apply authentication and rate limiting before production.
  • Prefer Streamable HTTP for new deployments. MuleSoft marks SSE transports deprecated; its SSE server is limited to single-replica deployments. For multi-replica Streamable HTTP deployments using elicitation, configure the documented distributed session stores.
  • Minimize personal and confidential data in resource and tool responses. Redact logs, retain audit events, rotate credentials, and monitor tool calls with distributed tracing.

Further reading