Skip to main content

Plug Your Broker Into Any MCP Tool

MCP (Model Context Protocol) is an open standard that defines how applications communicate with external tool servers. MCP Connectors let your Coreflux broker connect to any MCP-compatible server — file systems, messaging platforms, cloud storage, spreadsheets, and more — and call their tools directly from LoT Actions.
This page is the MCP client connector (DEFINE CONNECTOR … WITH TYPE MCP and CALL MCP from Actions). The broker connects out to an external MCP server.To expose this broker as an MCP server for Cursor or Claude Desktop, use the MCP Server (Mcp.Enabled). TYPE MCP_SERVER was removed. The hosted documentation MCP searches docs.coreflux.org and does not control a broker.
A DEFINE AGENT does not receive this connector’s tools, and execute_routes cannot reach them. Call MCP tools from an Action with CALL MCP. To give an agent one tool, wrap the call in a callable action and grant that action with ADD TOOL "execute_actions". See Agents and MCP Tools.
Like adding power tools to a workbench. Each MCP Connector plugs a new tool into your broker — a Slack server for sending messages, a filesystem server for reading logs, a Google Drive server for cloud backups. Once connected, any LoT Action can pick up and use that tool.

Integration Architecture

MCP Connectors allow the Coreflux Broker to connect to external MCP servers as a client. This enables LoT Actions to call tools provided by any MCP server—file systems, cloud services, communication platforms, and more.

How It Works

  1. Define MCP Connectors - Each connector connects to an external MCP server
  2. Discover Tools - The broker discovers available tools from each server, once after it connects
  3. Call from Actions - Use CALL MCP in LoT Actions to invoke any tool
  4. Reusable Connections - Multiple actions can share the same MCP connector
MCP as a Connection Type. Just like database connectors or REST API connectors, MCP connectors provide a reusable connection that any action can leverage. Define the connector once, use it everywhere.

Basic Syntax

The MCP connector type connects your Coreflux broker to an external MCP server, making that server’s tools callable from LoT Actions. Each connector manages one MCP server connection, and you can define multiple connectors to connect to different servers simultaneously.
Once connected, any LoT Action can use CALL MCP to invoke the server’s tools — send Slack messages, read and write files, generate spreadsheet reports, or interact with any other MCP-compatible service.

MCP Configuration

MCP_CONFIG Parameters

