Anypoint Platform Deployment & MCP Server Step-by-Step Guide
1. What is an MCP Server?
Anypoint Platform Deployment & MCP Server Step-by-Step Guide
1. What is an MCP Server?
MCP (Model Context Protocol) is an open standard that allows AI agents (like Claude, Copilot, or any LLM) to call external tools and services in a structured, protocol-safe way.
A MuleSoft MCP Server wraps your Mule flows as MCP Tools — each tool has:
-
A name — e.g., ‘list_employees’
-
A description — tells the AI what this tool does
-
A parameters schema — JSON Schema defining required/optional inputs)
-
A response — what the tool returns to the AI
The AI agent sends JSON-RPC calls to your MCP endpoint, and your Mule flows process them like normal HTTP requests.
MCP Architecture

MCP Architecture
2. Architecture Overview
A complete MCP Server in MuleSoft has 3 layers

Architecture Overview — 3 layers
3. Prerequisites — pom.xml Dependency
Add the MCP Connector to your pom.xml before creating any MCP flows:
<dependency>
<groupId>com.mulesoft.connectors</groupId>
<artifactId>mule-mcp-connector</artifactId>
<version>1.5.0</version>
<classifier>mule-plugin</classifier>
</dependency>
Also ensure you have the MuleSoft EE repository in <repositories>:
<repository>
<id>anypoint-exchange-v3</id>
<name>Anypoint Exchange</name>
<url>https://maven.anypoint.mulesoft.com/api/v3/maven</url>
</repository>
4. Transport Options — SSE vs Streamable HTTP
The MCP Connector supports two transport mechanisms:
| Transport | XML Element | Use Case | Endpoint |
| — — — — — -| — — — — — — | — — — — — | — — — — — |
Streamable HTTP | mcp:streamable-http-server-connection | Default; modern clients (Claude Desktop, Cline) | POST /mcp |
SSE (Server-Sent Events) | mcp:sse-server-connection | Legacy MCP clients | GET /sse + POST /messages |
Streamable HTTP (Recommended)
<mcp:server-config name="MCP_Server_Config" serverName="my-server" serverVersion="1.0.0">
<mcp:streamable-http-server-connection listenerConfig="HTTP_Listener_config" mcpEndpointPath="/mcp"/>
</mcp:server-config>
SSE Transport (Legacy)
<mcp:server-config name="MCP_Server_Config_SSE" serverName="my-server-sse" serverVersion="1.0.0">
<mcp:sse-server-connection listenerConfig="HTTP_Listener_config"
ssePath="/sse" messagePath="/messages"/>
</mcp:server-config>
5. Step-by-Step: Register an MCP Server Manually
✅ Step 1 — Add MCP Connector Dependency
In pom.xml:
<dependency>
<groupId>com.mulesoft.connectors</groupId>
<artifactId>mule-mcp-connector</artifactId>
<version>1.5.0</version>
<classifier>mule-plugin</classifier>
</dependency>
✅ Step 2 — Create the Global Server Config
In global.xml (or a dedicated config XML file), add the XML namespaces and the ‘mcp:server-config’ global element.
Required XML namespaces at the root ‘<mule>’ element:
xmlns:mcp="http://www.mulesoft.org/schema/mule/mcp
xsi:schemaLocation="...
http://www.mulesoft.org/schema/mule/mcp
http://www.mulesoft.org/schema/mule/mcp/current/mule-mcp.xsd"
The global config element:
<mcp:server-config name="MY_MCP_Server_Config" serverName="my-company-tools" serverVersion="1.0.0" doc:name="My MCP Server Config" doc:description="Exposes company tools as MCP tools">
<mcp:streamable-http-server-connection listenerConfig="HTTP_Listener_config" mcpEndpointPath="/my-tools"/>
</mcp:server-config>
⚠️ Each ‘mcp:server-config’ must use a unique ‘mcpEndpointPath’ if you have multiple MCP servers sharing the same HTTP Listener.
✅ Step 3 — Create a Tool Flow with ‘mcp:tool-listener’
Each MCP tool = one Mule flow with ‘mcp:tool-listener as the event source:
<flow name="my-tool-flow">
<mcp:tool-listener config-ref="MY_MCP_Server_Config" name="my_tool_name" doc:name="My Tool Listener">
<!-- Step 4: Description for the AI -->
<mcp:description>
What this tool does — the AI reads this to decide when to call it.
</mcp:description>
<!-- Step 4: JSON Schema for parameters -->
<mcp:parameters-schema><![CDATA[{
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "Description of param1"
}
},
"required": ["param1"]
}]]></mcp:parameters-schema>
<!-- Step 5: Success response -->
<mcp:responses>
<mcp:text-tool-response-content text="#[output application/json --- payload]"/>
</mcp:responses>
<!-- Step 5: Error response -->
<mcp:on-error-responses>
<mcp:text-tool-response-content text="#[output application/json --- {error: error.description}]"/>
</mcp:on-error-responses>
</mcp:tool-listener>
<!-- Step 6: Business logic goes here -->
<logger level="INFO" message="Tool invoked with: #[payload]"/>
<ee:transform>
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
{ result: "Hello from my_tool_name", input: payload }
]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
✅ Step 4 — Define JSON Schema for Parameters
The ‘mcp:parameters-schema’ uses JSON Schema Draft-07 to define tool inputs. The AI agent uses this to know what to send.
{
"type": "object",
"properties": {
"employeeId": {
"type": "string",
"description": "The unique employee ID (e.g., EMP001)"
},
"department": {
"type": "string",
"enum": ["Engineering", "HR", "Finance", "Marketing", "Sales"],
"description": "Filter by department name"
},
"status": {
"type": "string",
"enum": ["Active", "Inactive"],
"default": "Active",
"description": "Filter by employment status"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 10,
"description": "Maximum number of results to return"
}
},
"required": ["employeeId"]
}
JSON Schema type reference:
| Type | Example | Mule DW Access |
| — — — | — — — — -| — — — — — — — — |
| ‘string’ | “hello” | payload.fieldName |
| ‘integer’ | 42 | payload.fieldName as Number |
| ‘boolean’ | true | payload.fieldName as Boolean |
| ‘array’ | [“a”,”b”] | payload.fieldName |
| ‘object’ | {“key”:”val”} | payload.fieldName.key |
✅ Step 5 — Define Response Templates
The response is defined inside ‘mcp:tool-listener’ using ‘mcp:responses’:
<!-- TEXT response (most common) -->
<mcp:responses>
<mcp:text-tool-response-content
text="#[output application/json --- payload]"/>
</mcp:responses>
<!-- Error response (shown when flow throws an exception) -->
<mcp:on-error-responses>
<mcp:text-tool-response-content
text="#[output application/json --- {
error: error.description,
errorType: error.errorType.identifier
}]"/>
</mcp:on-error-responses>
💡 The ‘text’ attribute is a DataWeave expression — you can format the response however the AI needs it.
✅ Step 6 — Add Business Logic
After the ‘mcp:tool-listener’, add any Mule components:
<flow name="get-employee-flow">
<mcp:tool-listener config-ref="MY_MCP_Server_Config"
name="get_employee"
.../>
<!-- Access tool parameters via payload -->
<!-- payload.employeeId, payload.department, etc. -->
<logger level="INFO"
message="#['Tool called with employeeId: ' ++ payload.employeeId]"/>
<!-- HTTP call to a system API -->
<http:request config-ref="Employee_API_Config"
method="GET"
path="#['/employees/' ++ payload.employeeId]"/>
<!-- OR: DataWeave transformation on static data -->
<ee:transform>
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
var employees = readUrl("classpath://data/employees.json", "application/json")
var id = payload.employeeId
---
(employees filter $.employeeId == id)[0]
]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
6. Global Config Reference
Complete annotated ‘mcp:server-config’ with all attributes:
<mcp:server-config name="MCP_Server_Config" <!-- Bean name — referenced by config-ref --> serverName="my-mcp-server" <!-- Human-readable name sent to AI clients -->
serverVersion="1.0.0" <!-- Version string -->
doc:name="MCP Server Config" <!-- Display name in Anypoint Studio -->
doc:description="..."> <!-- Flow documentation -->
<!-- OPTION A: Streamable HTTP (recommended) -->
<mcp:streamable-http-server-connection
listenerConfig="HTTP_Listener_config" <!-- Must reference an http:listener-config -->
mcpEndpointPath="/mcp"/> <!-- URL path AI clients connect to -->
<!-- OPTION B: SSE (Server-Sent Events) -->
<!-- <mcp:sse-server-connection
listenerConfig="HTTP_Listener_config"
ssePath="/sse"
messagePath="/messages"/> -->
</mcp:server-config>
Key Rules for ‘mcp:server-config’
-
Must be a global element — place in ‘global.xml’ or any config XML (not inside a flow)
-
‘name’ must be unique across the entire application
-
‘mcpEndpointPath’ must be unique per HTTP listener port
-
‘listenerConfig’ must reference an existing ‘http:listener-config’ by name
-
Multiple servers are allowed — each on a different path (e.g., ‘/mcp’, ‘/employee-mcp’, ‘/admin-mcp’)
7. Tool Listener Reference
Complete annotated ‘mcp:tool-listener’ with all child elements:
<mcp:tool-listener
config-ref="MCP_Server_Config" <!-- References the mcp:server-config name -->
name="tool_name_for_ai" <!-- Snake_case; AI uses this to call the tool -->
doc:name="Tool Display Name" <!-- Display name in Studio -->
doc:description="..."> <!-- Flow documentation -->
<!-- REQUIRED: What the AI sees when choosing this tool -->
<mcp:description>
Detailed description of what this tool does, when to use it,
and what it returns. Be verbose — the AI reads this.
</mcp:description>
<!-- REQUIRED: JSON Schema defining parameters the AI must provide -->
<mcp:parameters-schema><![CDATA[
{
"type": "object",
"properties": {
"requiredParam": {
"type": "string",
"description": "This parameter is mandatory"
},
"optionalParam": {
"type": "integer",
"default": 10,
"description": "This parameter has a default"
}
},
"required": ["requiredParam"]
}
]]></mcp:parameters-schema>
<!-- REQUIRED: What to send back to the AI on success -->
<mcp:responses>
<mcp:text-tool-response-content
text="#[output application/json --- payload]"/>
</mcp:responses>
<!-- RECOMMENDED: What to send back to the AI on error -->
<mcp:on-error-responses>
<mcp:text-tool-response-content
text="#[output application/json --- {error: error.description}]"/>
</mcp:on-error-responses>
</mcp:tool-listener>
How the AI Sees Your Tool
When an AI connects to your MCP endpoint and calls ‘tools/list’, it receives:
{
"tools": [
{
"name": "tool_name_for_ai",
"description": "Detailed description of what this tool does...",
"inputSchema": {
"type": "object",
"properties": {
"requiredParam": { "type": "string", "description": "..." },
"optionalParam": { "type": "integer", "default": 10, "description": "..." }
},
"required": ["requiredParam"]
}
}
]
}
8. Testing Your MCP Server
Once your Mule app is running locally (default: ‘http://localhost:8081'), test using ‘curl’:
Step 1 — Initialize the MCP Session
curl -X POST http://localhost:8081/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": { "name": "test-client", "version": "1.0" }
},
"id": 1
}
Expected response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"serverInfo": { "name": "mulesoft-code-review-agent", "version": "1.0.0" },
"capabilities": { "tools": {} }
}
}
Step 2 — List Available Tools
curl -X POST http://localhost:8081/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 2
}
Step 3 — Call a Tool
Call the Employee MCP Server (demo) — list_employees
curl -X POST http://localhost:8081/employee-mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "list_employees",
"arguments": {
"department": "Engineering",
"status": "Active"
}
},
"id": 3
}
Call get_employee_by_id
curl -X POST http://localhost:8081/employee-mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_employee_by_id",
"arguments": {
"employeeId": "EMP001"
}
},
"id": 4
}
Call search_employees
curl -X POST http://localhost:8081/employee-mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "search_employees",
"arguments": {
"query": "MuleSoft",
"field": "skill"
}
},
"id": 5
}
9. This Project’s MCP Servers
This project has two registered MCP servers:
| Server Config Name | Endpoint Path | Tools | File |
| — — — — — — — — — -| — — — — — — — -| — — — -| — — — |
| MCP_Server_Config | /mcp | review_code, review_azure_pr | mcp-server.xml |
| Employee_MCP_Server_Config | /employee-mcp | list_employees, get_employee_by_id, search_employees | employee-mcp-server-demo.xml |
Project File Mapping
src/main/mule/
├── global.xml ← HTTP_Listener_config + MCP_Server_Config
├── mcp-server.xml ← review_code + review_azure_pr tools
├── employee-mcp-server-demo.xml ← Employee_MCP_Server_Config + 3 employee tools (DEMO)
├── employee-files.xml ← File-based employee flows
├── hello-world-mule-app.xml ← Hello World flow
└── code-review-agent.xml ← Code review sub-flows
10. Registering in VS Code / Cline (Claude)
To connect Cline (VS Code) or Claude Desktop to your running Mule MCP server:
Option A — VS Code Cline MCP Settings
Open VS Code settings → search ‘MCP’ → add server:
{
"mcpServers": {
"mulesoft-code-review": {
"url": "http://localhost:8081/mcp",
"transport": "http"
},
"mulesoft-employee-tools": {
"url": "http://localhost:8081/employee-mcp",
"transport": "http"
}
}
}
Option B — Claude Desktop ‘claude_desktop_config.json’
Located at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"mulesoft-employee-tools": {
"command": "curl",
"args": [
"-X", "POST",
"http://localhost:8081/employee-mcp"
]
}
}
}
💡 For Streamable HTTP transport, the server URL is the direct POST endpoint. No special launch command needed — the Mule app must already be running.
Option C — Manual Registration via MCP Inspector
Use the open-source [MCP Inspector]
(https://github.com/modelcontextprotocol/inspector) to connect and test:
bash
npx @modelcontextprotocol/inspector
http://localhost:8081/employee-mcp
📚 References
| Resource | Link |
| — — — — — | — — — |
| MuleSoft MCP Connector Docs |
https://docs.mulesoft.com/mcp-connector/latest/ |
| MuleSoft General Docs |
https://docs.mulesoft.com/general/ |
| MCP Protocol Specification |
https://spec.modelcontextprotocol.io/
| Anypoint Exchange — MCP Connector |
https://www.mulesoft.com/exchange/com.mulesoft.connectors/mule-mcp-connector/ |
| JSON Schema Draft-07 Reference |
https://json-schema.org/draft-07/schema |
| MCP Inspector (Testing Tool) |
메타데이터
- post_id
- 3d7c5fc138b2
- slug
- anypoint-platform-deployment-mcp-server-step-by-step-guide-3d7c5fc138b2
- url
- https://medium.com/another-integration-blog/anypoint-platform-deployment-mcp-server-step-by-step-guide-3d7c5fc138b2
- canonical_url
- https://medium.com/another-integration-blog/anypoint-platform-deployment-mcp-server-step-by-step-guide-3d7c5fc138b2
- author_url
- https://medium.com/@stutitank06
- status
- ok
- fetched_at
- 2026-07-09 16:25:21