bmahs-mcp-gateway-node
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BMAHS_AGENT_ID | No | 网关在协议中的智能体 id | bmahs-mcp-<主机名>-<6位hex> |
| BMAHS_HTTP_HOST | No | HTTP 模式默认参数:监听地址 | 0.0.0.0 |
| BMAHS_HTTP_PATH | No | HTTP 模式默认参数:路径 | /mcp |
| BMAHS_HTTP_PORT | No | HTTP 模式默认参数:端口 | 9530 |
| BMAHS_LOG_LEVEL | No | 日志级别(一律走 stderr) | info |
| BMAHS_MAX_LEASE | No | 最大租约时间 | 3600 |
| BMAHS_TOOL_DENY | No | 动态工具黑名单(fnmatch 通配符,deny 优先) | |
| BMAHS_EXPIRE_SEC | No | 设备过期时限 | 1800 |
| BMAHS_HTTP_TOKEN | No | HTTP 模式默认参数:Bearer Token(无则无需鉴权) | |
| BMAHS_TOOL_ALLOW | No | 动态工具白名单(fnmatch 通配符) | |
| BMAHS_AUTO_OCCUPY | No | 自动占用策略(是否自动占用) | 1 |
| BMAHS_CAPTURE_DIR | No | bmahs_screenshot 帧落盘目录 | <系统临时目录>/bmahs_captures |
| BMAHS_MCAST_IF_V4 | No | 手动指定组播网卡(逗号分隔本机 IPv4) | 自动枚举 |
| BMAHS_CALL_TIMEOUT | No | 调用超时时间 | 30 |
| BMAHS_BONJOUR_BROWSE | No | `0` 关闭 mDNS 浏览通道 | 1 |
| BMAHS_QUERY_INTERVAL | No | query 周期 | 300 |
| BMAHS_STATIC_DEVICES | No | 静态设备表,逗号/分号分隔 `tcp://host:port` | |
| BMAHS_AUTO_OCCUPY_TTL | No | 自动占用租约 TTL | 120 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| bmahs_devicesA | 列出当前发现的全部 BMAHS 设备(id、显示名、自然语言自述、类型、状态、占用方与连接地址)。选设备、查占用状态时先用这个工具。 |
| bmahs_refreshA | 重新扫描 BMAHS 设备:发送组播 query 并刷新各设备的自述(hello)。当设备列表为空、新设备刚上电、或怀疑列表过期时调用。 |
| bmahs_describeA | 读取某台 BMAHS 设备的完整操作清单(operations)、安全边界(security)与自然语言自述。 |
| bmahs_occupyA | 独占占用一台 BMAHS 设备(返回的 token 由网关保存并自动携带)。租约由网关强制为有限时长:不带 ttl 默认 120 秒(2 分钟),请求值超过上限(默认 3600 秒)会被截断,不支持无限期占用。租约到期设备自动收回占用权;任务结束也可调用 bmahs_release 提前释放。 |
| bmahs_releaseA | 释放对某台 BMAHS 设备的占用。任务结束、失败或取消后必须调用,否则其它智能体会一直收到「被占用」。 |
| bmahs_callA | 对 BMAHS 设备执行任意其操作清单内(operations)的动作,参数按该动作的 args 传。适合调用尚未生成独立工具的动作,或临时查看新设备。 |
| bmahs_screenshotA | (实验)对声明了 ui 能力的 BMAHS 设备抓取一帧当前画面:自动 ui.start → 二进制流取一帧 JPEG → ui.stop,返回图片与保存路径。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 7 tools
Each tool targets a distinct operation: listing, refreshing, describing, occupying, releasing, generic calling, and screenshotting. The only minor ambiguity is between bmahs_devices and bmahs_refresh (both concern device discovery), but their descriptions clearly separate current listing from force-rescanning.
All tools share the uniform bmahs_ prefix and snake_case style, with simple verbs (refresh, describe, occupy, release, call). The slight inconsistency is that bmahs_devices uses a noun instead of a verb like list_devices, and bmahs_screenshot is a noun-verb hybrid, but the pattern remains predictable.
Seven tools is a well-scoped size for a device gateway. Each tool covers a distinct phase of the device lifecycle: discovery, inspection, access control, and execution, without unnecessary redundancy or bloat.
The tool surface provides a full workflow: discover devices (devices/refresh), understand capabilities (describe), reserve access (occupy/release), execute actions (call), and capture UI (screenshot). The generic bmahs_call fills gaps for unmodeled actions, making the set effectively complete for the stated gateway purpose.