Cover image
Try Now
2025-03-11

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

3 years

Works with Finder

1

Github Watches

1

Github Forks

2

Github Stars

MCP Server for sensor device

This project is a Node.js application designed for use with Claude Desktop. It simulates a CO2 sensor device and provides a JSON-RPC server to interact with the device. The application can run in both simulation mode and real mode, where it connects to a Raspberry Pi Pico via USB to read CO2 levels.

Features

  • Simulates a CO2 sensor device with random CO2 levels in simulation mode.
  • Connects to a Raspberry Pi Pico via USB to read real CO2 levels.
  • Provides device information, sensor data, and network status via JSON-RPC.
  • Supports commands to publish data to MQTT, reconnect WiFi, and reconnect MQTT (some functionalities are mocked).

Installation

You need to have Node.js installed on your machine to run this application. If you don't have Node.js installed, you can download it from the official website.

  1. Clone the repository.

  2. Install the dependencies using npm:

    npm install
    

Configuration

Ensure that the claude_desktop_config.json file is correctly configured to run the server. Example configuration:

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

Usage

To start the server, run the following command:

node index.js

JSON-RPC Methods

initialize

Initializes the server and returns server capabilities.

shutdown

Shuts down the server.

resources/list

Lists available resources.

resources/read

Reads the specified resource.

tools/list

Lists available tools.

tools/call

Calls the specified tool.

DeviceState Class

The DeviceState class simulates the device state and provides methods to get device information, sensor data, and network status. It also handles the connection to the Raspberry Pi Pico and reads CO2 levels.

Methods

  • getDeviceInfo(): Returns device information.
  • getSensorData(): Returns sensor data.
  • getNetworkStatus(): Returns network status (mocked functionality).
  • publishToMQTT(): Simulates publishing data to MQTT (mocked functionality).
  • reconnectWiFi(): Simulates reconnecting to WiFi (mocked functionality).
  • reconnectMQTT(): Simulates reconnecting to MQTT (mocked functionality).

Logging

The application logs CO2 levels and other information to a log file located in the user's home directory (co2_level.log).

License

This project is licensed under the MIT License.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_b7dAcR5n
    2025-04-15

    Flightradar24 MCP Server by Cyreslab-AI is an exceptional server that enhances my flight tracking experience tremendously. Its seamless performance and real-time data make it an invaluable tool for aviation enthusiasts like me. The setup was straightforward, and I appreciate the user-friendly interface. This server has become an essential part of my daily usage, and I highly recommend it to anyone interested in aviation.