Skip to main content
Glama

mihome-mcp

基于 Mastra 框架实现的小米米家智能家居 MCP 服务器,提供设备控制、场景管理和自动化功能。

功能特性

连接管理

  • miot-connect - 连接到米家云服务

  • miot-disconnect - 断开连接

设备管理

  • miot-discover-devices - 发现所有设备

  • miot-search-devices - 搜索设备

  • miot-get-device-properties - 获取设备属性列表

  • miot-get-property-value - 获取属性值

  • miot-set-property-value - 设置属性值

  • miot-batch-set-properties - 批量设置属性

动作调用

  • miot-get-device-actions - 获取设备动作列表

  • miot-call-action - 调用设备动作

状态监控

  • miot-get-device-status - 获取设备状态

  • miot-refresh-all-device-status - 刷新所有设备状态

  • miot-get-server-status - 获取服务器状态

家庭和场景

  • miot-get-homes - 获取家庭列表

  • miot-get-scenes-list - 获取场景列表

  • miot-run-scene - 执行场景

开始使用

1. 启动 Mastra 开发服务器

pnpm run dev

访问 http://localhost:4111 打开 Mastra Studio。

2. 构建 MCP 服务器

pnpm run build:mcp

构建完成后,dist/mcp/stdio.mjs 可作为独立的 MCP 服务器运行。

3. 在 MCP 客户端中使用

配置你的 MCP 客户端(如 Claude Desktop、Cursor 等):

{
  "mcpServers": {
    "mihome": {
      "command": "node",
      "args": ["/path/to/mihome-mcp/dist/mcp/stdio.mjs"]
    }
  }
}

开发

编辑 src/mastra/mcp/ 目录下的文件来修改 MCP 工具和服务器逻辑:

  • mihome-tools.ts - MCP 工具定义

  • stdio.ts - MCP 服务器入口

了解更多

-
security - not tested
F
license - not found
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mizuka-wu/mihome-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server