machine-maintenance-agent
Enables agents to inspect machine status and sensor anomalies, search maintenance guidance, and create maintenance tickets through controlled MCP tools.
README
Machine Maintenance Agent: MCP Interview Project
This is a small interview-ready project that demonstrates how an agent can use MCP tools to inspect industrial machine data, search maintenance guidance, and create a maintenance ticket when escalation is needed.
The example scenario:
"Machine P-204 is vibrating abnormally. What should I do?"
The agent checks synthetic machine status, reviews recent sensor anomalies, searches a maintenance manual dataset, and optionally creates a ticket.
Why This Is a Good MCP Example
MCP is useful here because the agent does not need direct database or file access. Instead, it receives a controlled tool interface:
get_machine_status_tool(machine_id)get_recent_sensor_anomalies_tool(machine_id, hours)search_maintenance_manual_tool(query, limit)create_maintenance_ticket_tool(machine_id, severity, summary, recommended_action)list_open_tickets_tool(machine_id)
That lets you explain read-only data access, safe write access, tool boundaries, and multi-step agent behavior in one small project.
Project Structure
machine-maintenance-agent/
data/
machines.json # Machine metadata and normal operating ranges
machine_status.json # Current synthetic sensor readings
anomalies.json # Recent detected anomalies
maintenance_manual.json # Small troubleshooting knowledge base
tickets.json # Simple local ticket store
src/
maintenance_tools.py # Core tool logic
mcp_server.py # MCP server exposing tools
agent_demo.py # Transparent agent flow demo
tests/
test_maintenance_tools.py
AGENT_FLOW.md
TOOL_CONTRACTS.md
requirements.txt
README.md
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
The MCP dependency is pinned to the current stable Python SDK v1 line: mcp[cli]>=1.27,<2.
Run the Demo Agent
From this folder:
python src/agent_demo.py
To create a ticket during the demo:
python src/agent_demo.py --create-ticket
Expected behavior:
- Reads status for
P-204. - Finds vibration and temperature outside normal range.
- Finds high-severity vibration anomaly.
- Searches the maintenance manual for pump vibration guidance.
- Recommends reducing load and inspecting the bearing/coupling area.
- Creates a ticket only if
--create-ticketis used.
Run the MCP Server
python src/mcp_server.py
This starts a stdio MCP server. MCP clients can connect to it and call the exposed tools.
Example MCP client configuration shape:
{
"mcpServers": {
"machine-maintenance-agent": {
"command": "python",
"args": ["src/mcp_server.py"],
"cwd": "/absolute/path/to/machine-maintenance-agent"
}
}
}
Run Tests
python -m unittest discover -s tests
Interview Explanation
Use this short explanation:
"I built an MCP server around a synthetic maintenance system. The agent cannot freely query files or databases. It only gets a few tools: read machine status, read anomalies, search the manual, and create a maintenance ticket. For a vibration complaint on pump P-204, the agent checks live status, sees vibration above threshold, finds recent high-severity anomalies, retrieves relevant manual guidance, and escalates by creating a ticket. This demonstrates controlled enterprise access, tool-based reasoning, and a safe boundary between the LLM and operational systems."
For a more structured walkthrough, see AGENT_FLOW.md and TOOL_CONTRACTS.md.
What Data This Project Uses
- Machine metadata: ID, name, area, criticality, normal operating ranges.
- Machine status: current vibration, temperature, pressure, state, last service date.
- Sensor anomalies: timestamp, signal, value, threshold, severity, description.
- Maintenance manual: symptoms, keywords, recommended actions, safety notes.
- Ticket store: ticket ID, machine ID, severity, summary, recommended action, status.
How to Extend It
Small follow-up improvements for a portfolio version:
- Add a real LLM client that chooses tools dynamically.
- Add SQLite instead of JSON files.
- Add role-based permissions, such as read-only operator access and ticket-write supervisor access.
- Add a simple dashboard showing machine status and open tickets.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。