Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Modbus Mcp

    An MCP server that standardizes and contextualizes industrial Modbus data.

    18 stars
    Python
    Updated Oct 18, 2025

    Table of Contents

    • Features
    • Requirements
    • Installation
    • Configuration
    • Environment Variables
    • Example .env File
    • Usage
    • Installing for Claude Desktop
    • Using Tools
    • License

    Table of Contents

    • Features
    • Requirements
    • Installation
    • Configuration
    • Environment Variables
    • Example .env File
    • Usage
    • Installing for Claude Desktop
    • Using Tools
    • License

    Documentation

    Modbus MCP Server

    An MCP server that standardizes and contextualizes Modbus data, enabling seamless integration of AI agents with industrial IoT systems.

    GitHub License

    Python Version

    Status

    Features

    • Modbus Tools:
    • Read/write holding registers (read_register, write_register).
    • Read/write coils (read_coils, write_coil).
    • Read input registers (read_input_registers).
    • Read multiple holding registers (read_multiple_holding_registers).
    • Prompt: Analyze Modbus register values with a customizable prompt (analyze_register).
    • Flexible Connections: Supports Modbus over TCP, UDP, or serial, configured via environment variables.

    Requirements

    • Python: 3.10
    • uv for dependency and virtual environment management.

    Installation

    1. **Install uv**:

    bash
    curl -LsSf https://astral.sh/uv/install.sh | sh

    2. Clone the Repository:

    bash
    git clone https://github.com/kukapay/modbus-mcp.git
       cd modbus-mcp

    3. Install Dependencies:

    bash
    uv sync

    Configuration

    The server connects to a Modbus device using parameters specified via environment variables. Set these variables in a .env file or your shell environment.

    Environment Variables

    VariableDescriptionDefaultRequired
    MODBUS_TYPEConnection type: tcp, udp, or serialtcpYes
    MODBUS_HOSTHost address for TCP/UDP127.0.0.1For TCP/UDP
    MODBUS_PORTPort for TCP/UDP502For TCP/UDP
    MODBUS_DEFAULT_SLAVE_IDSlave ID1For TCP/UDP
    MODBUS_SERIAL_PORTSerial port (e.g., /dev/ttyUSB0, COM1)/dev/ttyUSB0For serial
    MODBUS_BAUDRATESerial baud rate9600For serial
    MODBUS_PARITYSerial parity: N (none), E (even), O (odd)NFor serial
    MODBUS_STOPBITSSerial stop bits1For serial
    MODBUS_BYTESIZESerial byte size8For serial
    MODBUS_TIMEOUTSerial timeout (seconds)1For serial

    Example .env File

    For TCP:

    code
    MODBUS_TYPE=tcp
    MODBUS_HOST=192.168.1.100
    MODBUS_PORT=502
    MODBUS_SLAVE_ID=1

    For Serial:

    code
    MODBUS_TYPE=serial
    MODBUS_SERIAL_PORT=/dev/ttyUSB0
    MODBUS_BAUDRATE=9600
    MODBUS_PARITY=N
    MODBUS_STOPBITS=1
    MODBUS_BYTESIZE=8
    MODBUS_TIMEOUT=1

    Usage

    Installing for Claude Desktop

    The configuration file:

    json
    {
       "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 },
           }
       }
    }

    Using Tools

    Note: Natural language support depends on the client’s ability to parse and map prompts to tools. The MCP Inspector requires structured JSON, but the examples below show how conversational inputs translate.

    1. Read a Holding Register:

    • Prompt:
    code
    Please read the value of Modbus holding register 0.
    • MCP Inspector JSON:
    json
    {
           "tool": "read_register",
           "parameters": {"address": 0, "slave_id": 1}
         }
    • Expected Output: Value:

    2. Write to a Holding Register:

    • Prompt:
    code
    Set Modbus holding register 10 to the value 100.
    • MCP Inspector JSON:
    json
    {
           "tool": "write_register",
           "parameters": {"address": 10, "value": 100, "slave_id": 1}
         }
    • Expected Output: Successfully wrote 100 to register 10

    3. Read Coils:

    • Prompt:
    code
    Check the status of the first 5 Modbus coils starting at address 0.
    • MCP Inspector JSON:
    json
    {
           "tool": "read_coils",
           "parameters": {"address": 0, "count": 5, "slave_id": 1}
         }
    • Expected Output: Coils 0 to 4: [False, False, False, False, False]

    4. Write to a Coil:

    • Prompt:
    code
    Turn on Modbus coil 5.
    • MCP Inspector JSON:
    json
    {
           "tool": "write_coil",
           "parameters": {"address": 5, "value": true, "slave_id": 1}
         }
    • Expected Output: Successfully wrote True to coil 5

    5. Read Input Registers:

    • Prompt:
    code
    Read the values of 3 Modbus input registers starting from address 2.
    • MCP Inspector JSON:
    json
    {
           "tool": "read_input_registers",
           "parameters": {"address": 2, "count": 3, "slave_id": 1}
         }
    • Expected Output: Input Registers 2 to 4: [, , ]

    6. Read Multiple Holding Registers:

    • Prompt:
    code
    Get the values of Modbus holding registers 0 through 2.
    • MCP Inspector JSON:
    json
    {
           "tool": "read_multiple_holding_registers",
           "parameters": {"address": 0, "count": 3, "slave_id": 1}
         }
    • Expected Output: Holding Registers 0 to 2: [, , ]

    License

    This project is licensed under the MIT License. See LICENSE for details.

    Similar MCP

    Based on tags & features

    • PE

      Personalizationmcp

      Python·
      12
    • MA

      Mayamcp

      Python·
      27
    • BI

      Biothings Mcp

      Python·
      25
    • GG

      Gget Mcp

      Python·
      17

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • PE

      Personalizationmcp

      Python·
      12
    • MA

      Mayamcp

      Python·
      27
    • BI

      Biothings Mcp

      Python·
      25
    • GG

      Gget Mcp

      Python·
      17

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k