Skip to main content
Glama

CO2 Sensor MCP Server

センサーデバイス用MCPサーバー

このプロジェクトは、Claude Desktop で使用するために設計された Node.js アプリケーションです。CO2 センサーデバイスをシミュレートし、デバイスとやり取りするための JSON-RPC サーバーを提供します。このアプリケーションは、シミュレーションモードとリアルモードの両方で実行でき、リアルモードでは USB 経由で Raspberry Pi Pico に接続して CO2 レベルを読み取ります。

特徴

  • シミュレーション モードでランダムな CO2 レベルを持つ CO2 センサー デバイスをシミュレートします。
  • USB 経由で Raspberry Pi Pico に接続し、実際の CO2 レベルを読み取ります。
  • 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への接続を処理し、CO2レベルを読み取ります。

方法

  • getDeviceInfo() : デバイス情報を返します。
  • getSensorData() : センサー データを返します。
  • getNetworkStatus() : ネットワークステータスを返します (モック機能)。
  • publishToMQTT() : MQTT へのデータの公開をシミュレートします (モック機能)。
  • reconnectWiFi() : WiFi への再接続をシミュレートします (モック機能)。
  • reconnectMQTT() : MQTT への再接続をシミュレートします (モック機能)。

ログ記録

アプリケーションは、CO2 レベルやその他の情報をユーザーのホーム ディレクトリにあるログ ファイル ( 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.

シミュレーション モードと実際の Raspberry Pi Pico ハードウェア接続の両方で動作し、CO2 センサー データと対話するための JSON-RPC インターフェイスを提供する Node.js アプリケーションです。

  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