MCP -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.
claude mcp add --transport stdio kmwebnet-mcp-server-for-sensor-device node ...mcp-server-for-sensor-device/index.js
How to use
This MCP server implements a JSON-RPC interface to interact with a simulated CO2 sensor device. It can run in two modes: a simulation mode that generates random CO2 levels, and a real mode that connects to a Raspberry Pi Pico via USB to read actual CO2 measurements. The server exposes commands to get device information, retrieve sensor data, and report network status, as well as tools to publish data to MQTT and manage network connections. Typical usage is to start the server and then use the provided JSON-RPC methods such as initialize to discover capabilities, resources/list to enumerate available resources, resources/read to fetch data, and tools/list or tools/call to use or invoke auxiliary tools. Some networking-related actions (publish to MQTT, reconnect WiFi, reconnect MQTT) are mocked to demonstrate integration points without requiring a full MQTT or network setup.
How to install
Prerequisites:
- Node.js installed on your machine
- Access to the repository with the MCP server code
Installation steps:
-
Clone the repository: git clone <repository-url> cd <repository-directory>
-
Install dependencies: npm install
-
Configure the server for Claude Desktop:
- Edit claude_desktop_config.json to include the MCP server entry. Example: { "mcpServers": { "CO2 sensor": { "command": "node", "args": ["...mcp-server-for-sensor-device/index.js"], "env": {} } } }
-
Start the server (local development): node index.js
-
Ensure any required hardware (Raspberry Pi Pico) is connected if you plan to run in real mode.
Additional notes
Tips and notes:
- The device state simulates CO2 levels in software when in simulation mode. Real mode relies on a USB connection to a Raspberry Pi Pico; ensure proper USB access and drivers.
- Logs are written to the user’s home directory in a file named co2_level.log. Check permissions if the log file cannot be created.
- The JSON-RPC methods include initialize, shutdown, resources/list, resources/read, tools/list, and tools/call. Some network-related features (publishToMQTT, reconnectWiFi, reconnectMQTT) are mocked for demonstration purposes.
- If you modify claude_desktop_config.json, restart the server to pick up changes.
- The server is designed to work with Claude Desktop integration; verify that Claude Desktop is configured to communicate with the MCP server via the expected JSON-RPC endpoints.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.