Skip to main content
Glama

CO2 Sensor MCP Server

传感器设备的 MCP 服务器

该项目是一个 Node.js 应用程序,专为 Claude Desktop 设计。它模拟了一个二氧化碳传感器设备,并提供一个 JSON-RPC 服务器与该设备交互。该应用程序可以在模拟模式和真实模式下运行,在真实模式下,它通过 USB 连接到 Raspberry Pi Pico 来读取二氧化碳浓度。

特征

  • 在模拟模式下模拟具有随机二氧化碳水平的二氧化碳传感器设备。
  • 通过 USB 连接到 Raspberry Pi Pico 以读取真实的二氧化碳水平。
  • 通过 JSON-RPC 提供设备信息、传感器数据和网络状态。
  • 支持发布数据到MQTT、重新连接WiFi、重新连接MQTT的命令(部分功能模拟)。

安装

您需要在计算机上安装 Node.js 才能运行此应用程序。如果您尚未安装 Node.js,可以从官方网站下载。

  1. 克隆存储库。
  2. 使用 npm 安装依赖项:
    npm install

配置

确保正确配置claude_desktop_config.json文件以运行服务器。示例配置:

{ "mcpServers": { "CO2 sensor": { "command": "node", "args": [ "...mcp-server-for-sensor-device/index.js" ], "env": {} } } }

用法

要启动服务器,请运行以下命令:

node index.js

JSON-RPC 方法

initialize

初始化服务器并返回服务器功能。

shutdown

关闭服务器。

resources/list

列出可用资源。

resources/read

读取指定的资源。

tools/list

列出可用的工具。

tools/call

调用指定的工具。

DeviceState 类

DeviceState类模拟设备状态,并提供获取设备信息、传感器数据和网络状态的方法。它还负责处理与 Raspberry Pi Pico 的连接并读取二氧化碳浓度。

方法

  • getDeviceInfo() :返回设备信息。
  • getSensorData() :返回传感器数据。
  • getNetworkStatus() :返回网络状态(模拟功能)。
  • publishToMQTT() :模拟将数据发布到 MQTT(模拟功能)。
  • reconnectWiFi() :模拟重新连接到 WiFi(模拟功能)。
  • reconnectMQTT() :模拟重新连接到 MQTT(模拟功能)。

日志记录

该应用程序将二氧化碳水平和其他信息记录到位于用户主目录 ( co2_level.log ) 中的日志文件中。

执照

该项目已获得 MIT 许可。

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

local-only server

The server can only run on the client's local machine because it depends on local resources.

一个 Node.js 应用程序,它提供了一个 JSON-RPC 接口来与 CO2 传感器数据交互,可以在模拟模式下和真实的 Raspberry Pi Pico 硬件连接下工作。

  1. 特征
    1. 安装
      1. 配置
        1. 用法
          1. JSON-RPC 方法
            1. initialize
            2. shutdown
            3. resources/list
            4. resources/read
            5. tools/list
            6. tools/call
          2. DeviceState 类
            1. 方法
          3. 日志记录
            1. 执照

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A beginner-friendly MCP-inspired JSON-RPC server built with Node.js, offering basic client-server interaction through an 'initialize' capabilities handshake and an 'echo' function.
                Last updated -
                3
                JavaScript
                MIT License
              • A
                security
                F
                license
                A
                quality
                A Node.js server that provides advanced video and image processing capabilities through the Model Context Protocol, enabling operations like conversion, compression, editing, and effects application.
                Last updated -
                10
                13
                JavaScript
                • Apple
                • Linux
              • -
                security
                F
                license
                -
                quality
                Node.js server implementing Model Context Protocol for filesystem operations, allowing Claude to read, write, and manipulate files and directories in specified locations.
                Last updated -
                37,693
                JavaScript
              • -
                security
                F
                license
                -
                quality
                A Node.js application that provides a Model Context Protocol server for interacting with Harbor container registry, supporting operations for projects, repositories, tags, and Helm charts.
                Last updated -
                TypeScript

              View all related MCP servers

              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/kmwebnet/MCP-Server-for-sensor-device'

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