- Home
- MCP servers
- ThinkPLC-MCP Server
ThinkPLC-MCP Server
- typescript
4
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
ThinkPLC-MCP exposes a set of MCP tools that bridge your AI assistants with a Siemens PLC via the JSON-RPC 2.0 API. You can authenticate, read and write PLC tags, manage operating modes, read time and alarms, and browse API structures, all through MCP-compatible clients. This makes it easy to automate PLC tasks and build intelligent automation workflows.
How to use
You connect an MCP client to ThinkPLC-MCP using either a remote HTTP endpoint or a local (stdio) runtime. The server provides a rich set of tools that you can invoke to perform common PLC operations, such as reading and writing tags, querying system information, and handling alarms. Start by configuring a client to target the exposed HTTP endpoint or by launching the local service and pointing your client to the local runtime. Once connected, log in, browse available methods, and begin issuing reads, writes, and control commands against the PLC program.
Typical usage patterns include: 1) authenticate once and reuse the session for subsequent actions; 2) verify connectivity with a lightweight ping; 3) read tag values to make decisions in your automation flow; 4) write to tags to effect changes in the PLC state; 5) monitor alarms and diagnostic buffers to respond to faults. Use Api-Browse to discover available methods and Api-Version to confirm you’re running a compatible API version. If you need to adjust the PLC operating mode, use Plc-ReadOperatingMode to check the current mode and Plc-RequestChangeOperatingMode to request a switch.
How to install
Prerequisites: ensure you have Node.js version 18 or later and npm installed. You will need access to a running Siemens PLC API Webserver.
-
Clone or download the ThinkPLC-MCP project to a working directory.
-
Open a terminal in the project folder.
-
Install dependencies.
npm install
-
Create or edit the configuration file in ES Module format as shown in the example.
-
Start the server.
node start
Additional sections
Configuration you will commonly use is provided in a JavaScript module exporting a config object. The essential field is URL, which points to your PLC API Webserver, and you may optionally supply user credentials.
Example configuration (ES Module) you will place in a config.js file:
export const config = {
URL: "https://<PLC-IP-Address>/api/jsonrpc", // required
userName: "your-username", // optional
pwr: "your-password", // optional
};
Connecting from Claude Desktop involves providing a client configuration that points to the local MCP server. Create or update claude_desktop_config.json with a ThinkPLC-MCP entry to route requests to the MCP endpoint.
{
"mcpServers": {
"ThinkPLC-MCP": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:5000/mcp"]
}
}
}
Available tools
login
Authenticate a user and establish a session, enabling subsequent MCP tool calls.
logout
Terminate the current session and invalidate the authentication token.
ChangePassword-user
Change the password for the currently authenticated user.
ping
Check connectivity to the PLC API and ensure the service is reachable.
Api-GetPermissions
Retrieve the permissions of the logged-in user to determine allowed operations.
Api-Version
Query the API version supported by the MCP server.
Api-Browse
List available API methods and their capabilities.
Api-GetQuantityStructures
Retrieve structure information about PLC data containers.
Api-GetPasswordPolicy
Fetch the active password security policies.
PlcProgram-Browse
Browse PLC tags and their metadata.
PlcProgram-Read
Read a single PLC variable or tag.
PlcProgram-Write-Boolean
Write a Boolean tag on the PLC.
PlcProgram-Write-Number
Write a numeric tag on the PLC.
PlcProgram-Write-String
Write a string tag on the PLC.
PlcReadOperatingMode
Read the current CPU operating mode.
PlcRequestChangeOperatingMode
Request a change to the CPU operating mode.
Plc-ReadSystemTime
Read the CPU system time.
Plc-SetSystemTime
Set the CPU system time.
Project-ReadLanguages
Read available project languages.
Alarms-Browse
Browse active alarms.
Alarms-Acknowledge
Acknowledge alarms to mark them as handled.
DiagnosticBuffer-Browse
Browse entries in the diagnostic buffer.