设备控制服务器

Buttplug.io MCP服务器,允许LLM程序查询和控制生殖接口设备。

  • by ConAcademy
  • Go
  • 本地部署
  • 136 星标
  • 更新于
在 GitHub 查看 ConAcademy/buttplug-mcp

使用说明

buttplug.io mcp服务器

buttplug-mcp 是一个 模型上下文协议(MCP) 服务器 Buttplug.io生态系统。它允许工具支持LLM程序,如 克劳德桌面 查询和控制您的生殖器接口设备。

|插入人工智能生成的机器人做坏事的垃圾图像|
LLM|=> - - (__(__)

设置后,您可以提示您的LLM:

  • “我的连接插头设备是什么?”
  • “将LELO F1S上的第二个电机设置为50%的强度”
  • “我的Lovense Max 2还剩多少电池?”
  • “我的WeWibe信号弱吗?”

注:以上是有抱负的,实际上是 当前经验 不稳定,令人沮丧。

它支持以下资源和工具:

资源 描述
/devices JSON格式的已连接Buttplug设备列表。
/device/{id} 按设备ID列出的设备信息,其中id 是一个数字 /devices
/device/{id}/rssi 按设备ID划分的RSSI信号电平,其中 id 是一个数字 /devices
/device/{id}/battery 按设备ID显示的电池电量 id 是一个数字 /devices
工具 参数 描述
device_vibrate id, motor, strength 通过以下方式振动设备 id,选择 strength 可选 motor
JSON Schema for Resources. Click to expand

schema_resources.json

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "resources": [
      {
        "uri": "devices",
        "name": "Device List",
        "description": "List of connected Buttplug devices in JSON",
        "mimeType": "application/json"
      }
    ]
  }
}
JSON Schema for Tools. Click to expand

schema_tools.json

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "description": "Vibrates device by `id`, selecting `strength` and optional `motor`",
        "inputSchema": {
          "type": "object",
          "properties": {
            "id": {
              "description": "Device ID to query, sourced from `/devices`",
              "pattern": "^[0-9]*$",
              "type": "number"
            },
            "motor": {
              "description": "Motor number to vibrate, defaults to 0",
              "pattern": "^[0-9]*$",
              "type": "number"
            },
            "strength": {
              "description": "Strength from 0.0 to 1.0, with 0.0 being off and 1.0 being full",
              "pattern": "^(0(\\.\\d+)?|1(\\.0+)?)$",
              "type": "number"
            }
          },
          "required": [
            "id",
            "strength"
          ]
        },
        "name": "device_vibrate"
      }
    ]
  }
}

当前状态

我在创建了另一个实验性的MCP服务后,于2025年4月1日愚人节开始着手这项工作, dbn-go 金融市场数据,前一天。所以这是新鲜的肉,是一个快速、有趣的教育项目。

虽然它确实有效,但我发现了其背后的原因 go-buttplug 图书馆 在连接处理中不稳定。我可以向Claude索要我的设备,但即使只有Intiface Central,我的特定设备也不会振动——就像在只读模式下一样!我也希望我有一个虚拟的buttplug.io设备进行测试,而不是依赖于物理设备。

因此,它还没有真正经过“端到端”的测试:wink:

我会深入了解 go-buttplug 库,看看为什么连接不稳定。我还需要了解MCP主机的MCP协议当前状态——它们似乎更关注工具而不是资源和资源模板。

安装二进制文件

适用于多个平台的二进制文件 在GitHub上发布 通过 GitHub操作.

您还可以为各种平台安装 家酿 从 conacademy/homebrew-tap:

brew tap conacademy/homebrew-tap
brew install conacademy/tap/buttplug-mcp

用法

下载 银泰中心 hub应用程序来管理您的设备。启动它并记下服务器端口(默认值似乎是 12345).

要使用此 buttplug-mcp MCP服务器,您必须配置主机程序才能使用它。我们将用 克劳德桌面我们必须找到 buttplug-mcp 我们系统上的程序;下面的示例显示了 buttplug-mcp 与MacOS Homebrew一起安装(也许可以自己构建并指向)。

