modbus-mcp
Modbus MCP サーバー
Modbus データを標準化およびコンテキスト化し、AI エージェントと産業用 IoT システムのシームレスな統合を可能にする MCP サーバー。
特徴
Modbus ツール:
読み取り/書き込み保持レジスタ (
read_register、write_register)。読み取り/書き込みコイル (
read_coils、write_coil)。入力レジスタを読み取ります (
read_input_registers)。複数の保持レジスタを読み取ります (
read_multiple_holding_registers)。
プロンプト: カスタマイズ可能なプロンプト (
analyze_register) を使用して Modbus レジスタ値を分析します。柔軟な接続: 環境変数を介して構成された TCP、UDP、またはシリアル経由の Modbus をサポートします。
Related MCP server: Industrial MCP
要件
Python : 3.10
依存関係と仮想環境の管理のためのuv 。
インストール
uvをインストールします:curl -LsSf https://astral.sh/uv/install.sh | shリポジトリのクローンを作成します:
git clone https://github.com/kukapay/modbus-mcp.git cd modbus-mcp依存関係をインストール:
uv sync
構成
サーバーは、環境変数で指定されたパラメータを使用してModbusデバイスに接続します。これらの変数は、 .envファイルまたはシェル環境で設定してください。
環境変数
変数 | 説明 | デフォルト | 必須 |
| 接続タイプ: |
| はい |
| TCP/UDPのホストアドレス |
| TCP/UDPの場合 |
| TCP/UDPのポート |
| TCP/UDPの場合 |
| シリアルポート(例: |
| シリアル用 |
| シリアルボーレート |
| シリアル用 |
| シリアルパリティ: |
| シリアル用 |
| シリアルストップビット |
| シリアル用 |
| シリアルバイトサイズ |
| シリアル用 |
| シリアルタイムアウト(秒) |
| シリアル用 |
.envファイルの例
TCPの場合:
MODBUS_TYPE=tcp
MODBUS_HOST=192.168.1.100
MODBUS_PORT=502シリアルの場合:
MODBUS_TYPE=serial
MODBUS_SERIAL_PORT=/dev/ttyUSB0
MODBUS_BAUDRATE=9600
MODBUS_PARITY=N
MODBUS_STOPBITS=1
MODBUS_BYTESIZE=8
MODBUS_TIMEOUT=1使用法
Claude Desktop へのインストール
設定ファイル:
{
"mcpServers": {
"Modbus MCP Server": {
"command": "uv",
"args": [ "--directory", "/path/to/modbus-mcp", "run", "modbus-mcp" ],
"env": { "MODBUS_TYPE": "tcp", "MODBUS_HOST": "127.0.0.1", "MODBUS_PORT": 502 },
}
}
}ツールの使用
注:自然言語サポートは、クライアントがプロンプトを解析し、ツールにマッピングする能力に依存します。MCPインスペクターでは構造化されたJSONが必要ですが、以下の例は会話型入力がどのように翻訳されるかを示しています。
保有台帳の読み取り:
プロンプト:
Please read the value of Modbus holding register 0.MCP インスペクター JSON :
{ "tool": "read_register", "parameters": {"address": 0} }予想される出力:
Value: <register_value>
保留レジスタへの書き込み:
プロンプト:
Set Modbus holding register 10 to the value 100.MCP インスペクター JSON :
{ "tool": "write_register", "parameters": {"address": 10, "value": 100} }期待される出力:
Successfully wrote 100 to register 10
読み取りコイル:
プロンプト:
Check the status of the first 5 Modbus coils starting at address 0.MCP インスペクター JSON :
{ "tool": "read_coils", "parameters": {"address": 0, "count": 5} }予想される出力:
Coils 0 to 4: [False, False, False, False, False]
コイルに書き込む:
プロンプト:
Turn on Modbus coil 5.MCP インスペクター JSON :
{ "tool": "write_coil", "parameters": {"address": 5, "value": true} }期待される出力:
Successfully wrote True to coil 5
入力レジスタの読み取り:
プロンプト:
Read the values of 3 Modbus input registers starting from address 2.MCP インスペクター JSON :
{ "tool": "read_input_registers", "parameters": {"address": 2, "count": 3} }予想される出力:
Input Registers 2 to 4: [<value1>, <value2>, <value3>]
複数の保持レジスタの読み取り:
プロンプト:
Get the values of Modbus holding registers 0 through 2.MCP インスペクター JSON :
{ "tool": "read_multiple_holding_registers", "parameters": {"address": 0, "count": 3} }予想される出力:
Holding Registers 0 to 2: [<value1>, <value2>, <value3>]
ライセンス
このプロジェクトはMITライセンスの下でライセンスされています。詳細はライセンスをご覧ください。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server giving access to Grafana dashboards, data and more.
Cloud-hosted MCP server for secure AI access to enterprise data sources via CData Connect AI.
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for Modbus TCP devices that enables AI agents to read/write PLC registers by name using YAML device profiles, with a built-in simulator.2MIT
- AlicenseNot gradedqualityDmaintenanceAn open-source MCP server that bridges AI models with industrial equipment, supporting multiple protocols like Modbus, OPC UA, and MQTT for reading data and controlling machines.2Apache 2.0
- AlicenseAqualityBmaintenanceMCP server that unifies real-time telemetry from industrial systems into a single queryable interface, enabling production visibility, anomaly detection, and operational insights.5190MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Modbus RTU/TCP instrument control, enabling query and write operations on Modbus registers through a standardized interface, supporting both standalone use and integration with lab-executor.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kukapay/modbus-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server