A connector reaches its server in one of two ways. Set SERVER_COMMAND and SERVER_ARGUMENTS to start a local server process (stdio). Or set SERVER_URL to connect to a remote server over HTTP. When SERVER_URL is set, SERVER_COMMAND and SERVER_ARGUMENTS are not needed. Without it, -addConnector requires both.
string
MCP server command to execute (e.g., npx, python, node). Required unless SERVER_URL is set.
string
Comma-separated server arguments (e.g., -y, @modelcontextprotocol/server-filesystem). Required unless SERVER_URL is set.
string
URL of a remote MCP server (e.g., https://mcp.example.com/mcp). Replaces SERVER_COMMAND and SERVER_ARGUMENTS. The broker sends no authentication headers to this URL.
string
WITH SERVER_ENV "NAME" <value> sets one environment variable on the server process. Repeat the line for each variable. The value can be a string, a number, true/false, GET ENV "...", or GET SECRET "...", resolved when the connector starts. Applies only to a server started with SERVER_COMMAND.
string
MCP client identifier. Default: CorefluxBroker.

Configuration Examples

Enable LoT Actions to perform file operations:

MCP Server Examples

The MCP ecosystem includes servers for various platforms and services. These examples show how to connect popular MCP servers to your Coreflux broker for IoT integration.
Node.js-based MCP servers can be run directly using npx. These are the most common and include official Anthropic servers.Example: Slack Alerts for IoT Events

Calling MCP Tools

Once an MCP connector is defined, you can call its tools from within LoT Actions using the CALL MCP syntax. This enables AI-powered automation triggered by MQTT events.

Basic Syntax

The standard syntax to invoke an MCP tool from an Action:

Return Value

RETURN AS always receives a JSON string, also when the call fails. Check success before you use result:
A failed call has success: false and an error such as Tool 'X' not found. Available tools: ..., MCP client is not connected, or MCP route 'X' not found or not an MCP route.

Complete Example

This Action monitors a temperature sensor and uses an MCP tool to send a Slack message when the temperature exceeds a threshold:

Syntax Variations

Some tools don’t require arguments:
Pass multiple named parameters:
Build dynamic values using expressions:

Who Can Call Tools

CALL MCP has no permission check of its own. Any action that runs CALL MCP can call any tool on any configured MCP connector, whichever role deployed the action. So:
  • Only let trusted administrators add MCP connectors. Every tool those servers expose becomes callable from LoT.
  • Restrict which roles can add or change actions. A role that can deploy actions can reach every tool on every MCP connector.
  • To give an agent one tool, grant it one callable action with execute_actions. See Agents and MCP Tools.

Agents and MCP Tools

A DEFINE AGENT cannot call an MCP tool directly. ADD TOOL "execute_routes" does not help: an MCP connector runs nothing when one of its events is fired. Use a callable action as the bridge:
  1. A callable action takes the tool arguments as INPUT, runs CALL MCP, and publishes the reply to a topic.
  2. The agent runs that action with execute_actions, passing the inputs as a JSON object.
  3. The agent reads the reply topic with read_mqtt.
Claude is a TYPE LLM connector. Create shift-reporter with -addUser before you add the agent. execute_actions tells the agent only that the action ran, with the action name and a trace id. It does not return the action’s output, so the reply goes through a topic. Grant one action per tool you want the agent to have. MCP_ROUTES is legacy. A TYPE LLM connector ignores it and logs a warning to use ADD TOOL, and -addAgent refuses it on DEFINE AGENT. Grant tools with ADD TOOL on the agent instead. See Coming from TYPE AGENT.

Tool Discovery

When an MCP connector connects to a server, Coreflux discovers the server’s tools about 10 seconds later and publishes them to MQTT system topics. Discovery runs once, after the connector connects. The broker ignores the server’s tools/list_changed notifications, so a tool the server adds or changes later shows up only after the connector reconnects.

System Topics

All three are retained. The broker republishes the summary and tool topics with its periodic status updates.

Tools Summary Payload

Subscribe to the summary topic to see all available tools:
fast_tools counts tools rated FAST. reliable_tools counts tools rated EXCELLENT.

Individual Tool Payload

Each tool publishes its description, parameters, and call statistics:
Each parameter carries only type and description. An array parameter also carries items, which defaults to { "type": "string" }. The payload does not say which parameters are required. Read the tool’s description or the server’s own documentation for that. A tool that has never been called shows 0 counts, UNKNOWN ratings, and never for both dates. The first publish after discovery also carries usage_example (a ready CALL MCP block) and trigger_example (TRIGGER "MCPSlack" TO PAYLOAD FOR "send-message"). The periodic republish leaves them out.

Capability Payload

…/Tools/{tool}/Capability is published after every call to that tool:

Subscribing to Tool Discovery

Use MQTT Explorer or any MQTT client to discover available tools:
Tool discovery topics are retained messages, so the information is immediately available when you subscribe—you don’t need to wait for the next update.

Use Cases

Connect to Slack, email, or other messaging MCP servers to send alerts directly from LoT Actions. When a sensor crosses a threshold, the Action calls the messaging tool — no external middleware needed.
Use filesystem MCP servers to read configuration files, write sensor logs, or manage data exports. LoT Actions can read a config file at startup or append readings to a log file on every event.
Connect to Google Drive, Excel, or other cloud MCP servers to back up IoT data, generate reports from sensor readings, or sync configurations with cloud storage.
Use Windows Control or custom MCP servers to automate HMI/SCADA interfaces, trigger external scripts, or interact with desktop applications as part of your IoT workflow.

Best Practices

  • CALL MCP has no permission check. Restrict which roles can add or change actions, because any action can call any tool on a configured MCP connector. See Who Can Call Tools
  • SERVER_COMMAND starts any program on the broker host. Only let trusted administrators add MCP connectors
  • Pass server credentials with SERVER_ENV and GET SECRET, never as plain text in the connector
  • The broker sends no credentials to a SERVER_URL. Do not expose a remote MCP server that needs no key outside a trusted network
  • Monitor MCP tool calls through logging
  • Implement rate limiting for MCP requests
  • Configure appropriate timeouts for MCP operations
  • Limit concurrent MCP connections if needed
  • Monitor memory usage of MCP server processes
  • Implement graceful fallbacks when the MCP server is unavailable
  • Log MCP communication errors for debugging
  • Set up alerts for repeated failures

Troubleshooting

  • Verify SERVER_COMMAND path is correct
  • Check SERVER_ARGUMENTS syntax (comma-separated)
  • Ensure required packages are installed (npx, node, python)
  • Check system PATH includes required executables
  • Verify MCP server is running and responsive
  • Check network/firewall settings
  • Increase timeout values if server startup is slow
  • Check server logs for errors
  • Verify the requested tool is available
  • Check permissions for the operation
  • Review server logs for detailed error messages
  • Ensure broker has required access rights

Next Steps

REST API Connectors

Connect to external REST APIs.

Python Integration

Add custom AI/ML logic with Python.
Last modified on October 25, 2026