Sign inSign up

pepr90210/node-red-mcp-server

By pepr90210

•Updated over 1 year ago

Node-RED MCP server for Claude Desktop. Control flows, nodes & inject triggers via AI chat.

Image
Developer tools
0

691

pepr90210/node-red-mcp-server repository overview

⁠Node-RED MCP Server

A Model Context Protocol (MCP) server that enables AI language models to interact with Node-RED programmatically. This Docker image provides a bridge between Claude Desktop and your Node-RED instance.

⁠Quick Start

docker run --rm -i \
  -e NODE_RED_URL=http://your-node-red-host:1880 \
  -e NODE_RED_TOKEN=your-node-red-token \
  pepr90210/node-red-mcp-server:latest

⁠What is MCP?

The Model Context Protocol (MCP) is a standardized protocol that allows AI language models to securely access external data sources and tools. This server specifically enables communication between Claude Desktop and Node-RED.

⁠Features

  • Flow Management: Create, read, update, and delete Node-RED flows
  • Node Control: Manage individual nodes within flows
  • Inject Node Triggering: Programmatically trigger inject nodes
  • Settings Access: Read and modify Node-RED runtime settings
  • Search Capabilities: Find nodes and flows by various criteria

⁠Environment Variables

VariableDescriptionDefault
NODE_RED_URLURL of your Node-RED instancehttp://localhost:1880
NODE_RED_TOKENAuthentication token for Node-RED API(empty)

⁠Configuration for Claude Desktop

Add this configuration to your ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "node-red": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--name",
        "node-red-mcp-server",
        "-e",
        "NODE_RED_URL=http://your-node-red-host:1880",
        "-e",
        "NODE_RED_TOKEN=your-node-red-token",
        "pepr90210/node-red-mcp-server:latest"
      ]
    }
  }
}

⁠Node-RED Authentication

⁠Getting Your Token
  1. Enable Node-RED authentication in your settings.js:
adminAuth: {
    type: "credentials",
    users: [{
        username: "admin",
        password: "$2b$08$...", // bcrypt hash
        permissions: "*"
    }]
}
  1. Generate an access token:
curl -X POST http://your-node-red-host:1880/auth/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"node-red-admin","grant_type":"password","scope":"*","username":"admin","password":"your-password"}'
⁠Without Authentication

If your Node-RED instance doesn't require authentication, simply omit the NODE_RED_TOKEN environment variable.

⁠Usage Examples

Once configured with Claude Desktop, you can use natural language to interact with Node-RED:

  • "Show me all my Node-RED flows"
  • "Create a new flow with an inject node and debug node"
  • "Trigger the inject node in my temperature monitoring flow"
  • "What are the current Node-RED settings?"

⁠Docker Compose Example

version: '3.8'

services:
  node-red-mcp-server:
    image: pepr90210/node-red-mcp-server:latest
    stdin_open: true
    environment:
      - NODE_RED_URL=http://host.docker.internal:1880
      - NODE_RED_TOKEN=your-token-here
    extra_hosts:
      - "host.docker.internal:host-gateway"

⁠Architecture

This server uses:

  • Node.js 18 Alpine - Lightweight base image
  • MCP SDK - Official Model Context Protocol implementation
  • Axios - HTTP client for Node-RED API communication
  • stdio transport - Communication with Claude Desktop via stdin/stdout

⁠Troubleshooting

⁠Connection Issues
  1. Verify Node-RED URL: Ensure the URL is accessible from the Docker container
  2. Check Token: Verify your Node-RED token is valid and has proper permissions
  3. Network Access: Make sure Docker can reach your Node-RED instance
⁠Common Problems
  • Empty responses: Check if Node-RED authentication is properly configured
  • Permission errors: Ensure your token has the required permissions
  • Connection timeouts: Verify network connectivity between container and Node-RED

⁠Security Considerations

  • Store tokens securely - avoid hardcoding in configuration files
  • Use environment variables or Docker secrets for sensitive data
  • Ensure Node-RED instance is properly secured
  • Consider using HTTPS for Node-RED in production

⁠Source Code

This image is built from the original node-red-mcp-server⁠ repository by Evgeniy Karavaev.

⁠GitHub Repository

⁠License

MIT License - see the source repository for full license details.

⁠Tags

  • latest - Latest stable version
  • 1.0.1 - Specific version tags

⁠Support

For issues related to:

Tag summary

Content type

Image

Digest

sha256:9b225a015…

Size

50.4 MB

Last updated

over 1 year ago

docker pull pepr90210/node-red-mcp-server