Home / MCP / MCP2TCP MCP Server

MCP2TCP MCP Server

Bridges TCP devices with AI models via MCP for natural-language hardware control and real-time parameter tuning.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "mcp2tcp": {
            "command": "uv",
            "args": [
                "run",
                "src/mcp2tcp/server.py"
            ]
        }
    }
}

The MCP server mcp2tcp bridges TCP devices with AI models using the Model Context Protocol, enabling you to control hardware with natural language and receive real-time AI-driven adjustments to physical parameters.

How to use

You connect your MCP client to the mcp2tcp server and leverage natural language prompts to control and monitor TCP-connected devices. The server accepts commands and translates them into TCP messages that your hardware can understand, while the AI model context provides reasoning, tool access, and dynamic parameter tuning. Use supported MCP clients to send prompts, manage resources, and call tools as needed. Start with a simple test device to verify connectivity, then expand to more complex hardware and workflows.

Typical usage patterns include establishing a TCP connection to your hardware, sending a command to set a device parameter (for example, PWM or sensor readouts), and requesting status updates. You can also load multiple configuration profiles to switch between different devices or setups without editing code. When you issue a natural language request, the MCP client routes it through the MCP protocol, enabling the AI model to interpret, plan, and execute actions on the hardware.

How to install

Prerequisites: Python 3.11 or later.

Clone the project, set up a virtual environment, and install development dependencies.

# Clone the repository
git clone https://github.com/mcp2everything/mcp2tcp.git
cd mcp2tcp

# Create and activate a virtual environment
uv venv .venv

# Activate the virtual environment
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate

# Install development dependencies in editable mode
uv pip install --editable .

Configuration and run

Configure your MCP client to load and start the MCP server. You can run the server directly and optionally specify a configuration profile.

{
  "mcpServers": {
    "mcp2tcp": {
      "command": "uv",
      "args": [
        "run",
        "src/mcp2tcp/server.py"
      ]
    }
  }
}
{
  "mcpServers": {
    "mcp2tcp": {
      "command": "uv",
      "args": [
        "run",
        "src/mcp2tcp/server.py",
        "--config",
        "Pico"
      ]
    }
  }
}
{
  "mcpServers": {
    "mcp2tcp2": {
      "command": "uv",
      "args": [
        "run",
        "src/mcp2tcp/server.py",
        "--config",
        "Pico2"
      ]
    }
  }
}

Available tools

MCP integrations

Full support for the Model Context Protocol with resource management and tool invocation to enable AI-driven hardware control.