mcp2tcp


Namemcp2tcp JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryMCP TCP Service for PWM Control
upload_time2025-01-01 23:59:05
maintainerNone
docs_urlNone
authorMCP2Everything Team
requires_python>=3.11
licenseNone
keywords ai llm mcp pwm tcp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mcp2tcp: Bridge between AI Models and Physical World

Connect AI Large Language Models to hardware devices through the Model Context Protocol (MCP).

[GitHub Repository](https://github.com/mcp2everything/mcp2tcp) | [Documentation](https://github.com/mcp2everything/mcp2tcp/tree/main/docs)

## Features

- **Intelligent TCP Communication**
  - Connect and send commands to TCP server
  - Real-time status monitoring and error handling

- **MCP Protocol Integration**
  - Full Model Context Protocol support
  - Resource management and tool invocation
  - Flexible prompt system

## Supported Clients

mcp2tcp supports all clients implementing the MCP protocol, including:

- Claude Desktop (Test ok)
- Continue (Should work)
- Cline (Test ok)

## Quick Start
make sure you have installed uv
```
```bash
windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
```
## Basic Configuration

Add the following to your MCP client configuration:

```json
{
    "mcpServers": {
        "mcp2tcp": {
            "command": "uvx",
            "args": ["mcp2tcp"]
        }
    }
}
```

## Serial Port Configuration

Create or modify `config.yaml` to configure serial port parameters:

```yaml
tcp:
  # TCP服务器配置
  remote_ip: "127.0.0.1"  # 远端IP地址
  port: 9999  # 端口号
  connect_timeout: 3.0  # 连接超时时间,单位为秒
  receive_timeout: 2.0  # 接收超时时间,单位为秒
  communication_type: "client"  # 通信类型,client或server
  response_start_string: "CMD"  # 可选,TCP应答的开始字符串,默认为OK

commands:
  # PWM控制命令
  set_pwm:
    command: "CMD_PWM {frequency}"  # frequency为0-100的整数,表示PWM占空比
    need_parse: false  # 不需要解析响应内容
    data_type: "ascii"  # 数据类型,ascii或hex
    parameters:
      - name: "frequency"
        type: "integer"
        description: "PWM frequency value (0-100)"
        required: true
    prompts:
      - "把PWM调到最大 (frequency=100)"
      - "把PWM调到最小 (frequency=0)"
      - "请将PWM设置为{frequency} (0-100的整数)"
      - "关闭PWM (frequency=0)"
      - "把PWM调到一半 (frequency=50)"

  # PICO信息查询命令
  get_pico_info:
    command: "CMD_PICO_INFO"  # 实际发送的命令格式,server会自动添加\r\n
    need_parse: true  # 需要解析响应内容
    data_type: "ascii"  # 数据类型,ascii或hex
    prompts:
      - "查询Pico板信息"
      - "显示开发板状态"
```

## Configuration File Location

The configuration file (`config.yaml`) can be placed in different locations depending on your needs. The program searches for the configuration file in the following order:

### 1. Current Working Directory (For Development)
- Path: `./config.yaml`
- Example: If you run the program from `C:\Projects`, it will look for `C:\Projects\config.yaml`
- Best for: Development and testing
- No special permissions required

### 2. User's Home Directory (Recommended for Personal Use)
- Windows: `C:\Users\YourName\.mcp2tcp\config.yaml`
- macOS: `/Users/YourName/.mcp2tcp/config.yaml`
- Linux: `/home/username/.mcp2tcp/config.yaml`
- Best for: Personal configuration
- Create the `.mcp2tcp` directory if it doesn't exist
- No special permissions required

### 3. System-wide Configuration (For Multi-user Setup)
- Windows: `C:\ProgramData\mcp2tcp\config.yaml` (requires admin rights)
- macOS/Linux: `/etc/mcp2tcp/config.yaml` (requires sudo/root)
- Best for: Shared configuration in multi-user environments
- Create the directory with appropriate permissions

The program will use the first valid configuration file it finds in this order. Choose the location based on your needs:
- For testing: use current directory
- For personal use: use home directory (recommended)
- For system-wide settings: use ProgramData or /etc

## Documentation

For detailed documentation, please visit our [GitHub repository](https://github.com/mcp2everything/mcp2tcp).

## Support

If you encounter any issues or have questions:
1. Check our [Issues](https://github.com/mcp2everything/mcp2tcp/issues) page
2. Read our [Wiki](https://github.com/mcp2everything/mcp2tcp/wiki)
3. Create a new issue if needed

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp2tcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "ai, llm, mcp, pwm, tcp",
    "author": "MCP2Everything Team",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/80/14/2d5d435e65e72d7e7dbc64a9a7e67f047b46a88d7919f6835b9defff7a95/mcp2tcp-0.3.0.tar.gz",
    "platform": null,
    "description": "# mcp2tcp: Bridge between AI Models and Physical World\n\nConnect AI Large Language Models to hardware devices through the Model Context Protocol (MCP).\n\n[GitHub Repository](https://github.com/mcp2everything/mcp2tcp) | [Documentation](https://github.com/mcp2everything/mcp2tcp/tree/main/docs)\n\n## Features\n\n- **Intelligent TCP Communication**\n  - Connect and send commands to TCP server\n  - Real-time status monitoring and error handling\n\n- **MCP Protocol Integration**\n  - Full Model Context Protocol support\n  - Resource management and tool invocation\n  - Flexible prompt system\n\n## Supported Clients\n\nmcp2tcp supports all clients implementing the MCP protocol, including:\n\n- Claude Desktop (Test ok)\n- Continue (Should work)\n- Cline (Test ok)\n\n## Quick Start\nmake sure you have installed uv\n```\n```bash\nwindows\npowershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"\nMacOS\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n## Basic Configuration\n\nAdd the following to your MCP client configuration:\n\n```json\n{\n    \"mcpServers\": {\n        \"mcp2tcp\": {\n            \"command\": \"uvx\",\n            \"args\": [\"mcp2tcp\"]\n        }\n    }\n}\n```\n\n## Serial Port Configuration\n\nCreate or modify `config.yaml` to configure serial port parameters:\n\n```yaml\ntcp:\n  # TCP\u670d\u52a1\u5668\u914d\u7f6e\n  remote_ip: \"127.0.0.1\"  # \u8fdc\u7aefIP\u5730\u5740\n  port: 9999  # \u7aef\u53e3\u53f7\n  connect_timeout: 3.0  # \u8fde\u63a5\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\n  receive_timeout: 2.0  # \u63a5\u6536\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\n  communication_type: \"client\"  # \u901a\u4fe1\u7c7b\u578b\uff0cclient\u6216server\n  response_start_string: \"CMD\"  # \u53ef\u9009\uff0cTCP\u5e94\u7b54\u7684\u5f00\u59cb\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4\u4e3aOK\n\ncommands:\n  # PWM\u63a7\u5236\u547d\u4ee4\n  set_pwm:\n    command: \"CMD_PWM {frequency}\"  # frequency\u4e3a0-100\u7684\u6574\u6570\uff0c\u8868\u793aPWM\u5360\u7a7a\u6bd4\n    need_parse: false  # \u4e0d\u9700\u8981\u89e3\u6790\u54cd\u5e94\u5185\u5bb9\n    data_type: \"ascii\"  # \u6570\u636e\u7c7b\u578b\uff0cascii\u6216hex\n    parameters:\n      - name: \"frequency\"\n        type: \"integer\"\n        description: \"PWM frequency value (0-100)\"\n        required: true\n    prompts:\n      - \"\u628aPWM\u8c03\u5230\u6700\u5927 (frequency=100)\"\n      - \"\u628aPWM\u8c03\u5230\u6700\u5c0f (frequency=0)\"\n      - \"\u8bf7\u5c06PWM\u8bbe\u7f6e\u4e3a{frequency} (0-100\u7684\u6574\u6570)\"\n      - \"\u5173\u95edPWM (frequency=0)\"\n      - \"\u628aPWM\u8c03\u5230\u4e00\u534a (frequency=50)\"\n\n  # PICO\u4fe1\u606f\u67e5\u8be2\u547d\u4ee4\n  get_pico_info:\n    command: \"CMD_PICO_INFO\"  # \u5b9e\u9645\u53d1\u9001\u7684\u547d\u4ee4\u683c\u5f0f\uff0cserver\u4f1a\u81ea\u52a8\u6dfb\u52a0\\r\\n\n    need_parse: true  # \u9700\u8981\u89e3\u6790\u54cd\u5e94\u5185\u5bb9\n    data_type: \"ascii\"  # \u6570\u636e\u7c7b\u578b\uff0cascii\u6216hex\n    prompts:\n      - \"\u67e5\u8be2Pico\u677f\u4fe1\u606f\"\n      - \"\u663e\u793a\u5f00\u53d1\u677f\u72b6\u6001\"\n```\n\n## Configuration File Location\n\nThe configuration file (`config.yaml`) can be placed in different locations depending on your needs. The program searches for the configuration file in the following order:\n\n### 1. Current Working Directory (For Development)\n- Path: `./config.yaml`\n- Example: If you run the program from `C:\\Projects`, it will look for `C:\\Projects\\config.yaml`\n- Best for: Development and testing\n- No special permissions required\n\n### 2. User's Home Directory (Recommended for Personal Use)\n- Windows: `C:\\Users\\YourName\\.mcp2tcp\\config.yaml`\n- macOS: `/Users/YourName/.mcp2tcp/config.yaml`\n- Linux: `/home/username/.mcp2tcp/config.yaml`\n- Best for: Personal configuration\n- Create the `.mcp2tcp` directory if it doesn't exist\n- No special permissions required\n\n### 3. System-wide Configuration (For Multi-user Setup)\n- Windows: `C:\\ProgramData\\mcp2tcp\\config.yaml` (requires admin rights)\n- macOS/Linux: `/etc/mcp2tcp/config.yaml` (requires sudo/root)\n- Best for: Shared configuration in multi-user environments\n- Create the directory with appropriate permissions\n\nThe program will use the first valid configuration file it finds in this order. Choose the location based on your needs:\n- For testing: use current directory\n- For personal use: use home directory (recommended)\n- For system-wide settings: use ProgramData or /etc\n\n## Documentation\n\nFor detailed documentation, please visit our [GitHub repository](https://github.com/mcp2everything/mcp2tcp).\n\n## Support\n\nIf you encounter any issues or have questions:\n1. Check our [Issues](https://github.com/mcp2everything/mcp2tcp/issues) page\n2. Read our [Wiki](https://github.com/mcp2everything/mcp2tcp/wiki)\n3. Create a new issue if needed\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "MCP TCP Service for PWM Control",
    "version": "0.3.0",
    "project_urls": {
        "Documentation": "https://github.com/mcp2everything/mcp2tcp/tree/main/docs",
        "Homepage": "https://github.com/mcp2everything/mcp2tcp",
        "Issues": "https://github.com/mcp2everything/mcp2tcp/issues",
        "Repository": "https://github.com/mcp2everything/mcp2tcp.git"
    },
    "split_keywords": [
        "ai",
        " llm",
        " mcp",
        " pwm",
        " tcp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "690dd28ccba0f34b45bc9ef339a7e4f53261f67e57c488e16af147c4d8fbe911",
                "md5": "b618e1fec9f51d3be65ca77c15d97254",
                "sha256": "33f0cf845bcb31b9369d95f8af3c3515c8259bf2ef0e212f8a5c0f0fd15457bc"
            },
            "downloads": -1,
            "filename": "mcp2tcp-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b618e1fec9f51d3be65ca77c15d97254",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 11028,
            "upload_time": "2025-01-01T23:59:02",
            "upload_time_iso_8601": "2025-01-01T23:59:02.268020Z",
            "url": "https://files.pythonhosted.org/packages/69/0d/d28ccba0f34b45bc9ef339a7e4f53261f67e57c488e16af147c4d8fbe911/mcp2tcp-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80142d5d435e65e72d7e7dbc64a9a7e67f047b46a88d7919f6835b9defff7a95",
                "md5": "c69619e44942f5fdc66a80643a7c694d",
                "sha256": "3333de87c27661d866467a3d77ee6007d924e57edea6b4ec8fdc354540e43df0"
            },
            "downloads": -1,
            "filename": "mcp2tcp-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c69619e44942f5fdc66a80643a7c694d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 1425122,
            "upload_time": "2025-01-01T23:59:05",
            "upload_time_iso_8601": "2025-01-01T23:59:05.404531Z",
            "url": "https://files.pythonhosted.org/packages/80/14/2d5d435e65e72d7e7dbc64a9a7e67f047b46a88d7919f6835b9defff7a95/mcp2tcp-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-01 23:59:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mcp2everything",
    "github_project": "mcp2tcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mcp2tcp"
}
        
Elapsed time: 0.44345s