mcp-snap7
Provides tools for interacting with Siemens PLCs, enabling reading/writing data blocks, memory, timers, counters, and controlling PLC states.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-snap7 read DB1 from PLC 192.168.0.1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-snap7
MCP server for python-snap7, enabling MCP clients to interact with Siemens PLCs
Install
pip install mcp-snap7Related MCP server: OpenTIA-MCP
Requirements
python-snap7 requires the libsnap7 library to be installed on your system. See python-snap7 documentation for installation instructions.
Usage
As MCP Server
Configure your MCP client to use mcp-snap7 as a stdio server:
{
"mcpServers": {
"mcp-snap7": {
"command": "mcp-snap7"
}
}
}Available Tools
connect_plc- Connect to a Siemens PLCdisconnect_plc- Disconnect from PLCget_connected- Check connection statusdb_read/db_write- Read/write data blocksmb_read/mb_write- Read/write memory bytestm_read/tm_write- Read/write timersct_read/ct_write- Read/write counterseb_read/eb_write- Read/write edge inputsab_read/ab_write- Read/write absolute bytesget_cpu_info- Get CPU informationget_cpu_state- Get CPU stateget_protection- Get PLC protection levelplc_cold_start- Trigger cold startplc_hot_start- Trigger hot startplc_stop- Stop PLCget_error_text- Get error description
Development
git clone https://github.com/daedalus/mcp-snap7.git
cd mcp-snap7
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/Available Tools
22 toolsab_readC
Read absolute bytes from PLC.
Inputs: start (required), size (required). Returns: result
ab_writeC
Write absolute bytes to PLC.
Inputs: start (required), data (required). Returns: result
connect_plcC
Connect to a Siemens PLC.
Inputs: address (required), rack, slot, tcp_port. Returns: result
ct_readB
Read counters from PLC.
Inputs: start (required), size (required). Returns: result
ct_writeC
Write counters to PLC.
Inputs: start (required), data (required). Returns: result
db_readC
Read data block from PLC.
Inputs: db_number (required), start (required), size (required). Returns: result
db_writeC
Write data block to PLC.
Inputs: db_number (required), start (required), data (required). Returns: result
disconnect_plcB
Disconnect from the connected PLC.
Returns: Disconnection status message
Inputs: no named parameters. Returns: result
eb_readC
Read edge inputs from PLC.
Inputs: start (required), size (required). Returns: result
eb_writeB
Write edge inputs to PLC.
Inputs: start (required), data (required). Returns: result
get_connectedA
Check if PLC is connected.
Returns: True if connected, False otherwise
Inputs: no named parameters. Returns: result
get_cpu_infoA
Get CPU information from PLC.
Returns: Dictionary containing CPU information
Inputs: no named parameters. Returns: object
get_cpu_stateA
Get CPU state from PLC.
Returns: CPU state string
Inputs: no named parameters. Returns: result
get_error_textA
Get error description from error code.
Inputs: error_code (required). Returns: result
get_protectionB
Get PLC protection level.
Returns: Dictionary containing protection level info
Inputs: no named parameters. Returns: object
mb_readC
Read memory bytes from PLC.
Inputs: start (required), size (required). Returns: result
mb_writeB
Write memory bytes to PLC.
Inputs: start (required), data (required). Returns: result
plc_cold_startB
Trigger PLC cold start.
Returns: Status message
Inputs: no named parameters. Returns: result
plc_hot_startB
Trigger PLC hot start.
Returns: Status message
Inputs: no named parameters. Returns: result
plc_stopB
Stop PLC.
Returns: Status message
Inputs: no named parameters. Returns: result
tm_readC
Read timers from PLC.
Inputs: start (required), size (required). Returns: result
tm_writeB
Write timers to PLC.
Inputs: start (required), data (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a distinct purpose: connecting/disconnecting, reading/writing specific memory areas, retrieving CPU information, and controlling PLC state. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., connect_plc, db_read, plc_stop). The naming is predictable and easy to parse.
22 tools is on the higher side but appropriate for the complex domain of PLC interaction, covering multiple memory types and control operations. It feels well-scoped without being bloated.
The tool set provides comprehensive read/write access to common PLC memory areas and basic control functions. Minor gaps like safety operations or additional diagnostics exist, but core workflows are covered.
Maintenance
Related MCP Connectors
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceMCP server that connects AI assistants to Siemens TIA Portal via the Openness API. AI-assisted PLC programming, project management, hardware configuration, cross-reference analysis, and deployment. 19 tools, 230 actions.60-
- FlicenseNot gradedqualityBmaintenanceAn MCP server that lets AI agents interact with Siemens TIA Portal via its Openness API.-
- AlicenseBqualityCmaintenanceUniversal MCP server for industrial PLC communication, enabling AI agents to read sensors, alarms, status, setpoints, and write setpoints via adapters for Modbus, S7, or custom PLCs.6MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI agents to Siemens industrial PLCs for automatic monitoring and control of industrial equipment.28MIT