Controls an Arduino-based LED system through a RESTful interface, allowing for high-level commands like turning LEDs on/off, setting patterns, and controlling LED moods through an Arduino Nano connected via USB.
Implements the Model Context Protocol server using FastAPI framework, providing a RESTful interface for interpreting high-level intents and exposing a Swagger UI for testing.
Communicates with an Arduino LED API built with Flask that serves as the intermediary between the MCP intent server and the physical Arduino hardware.
Automatically exposes a Swagger UI interface for testing the API endpoints and intents, accessible through the browser at localhost:8000/docs.
MCP LEDAPI Intent Controller
This project implements a Model Context Protocol (MCP)-style server using FastAPI to control an Arduino-based LED system via a RESTful interface.
For best results, use this together with the MCPForLedAPI project.
It interprets high-level intents like TurnOnLed
, SetMood
, or GetStatus
, and translates them into commands for the Arduino LED API.
Features
- Supports contextual LED control via structured intents
- Communicates with an Arduino LED controller API (
/setLedStatus
,/status
) - Automatically exposes Swagger UI for testing
- Extensible architecture for adding new devices or control logic
Intents Supported
Intent | Description | Parameters |
---|---|---|
TurnOnLed | Turns on a specific LED | { "color": "red" } |
TurnOffLed | Turns off all LEDs | none |
SetPattern | Sets specific LED pattern | { "pattern": "1100" } |
SetMood | Uses predefined mood pattern | { "mood": "calm" } |
PowerDown | Alias for turning everything off | none |
GetStatus | Queries the current LED state | none |
Example Requests
Requirements
- Python 3.8+
- FastAPI
- Uvicorn
- Requests
Install via:
Running the Server
Then open your browser at:
- Swagger UI: http://localhost:8000/docs
- ReDoc UI: http://localhost:8000/redoc
Architecture Overview
File Overview
mcp_server.py
: Main FastAPI server with intent handling logicrequirements.txt
: Python dependenciesREADME.md
: Project overview and usage
License
MIT License
This server cannot be installed
A Model Context Protocol server that translates high-level intents into commands for controlling an Arduino-based LED system via a RESTful interface.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.Last updated -PythonMIT License
- -securityAlicense-qualityA Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.Last updated -5PythonApache 2.0
- -securityAlicense-qualityA Model Context Protocol server that enables AI agents to control and automate Android devices through natural language, supporting actions like app management, UI interactions, and device monitoring.Last updated -2PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to control Philips Hue smart lighting systems through natural language commands.Last updated -TypeScriptMIT License