BG

bryannewcoder/garage-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 73 趋势 14MIT

一个用于Meross车库门遥控器的MCP服务器。它通过stdio向AI助手展示三个工具:

概览

一个用于Meross车库门遥控器的MCP服务器。它通过stdio向AI助手展示三个工具: - garage_status — 返回门当前的开闭状态- garage_open — 开门(两相确认,见安全) - garage_close — 关闭门(两相确认,见安全) 开关门是一项操作,按设计: 1. — 呼叫 garage_open / garage_close,且无参数。它报告当前状态并请求确认。将确认信息转达给用户并等待。2. — 只有在用户明确说出yes/go/open(或yes/go/close)后,才再次调用确认=“YES”。命令发送完成。 如果用户回复中止/停止/取消,不要拨打第二阶段通话。绝不要自我确认。 30秒冷却还会在门移动时拒绝重复指令——用 garage_status 检查状态。 - Python 3.10+ - 一个带有车库门开门器的 Meross 账户 - pip install mcp meross_iot 2. 登录Meross,在~/生成缓存令牌。

概述(AI 翻译)

一个用于Meross车库门遥控器的MCP服务器。它通过stdio向AI助手展示三个工具:

  • garage_status — 返回门当前的开闭状态
  • garage_open — 开门(两相确认,见安全)
  • garage_close — 关闭门(两相确认,见安全)

安全

开关门是两相操作,设计上是:

  1. 阶段1 — 呼叫garage_open / garage_close,无参数。它报告当前状态并请求确认。将此信息转达给用户并等待。
  2. 阶段2 — 只有在用户明确说出“是/去/开启”(或是/去/关闭)后,再用confirm="YES"呼叫。命令被发送。

如果用户回复中止/停止/取消,不要拨打第二阶段通话。绝不要自我确认。

30秒冷却时间还会在门移动时拒绝重复指令——改用garage_status检查状态。

要求

  • Python 3.10+
  • 一个带有车库门遥控器的Meross账户
  • pip install mcp meross_iot

布置

  1. 安装依赖:

  2. 一次性登录Meross,生成缓存令牌,位于~/.config/meross/token.json。

本页由 AI 翻译,技术细节请以原文为准。

README

Garage MCP

An MCP server for a Meross garage door opener. It exposes three tools to an AI assistant over stdio:

  • garage_status — returns the door’s current open/closed state
  • garage_open — opens the door (two-phase confirm, see Safety)
  • garage_close — closes the door (two-phase confirm, see Safety)

Safety

Opening or closing the door is a two-phase operation, by design:

  1. Phase 1 — call garage_open / garage_close with no arguments. It reports the current state and asks for confirmation. Relay that to the user and wait.
  2. Phase 2 — only after the user explicitly says yes/go/open (or yes/go/close), call again with confirm="YES". The command is sent.

If the user replies ABORT / STOP / CANCEL, do not make the phase 2 call. Never self-confirm.

A 30-second cooldown also rejects duplicate commands while the door is in motion — use garage_status to check the state instead.

Requirements

  • Python 3.10+
  • A Meross account with a garage door opener on it
  • pip install mcp meross_iot

Setup

  1. Install dependencies:

    pip install mcp meross_iot
    
  2. Log in to Meross once to produce a cached token at ~/.config/meross/token.json. The server reads that file at runtime — the token is never printed, and it is not part of this repo.

  3. Point your MCP client at the script, e.g.:

    {
      "mcpServers": {
        "garage": {
          "command": "python3",
          "args": ["/path/to/garage_mcp.py"]
        }
      }
    }
    

How it works

On each call, the server loads the cached credentials, discovers Meross devices on the account, and uses the first device that supports the garage-opener interface. Status reads the door sensor; open/close sends the command and starts the cooldown timer. If the token is expired or missing, the tool returns an error telling you to log in again — it never asks for credentials itself.

Security notes

  • The token file at ~/.config/meross/token.json holds your Meross account credentials. Keep it private, never commit it, and never share it.
  • This server has no authentication of its own — it trusts whoever can run it. Keep it on a machine you control.

License

MIT — see LICENSE. Use it, fork it, improve it.

Questions or bugs

Please open an Issue on this repo.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "garage": { "command": "python3", "args": ["/path/to/garage_mcp.py"] } } }