Skip to main content
Glama
gigimento

OEE Enterprise Agent

by gigimento
README.md
# OEE Enterprise Agent

MCP-based production monitoring agent for manufacturing OEE (Overall Equipment Effectiveness). Connects to SQL Server, MES APIs, and incident management systems.

## Overview

This agent provides real-time OEE monitoring (Availability, Performance, Quality), downtime root-cause analysis, shift performance benchmarking, and automated alerts when thresholds are breached.

## Architecture

```
SQL MCP Server  ──┐
MES REST API    ──┼──►  OEE Enterprise Agent  ──►  Teams Alerts
Incident Mgmt   ──┘                              ──►  Jira/ServiceNow
```

## Quick Start

```bash
npm install
npm run init        # Initialize SQLite database
npm run populate    # Generate sample test data
npm run query:7day  # Show 7-day OEE report
npm run query:kpi   # Show real-time KPI dashboard
```

## Scripts

| Script | Description |
|--------|-------------|
| `init` | Create SQLite database with schema |
| `populate` | Generate 7 days of test data |
| `query:7day` | Daily OEE report for last 7 days |
| `query:kpi` | KPI status dashboard |
| `connect:sqlserver` | Connect to SQL Server (requires env config) |

## Tools

- `query_daily_oee` — OEE metrics by line/date/shift
- `get_downtime_analysis` — Downtime RCA grouped by reason
- `send_alert` — Send Teams alert to engineers
- `create_ticket` — Create Jira/ServiceNow incident
- `call_mes_api` — Fetch machine alarms and line status
- `notify_shift_lead` — Send shift summary

## Configuration

Copy `.env.example` to `.env` and configure:

```env
SQL_SERVER=localhost\SQLEXPRESS
SQL_DATABASE=OEE_PROD
```

## Data Source

By default, the agent uses a local JSON-based store (`oee-production.db.json`). For production, configure the SQL MCP server to connect to your SQL Server instance.

## License

MIT