mcpx-mcp-server is an MCP server that allows generative AI to access Mitsubishi PLC devices in real time.
For PLC communication, it uses the NativeAOT build of the MC Protocol library McpX.
- Real-time reading of PLC devices
- Writing to PLC devices
- Operation via natural language instructions from generative AI
- Operation by name
- By predefining names, you can operate devices without worrying about addresses
- Start Conveyor A.
- Stop Conveyor A.
- What is the status of Gate A?
- Open Gate A and then start Conveyor A.
- What is the current production count?
- Set the target production count to 9999.
The following applications must be installed:
Set the PLC connection information in app/src/.env.
PLC_IP=192.168.12.88 # PLC IP address
PLC_PORT=10000 # PLC port number
IS_ASCII=false # PLC communication mode (true: ASCII, false: Binary)
IS_UDP=false # PLC communication protocol (true: UDP, false: TCP)Note: When changing the PLC connection information, you need to restart the MCP server.
By predefining device definitions (app/src/address-comment.json), you can operate devices with named access and apply access rules.
| Field | Description |
|---|---|
| address | Specifies the device address. |
| name | Specifies the device name. |
| comment | Specifies the data type or rules. |
Note: If you modify the device definitions, you must restart the MCP server.
[
{ "address": "M0", "name": "Conveyor A Start Command", "comment": "true = run, false = stop" },
{ "address": "M1", "name": "Conveyor A Status", "comment": "true = running, false = stopped" },
{ "address": "M2", "name": "Gate A Open Command", "comment": "true = open, false = closed" },
{ "address": "M3", "name": "Gate A Status", "comment": "true = open, false = closed" },
{ "address": "D0", "name": "Production Count", "comment": "short type" }
]docker compose up -ddocker compose downConfigure the MCP server according to the generative AI you are using.
/Users/{username}/.gemini/settings.json
/home/{username}/.gemini/settings.json
C:\Users\{username}\.gemini\settings.json
Add the MCP server information to settings.json:
{
"security": {
"auth": {
"selectedType": "oauth-personal"
}
},
"mcpServers": {
"mcpx": {
"httpUrl": "http://localhost:3000/mcp"
}
}
}