home / mcp / fledge mcp server
Exposes Fledge data and actions through MCP for Cursor AI, including data access, control, UI generation, streaming, and validation.
Configuration
View docs{
"mcpServers": {
"krupalp525-fledge-mcp": {
"url": "http://localhost:8082/tools"
}
}
}You run an MCP (Model Context Protocol) server that exposes Fledge capabilities to Cursor AI, letting you query sensors, manage services, generate UI components, stream real-time data, and validate API connections through natural language commands. This server acts as the bridge between Fledge and Cursor AI, enabling practical, AI-assisted control and visualization of your Fledge data and operations.
Start the Fledge MCP server and connect it to Cursor AI to perform common data-access, control, and visualization tasks. With the server running, you can use Cursor to check sensor status, fetch sensor data with optional filters, generate frontend components, subscribe to real-time readings, validate the Fledge API connection, and generate mock data for testing. Use natural language prompts in Cursor to invoke the available tools, and rely on the API-provided endpoints to manage services, update configuration, and retrieve API schemas when needed.
Typical usage patterns include: starting the MCP server, ensuring Fledge is running, connecting Cursor to the server’s tools endpoint, then issuing commands like checking sensor availability, listing sensors, or generating UI components for data visualization. If you enable the secure mode, you’ll authenticate with an API key passed in the X-API-Key header for protected operations while keeping the health endpoint accessible without authentication.
Prerequisites for running the Fledge MCP Server are as follows: Fledge installed locally or accessible via API at http://localhost:8081, Cursor AI installed, and Python 3.8 or newer.
Step 1: Prepare your environment and install dependencies.
# Clone the MCP server repository
git clone https://github.com/Krupalp525/fledge-mcp.git
cd fledge-mcp
# Install Python dependencies
pip install -r requirements.txtStep 2: Start Fledge and the MCP server.
fledge start
# Standard MCP server
python mcp_server.py
# Secure MCP server (requires API key generation on first run)
python secure_mcp_server.pyStep 3: Verify the server is running by checking the health endpoint.
curl http://localhost:8082/healthTo connect Cursor to the MCP server, point Cursor to the tools endpoint at the server’s address and upload the provided tools configuration, or use the local path to the tools file.
If you enable the secure server, you will need to supply the API key from the generated api_key.txt in the X-API-Key header for protected endpoints. The health endpoint remains accessible without authentication.
The server implements a JSON-RPC over WebSocket interface and provides a range of tools for data access, service control, UI generation, real-time subscriptions, validation, documentation, and AI-assisted features. You can update tools by modifying the tools.json file and restarting the server if needed.
Check if the Fledge API is reachable and responsive by performing a lightweight health-like check against the Fledge API.
Fetch sensor data from Fledge with optional filtering by time range and limit to control data retrieval needs.
Return a list of all sensors available in the Fledge instance.
Ingest test data into Fledge, with optional batch count to simulate data flow.
Query the status of all running Fledge services to monitor health and uptime.
Start or stop a specific Fledge service by its type to manage operations.
Update configuration parameters within Fledge to adjust behavior or performance.
Generate frontend UI components for visualizing Fledge data, enabling rapid dashboards.
Retrieve sample frontend templates for common frameworks to accelerate UI development.
Provide AI-powered suggestions to improve UI code and data visualization.
Create a subscription to receive real-time updates from a specified sensor.
Fetch the most recent reading from a specific sensor for quick status checks.
Test API requests with different methods and payloads to validate endpoints.
Get information about available Fledge API endpoints to guide integration.
List available Fledge plugins to understand extended capabilities.
Produce realistic mock sensor data for testing and UI demos.