Comprehensive Node-RED integration for Model Context Protocol (MCP) servers, enabling AI agents to manage MCP server lifecycle, connect as clients, and invoke tools directly from Node-RED flows with multi-protocol support.
A comprehensive skill for integrating Model Context Protocol (MCP) servers with Node-RED, providing standardized AI agent tool interfaces, server lifecycle management, and real-time communication capabilities.
This skill enables you to work with the `node-red-contrib-mcp-server` package, which provides three core Node-RED nodes for complete MCP server integration:
1. **MCP Server Node**: Manage MCP server processes (start, stop, monitor)
2. **MCP Client Node**: Connect to and communicate with MCP servers
3. **MCP Tool Node**: Invoke specific MCP tools directly from flows
The package supports HTTP, Server-Sent Events (SSE), and WebSocket connections, with built-in health monitoring, automatic restarts, and visual MCP server creation entirely within Node-RED.
Guide the user through installation:
```bash
cd ~/.node-red
npm install node-red-contrib-mcp-server
```
For local development:
```bash
npm link
cd ~/.node-red
npm link node-red-contrib-mcp-server
```
The nodes will appear in the Node-RED palette after restart.
When helping users configure MCP Server nodes:
Send messages with these topics to control the server:
```javascript
// Start server
msg.topic = "start";
// Stop server
msg.topic = "stop";
// Restart server
msg.topic = "restart";
// Get status
msg.topic = "status";
```
Monitor server events:
```javascript
// Connect to server
msg.topic = "connect";
// Disconnect
msg.topic = "disconnect";
// Send MCP request
msg.topic = "request";
msg.payload = {
method: "add_todo_tool",
params: {
description: "Task description",
project: "ProjectName"
}
};
// Get connection status
msg.topic = "status";
```
- "Result Only": Extract result from MCP response
- "Full Response": Complete MCP JSON-RPC response
- "Custom": Preserve original message, add response
Parameters are resolved in this order (highest to lowest priority):
1. Message-specific properties (`msg.description`, `msg.project`, etc.)
2. `msg.payload.params` object
3. `msg.payload` (if object without method property)
4. Default parameters from node configuration
```javascript
// Method 1: Direct properties
msg.description = "New task from Node-RED";
msg.project = "MyProject";
msg.priority = "High";
// Method 2: Params object
msg.payload = {
params: {
description: "New task",
project: "MyProject"
}
};
// Method 3: Direct payload (merged with defaults)
msg.payload = {
description: "New task",
project: "MyProject"
};
```
The package includes two comprehensive example flows:
Location: `examples/external-mcp-server-example.json`
Shows:
Import steps:
1. Node-RED Menu (☰) → Import
2. Select file: `external-mcp-server-example.json`
3. Deploy and watch debug output
Location: `examples/flow-based-mcp-server-example.json`
Shows:
The package includes built-in Omnispindle MCP server support with preset configurations.
1. Click "Load Omnispindle Preset" in node configuration
2. Automatically configures for local Omnispindle server
3. Sets appropriate connection types and parameters
```javascript
// Connect server output to function node
if (msg.topic === "stdout" && msg.payload.includes("error")) {
return {topic: "alert", payload: "Server error detected"};
}
if (msg.topic === "exit" && msg.payload.code !== 0) {
return {topic: "restart", payload: {}};
}
```
```javascript
// Get available tools
msg.topic = "request";
msg.payload = {
method: "tools/list",
params: {}
};
// Process response to populate UI or routing
```
```javascript
// Handle connection errors with backup server
if (msg.topic === "error") {
msg.topic = "connect";
msg.payload = {serverUrl: "http://backup:8000"};
return msg;
}
```
Check these common issues:
1. Verify server path exists and is executable
2. Confirm Python/Node.js environment is correct
3. Check if port is already in use
4. Review server arguments syntax
5. Check Node-RED debug logs
1. Verify server is running (`curl http://localhost:8000/health`)
2. Check firewall settings
3. Confirm correct URL format and port
4. Test connection type (try HTTP first, then SSE/WebSocket)
1. Verify server supports the requested tool (use `tools/list`)
2. Validate parameter JSON syntax
3. Check server logs for detailed errors
4. Verify required parameters are provided
1. Adjust health check intervals in server node
2. Configure appropriate timeouts
3. Use connection pooling for high-volume scenarios
4. Monitor server resource usage (CPU, memory)
The package exposes HTTP endpoints:
1. **Always enable health checks** for production MCP servers
2. **Use auto-restart** for critical services
3. **Monitor stdout/stderr** outputs for debugging
4. **Set appropriate timeouts** based on tool complexity
5. **Use SSE or WebSocket** for real-time applications
6. **Configure environment variables** in server node, not in command args
7. **Test with HTTP first** before switching to streaming protocols
8. **Use default parameters** in Tool nodes for common values
9. **Handle connection errors** with retry logic
10. **Log all MCP responses** during development
Use this skill when:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/node-red-mcp-server-integration/raw