motor-telemetry-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@motor-telemetry-mcpWhat's the condition of motor MTR-003?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Industrial Motor Telemetry — MCP Server (PoC)
A Proof of Concept that exposes an industrial motor telemetry system to an AI agent through the Model Context Protocol (MCP), while also serving a conventional FastAPI REST interface — both backed by the same async service layer.
Why this design
Concern | Where it lives | Rationale |
Data contract |
| Single source of truth, validated by Pydantic v2. |
Business logic |
| Transport-agnostic async logic; no FastAPI/MCP imports → unit-testable and reusable. |
Transports |
| MCP tool and REST endpoint both delegate to the one service coroutine — zero logic duplication. |
The MCP server (built on the official mcp SDK's MCPServer) is served over
Streamable HTTP and mounted onto the FastAPI app, so a single uvicorn
process exposes both protocols.
Related MCP server: AgentKit
Requirements
Python 3.10+
Dependencies in
requirements.txt(FastAPI, Uvicorn, Pydantic v2,mcpv2)
Run locally
cd motor-telemetry-mcp
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Start the combined REST + MCP server
uvicorn main:app --reload --port 8000MCP endpoint (Streamable HTTP):
http://localhost:8000/mcpREST docs (Swagger UI):
http://localhost:8000/docs
Try the REST API
curl http://localhost:8000/motors # list motor IDs
curl http://localhost:8000/motors/MTR-001 # NORMAL
curl http://localhost:8000/motors/MTR-003 # CRITICAL (overheating)
curl -i http://localhost:8000/motors/MTR-999 # 404 with clear detailRun the tests
pip install -r requirements-dev.txt
pytestThe suite (14 tests) covers all three layers with no network sockets:
tests/test_service.py— async domain logic (health mapping, forgiving input normalization, not-found error).tests/test_rest_api.py— FastAPI endpoints via httpx's in-process ASGI transport (200s, structured body, 404).tests/test_mcp_tool.py— MCP layer in-process: tool discovery, input schema, structured output, and the tool-error path.
Run with Docker
docker build -t motor-telemetry-mcp .
docker run --rm -p 8000:8000 motor-telemetry-mcpThe image is slim, installs deps in a cached layer, runs as a non-root
user, and ships a container HEALTHCHECK against /health.
Mock fleet
Motor ID | Temp (°C) | Vibration (mm/s) | RPM | Status |
| 62.5 | 1.8 | 1490 |
|
| 83.0 | 4.2 | 1475 |
|
| 118.4 | 11.6 | 1360 |
|
How an AI agent connects to the MCP tool
The server advertises one tool, get_motor_status_tool, and one resource,
motor://fleet. An MCP-capable agent runtime discovers and invokes it exactly
like the included client_example.py:
# In a second terminal, with the server running:
python client_example.pyConceptual flow:
Connect — the agent's MCP client opens a Streamable-HTTP session to
http://localhost:8000/mcp.Discover — it calls
list_tools()and receives the schema forget_motor_status_tool(auto-generated from the Python type hints).Invoke — when the user asks "Is motor MTR-003 healthy?", the LLM emits a tool call
get_motor_status_tool(motor_id="MTR-003").Reason — the server returns structured JSON (temperature, vibration, rpm, status). The agent reads
status: "CRITICAL"and can respond / escalate. Unknown motors return an MCP tool error result, which the agent can surface gracefully.
Wiring it into a real client (e.g. Claude Desktop / any MCP host)
Point the host at the Streamable-HTTP URL. Example host config entry:
{
"mcpServers": {
"motor-telemetry": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Project layout
motor-telemetry-mcp/
├── models.py # Pydantic models: MotorStatus, MotorHealth enum
├── telemetry_service.py # Async, transport-agnostic domain logic + mock data
├── main.py # FastAPI app + MCP server (Streamable HTTP) mounted
├── client_example.py # Demo MCP client that calls the tool
├── tests/ # pytest suite (service, REST, MCP layers)
├── Dockerfile # Slim, non-root container image
├── .dockerignore
├── pytest.ini
├── requirements.txt
├── requirements-dev.txt # test/dev dependencies
└── README.mdProduction notes (talking points)
Swap
telemetry_serviceinternals for a real historian / OPC-UA / time-series source — no transport code changes needed.stateless_http=Truekeeps the MCP transport horizontally scalable.Add auth (the
mcpSDK supports token verifiers / OAuth resource servers) and rate limiting before exposing beyond localhost.
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
- SpanlyOAuthcom.spanly
MCP observability. Query live traffic, errors, duration, and alerts from your AI agent.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Let AI agents query data and act across all your business apps via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn AI agent system that monitors manufacturing equipment health using the Model Context Protocol (MCP). Enables answering natural language questions about equipment status, maintenance, and anomalies through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceExposes enterprise KPIs, health scores, forecasting, and anomaly detection as MCP tools, resources, and prompts for use by any MCP-compatible agent.AGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables AI-assisted chiller troubleshooting by exposing MCP tools to retrieve operational data, alarms, telemetry, and service history from MongoDB Atlas, plus vector and hybrid search over knowledge bases.1MIT
- AlicenseAqualityCmaintenanceExposes digital twin device data capabilities as MCP tools, allowing MCP clients to query device status, read real-time metrics, fetch time-series data, and check alerts. Includes a simulated PLC driver with a clean interface for connecting real devices via OPC-UA, Modbus, or gateway APIs.6MIT