machine-maintenance-agent
Machine Maintenance Agent: MCP 面试项目
这是一个小型、可直接用于面试的项目,演示了代理如何使用 MCP 工具检查工业机器数据、搜索维护指南,并在需要升级处理时创建维护工单。
示例场景:
"机器 P-204 振动异常。我该怎么办?"
代理会检查模拟的机器状态、查看最近的传感器异常、搜索维护手册数据集,并可选地创建工单。
为什么这是一个很好的 MCP 示例
MCP 在这里很有用,因为代理不需要直接访问数据库或文件。相反,它获得一个受控的工具接口:
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)
这让你可以在一个小项目中解释只读数据访问、安全的写入访问、工具边界以及多步骤代理行为。
Related MCP server: Equipment Health MCP Server
项目结构
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设置
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtMCP 依赖项固定在当前稳定的 Python SDK v1 版本线上:mcp[cli]>=1.27,<2。
运行演示代理
从该文件夹运行:
python src/agent_demo.py要在演示期间创建工单:
python src/agent_demo.py --create-ticket预期行为:
读取
P-204的状态。发现振动和温度超出正常范围。
发现高严重性的振动异常。
在维护手册中搜索泵振动指南。
建议降低负载并检查轴承/联轴器区域。
仅在使用
--create-ticket时创建工单。
运行 MCP 服务器
python src/mcp_server.py这会启动一个 stdio MCP 服务器。MCP 客户端可以连接到它并调用暴露的工具。
示例 MCP 客户端配置形式:
{
"mcpServers": {
"machine-maintenance-agent": {
"command": "python",
"args": ["src/mcp_server.py"],
"cwd": "/absolute/path/to/machine-maintenance-agent"
}
}
}运行测试
python -m unittest discover -s tests面试讲解
使用这个简短的解释:
"我围绕一个模拟维护系统构建了一个 MCP 服务器。代理不能自由查询文件或数据库。它只能获得几个工具:读取机器状态、读取异常、搜索手册以及创建维护工单。对于泵 P-204 的振动投诉,代理检查实时状态,看到振动超过阈值,发现近期高严重性异常,检索相关手册指南,并通过创建工单进行升级。这展示了受控的企业访问、基于工具的推理,以及 LLM 与运营系统之间的安全边界。"
如需更结构化的讲解,请参阅 AGENT_FLOW.md 和 TOOL_CONTRACTS.md。
此项目使用的数据
机器元数据:ID、名称、区域、关键性、正常运行范围。
机器状态:当前振动、温度、压力、状态、上次维护日期。
传感器异常:时间戳、信号、数值、阈值、严重性、描述。
维护手册:症状、关键词、建议操作、安全注意事项。
工单存储:工单 ID、机器 ID、严重性、摘要、建议操作、状态。
如何扩展它
针对作品集版本的小型后续改进:
添加一个能够动态选择工具的真实 LLM 客户端。
使用 SQLite 替代 JSON 文件。
添加基于角色的权限,例如只读操作员访问权限和工单写入主管访问权限。
添加一个显示机器状态和未结工单的简单仪表板。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to manage system updates, application installations, and remote host orchestration through MCP tools.3MIT
- FlicenseNot gradedqualityBmaintenanceAn 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 gradedqualityDmaintenanceEnables AI-powered customer support with real-time access to CRM, ticketing, and communication tools via MCP, supporting context-aware conversations and automated actions.Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to analyze IT support tickets, categorize urgency, suggest responses, and retrieve statistics via MCP tools.
Related MCP Connectors
Paid remote MCP for agent code search routing MCP, structured receipts, audit logs, and reviewer-rea
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
100+ MCP tools for AI agents: content metadata, trade intelligence, business-expertise analysis.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/deodatta1234/machine-maintenance-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server