mulesoft-doc-mcp
v1.0.2
Published
MCP server for searching and fetching live MuleSoft documentation
Maintainers
Readme
mulesoft-doc-mcp
Even the biggest LLMs have limited knowledge of MuleSoft. As a niche integration platform, details about Anypoint Platform, DataWeave syntax, connector configurations, CloudHub deployment, and API governance are often missing, outdated, or hallucinated in model responses.
This MCP server fixes that by grounding LLMs with real-time, accurate data pulled directly from docs.mulesoft.com. Instead of relying on training data, your AI assistant can search and read the actual documentation on the fly -- covering Mule Runtime, DataWeave, connectors, API Manager, CloudHub 2, and every other MuleSoft product.
Example
Question: How to check if characters in a string meet a specific condition using DataWeave?
The function you're looking for is someCharacter from dw::core::Strings (available since DataWeave 2.4.0).
It checks whether a condition is valid for at least one character in a string.
Signature:
someCharacter(text: String, condition: (character: String) -> Boolean): BooleanExample — check if a string has any uppercase character:
%dw 2.0
import * from dw::core::Strings
output application/json
---
"someCharacter" someCharacter isUpperCase($)Output: true
You can pass any condition, e.g.:
someCharacter isLowerCase($)— has any lowercase?someCharacter isNumeric($)— has any digit?someCharacter ((c) -> c == "@")— contains an@?
There's also the companion function everyCharacter if you need all characters to match, not just one.
In DataWeave 2.0, checking if the characters in a string meet a specific condition can be achieved in a few different ways depending on your exact requirements (e.g., checking if all characters match, if at least one matches, or evaluating complex custom logic).
Here are the three most effective methods:
1. Using Built-in String Functions (dw::core::Strings)
If you are checking for standard conditions—such as whether all characters are numeric, alphabetic, uppercase, or lowercase—MuleSoft provides built-in utilities in the dw::core::Strings module. These check the entire string at once.
%dw 2.0
output application/json
import * from dw::core::Strings
---
{
allNumbers: isNumeric("12345"),
allLetters: isAlpha("MuleSoft"),
isAlphaNum: isAlphanumeric("Mule12"),
allLower: isLowerCase("hello"),
allUpper: isUpperCase("WORLD")
}2. Using Regular Expressions (matches and contains) ...
In DataWeave, checking if characters in a string meet a specific condition can be handled in two main ways depending on your use case: using Regular Expressions (Regex) for pattern matching, or splitting the string into an array of characters for functional checks.
1. The Regex Approach (Best for standard patterns)
%dw 2.0
output application/json
var standardInput = "MuleSoft123"
---
{
isAllUppercase: standardInput matches /^[A-Z]+$/,
containsNumbers: standardInput matches /.*[0-9].*/,
isAlphanumeric: standardInput matches /^[a-zA-Z0-9]+$/
}2. The Functional Approach (Best for complex logic) ...
The MCP gives a precise, grounded answer pointing to the exact function (someCharacter). Without it, LLMs fall back to verbose workarounds using regex or manual string splitting — technically valid but missing the purpose-built function.
Tools
| Tool | Description |
|------|-------------|
| search_docs | Search across the entire MuleSoft documentation ecosystem via Algolia. Returns the top 5 results with titles, paths, and snippets. |
| get_doc_page | Fetch any MuleSoft doc page and convert it to clean Markdown. Supports all products (Mule Runtime, CloudHub 2, DataWeave, API Manager, Connectors, etc.). For large pages, returns a TOC; use the optional section parameter to fetch a specific section. |
Usage
There are three ways to use this MCP server. Pick the one that fits your situation:
| Option | Best for | Requires | |--------|----------|----------| | A. npx | Individual use, zero setup | Node.js 18+ | | B. Shared HTTP server | Team sharing on the same network | Someone runs the server | | C. Persistent service | Always-on server that survives reboots | OS-level service config |
Option A — npx (quickest)
Cursor spawns the server locally as a subprocess. Nothing to install or run manually.
Add this to your .cursor/mcp.json:
{
"mcpServers": {
"mulesoft-docs": {
"command": "npx",
"args": ["-y", "mulesoft-doc-mcp"]
}
}
}Restart Cursor and you're done.
Option B — Shared HTTP server
Run a single instance that the whole team connects to by URL. Useful when you want one server serving multiple colleagues.
1. Clone and build:
git clone [email protected]:MuleSoft-Global-Proserv-Consulting-emu/mulesoft-doc-mcp.git
cd mulesoft-doc-mcp
npm install
npm run build2. Start in HTTP mode:
npm run start:httpThe server listens on http://localhost:3000/mcp (override with MCP_PORT env var).
3. Everyone adds this to their .cursor/mcp.json:
{
"mcpServers": {
"mulesoft-docs": {
"url": "http://<server-host>:3000/mcp"
}
}
}Option C — Persistent service
Same as Option B, but the server auto-starts on boot and restarts on crash.
First, clone and build the project (see Option B step 1).
A template plist is included in the repo:
cp com.mulesoft.doc-mcp.plist ~/Library/LaunchAgents/Edit ~/Library/LaunchAgents/com.mulesoft.doc-mcp.plist and replace /PATH/TO/ with your actual paths, then load it:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.mulesoft.doc-mcp.plist| Action | Command |
|--------|---------|
| Stop | launchctl bootout gui/$(id -u)/com.mulesoft.doc-mcp |
| Restart | bootout then bootstrap again |
| Logs | ~/Library/Logs/mulesoft-doc-mcp.log |
Create ~/.config/systemd/user/mulesoft-doc-mcp.service:
[Unit]
Description=MuleSoft Doc MCP Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/PATH/TO/mulesoft-doc-mcp
ExecStart=/usr/bin/node /PATH/TO/mulesoft-doc-mcp/dist/index.js --http
Environment=MCP_PORT=3000
Restart=always
RestartSec=5
[Install]
WantedBy=default.targetThen enable and start:
systemctl --user daemon-reload
systemctl --user enable --now mulesoft-doc-mcp| Action | Command |
|--------|---------|
| Stop | systemctl --user stop mulesoft-doc-mcp |
| Restart | systemctl --user restart mulesoft-doc-mcp |
| Logs | journalctl --user -u mulesoft-doc-mcp -f |
Open PowerShell as Administrator and run:
$action = New-ScheduledTaskAction `
-Execute "node.exe" `
-Argument "C:\PATH\TO\mulesoft-doc-mcp\dist\index.js --http" `
-WorkingDirectory "C:\PATH\TO\mulesoft-doc-mcp"
$trigger = New-ScheduledTaskTrigger -AtLogOn
$settings = New-ScheduledTaskSettingsSet `
-AllowStartIfOnBatteries `
-DontStopIfGoingOnBatteries `
-RestartCount 3 `
-RestartInterval (New-TimeSpan -Seconds 10)
Register-ScheduledTask `
-TaskName "MuleSoft Doc MCP" `
-Action $action `
-Trigger $trigger `
-Settings $settings `
-Description "MuleSoft Doc MCP Server"| Action | Command |
|--------|---------|
| Stop | Stop-ScheduledTask -TaskName "MuleSoft Doc MCP" |
| Start | Start-ScheduledTask -TaskName "MuleSoft Doc MCP" |
| Remove | Unregister-ScheduledTask -TaskName "MuleSoft Doc MCP" |