下列 配置JSON 设置此项:

{
  "mcpServers": {
    "buttplug": {
      "command": "/opt/homebrew/bin/buttplug-mcp",
      "args": [
        "--ws-port", "12345"
      ]
    }
  }
}

使用Claude Desktop,您可以按照以下步骤操作 他们的配置教程 但替换上述配置。有了这个,你可以问克劳德问题,它将使用 buttplug-mcp 服务器。以下是示例对话:

也许你可以用 家庭助理MCP 集成将灯光调低。..

奥拉玛和 mcphost

对于本地推理,有MCP主机支持 没有。您可以使用任何 支持“工具”的Olama LLM我们进行了实验 mcphost,由开发人员撰写 mcp-go 图书馆 这为我们完成了繁重的任务。

以下是如何使用存储在中的上述配置安装和运行它 mcp.json:

$ go install github.com/mark3labs/mcphost@latest
$ mcphost -m ollama:llama3.3 --config mcp.json
...chat away...

似乎只支持“工具”,不支持“资源”,所以我无法枚举和反思我的设备。但我有这个工具交互(但如前所述 上方,我的设备实际上没有振动):

$ mcphost -m ollama:phi4-mini --config mcp.json
2025/04/02 09:25:05 INFO Model loaded provider=ollama model=phi4-mini
2025/04/02 09:25:05 INFO Initializing server... name=buttplug
2025/04/02 09:25:05 INFO Server connected name=buttplug
2025/04/02 09:25:05 INFO Tools loaded server=buttplug count=1
2025/04/02 09:28:31 INFO Model loaded provider=ollama model=phi4-mini
2025/04/02 09:28:31 INFO Initializing server... name=buttplug
2025/04/02 09:28:31 INFO Server connected name=buttplug
2025/04/02 09:28:31 INFO Tools loaded server=buttplug count=1
/servers
      # buttplug
      Command /opt/homebrew/bin/buttplug-mcp
      Arguments --ws-port 12345

/tools
  • buttplug
    • device_vibrate
      • Vibrates device by ID, selecting strength and optional motor

  You: buttplug device_vibrate id 0 at strength 1

  Assistant:
  <|tool_call|>[start_processing]

  [{"type":"function","function":{"name":"buttplug__device_vibrate","description":"Vibrates device by ID, selecting strength and optional
  motor","parameters":{"id":0,"strength":1}}]

  {}

  {"status":"success","message":"Device with id 0 is vibrating at full strength."}

建筑

建筑是通过以下方式进行的 任务,二进制文件可在 bin/buttplug-mcp.

$ task
task: [tidy] go mod tidy
task: [build] go build -o bin/buttplug-mcp cmd/buttplug-mcp/main.go

有用的测试工具:

  • task stdio-schema | jq --打印JSON模式
  • npx @modelcontextprotocol/inspector node build/index.js -- MCP检查器Web GUI

CLI参数

R buttplug-mcp --help
usage: buttplug-mcp [opts]

  -h, --help              Show help
  -l, --log-file string   Log file destination (or MCP_LOG_FILE envvar). Default is stderr
  -j, --log-json          Log in JSON (default is plaintext)
      --sse               Use SSE Transport (default is STDIO transport)
      --sse-host string   host:port to listen to SSE connections
  -v, --verbose           Verbose logging
      --ws-port int       port to connect to the Buttplug Websocket server

贡献与行为

与ConAcademy的所有项目一样,我们欢迎提交pull请求。或者用叉子叉,你自己动手。

无论哪种方式,遵守我们的 行为准则要遮遮掩掩,但不要做混蛋。

学分和许可证

谢谢 go-buttplug 为了 Golang Buttplug.io图书馆 及其 buttplughttp 例子,以及 go-mcp 为了 Golang模型上下文协议库.

版权所有(c)2025 Neomantra BV。由Evan Wies为 ConAcademy 的.

根据 MIT许可证,请参阅 LICENSE.txt.