LineSight
Enables AI assistants to analyze plant-floor data using OEE, Pareto, SPC, and yield-loss calculations, providing continuous-improvement insights from manufacturing data.
README
LineSight
An MCP server that turns plant-floor data into continuous-improvement insight.
LineSight gives an AI assistant the same toolkit a CI engineer carries onto the shop floor — OEE math, downtime Pareto analysis, SPC control charts, and yield-loss dollars — exposed through Anthropic's Model Context Protocol. Ask it "why is line-3 slowing down?" and it doesn't guess: it pulls the control chart, finds the Western Electric violations, checks the downtime log, and answers with evidence.
Built by a CI/OE practitioner (marcoaguzmanjr.com) to bring the DMAIC discipline of the factory floor to AI tooling: every number the model reports traces back to a formula in plant/analytics.py.
What you can ask it
> /daily_huddle line-1 # 3-minute tier-1 meeting brief, built from live data
> /dmaic line-2 # full Define-Measure-Analyze-Improve-Control investigation
> /a3_report line-3 # one-page A3 problem-solving report
> why is @line-3 slowing down? # @-mention a line to inject its KPI snapshot
> which shift on line-2 has the quality problem, and what is it costing us per year?
The kind of exchange this produces (every number below is what the tools actually return on the demo dataset):
You: which shift on line-2 has the quality problem?
Claude: (calls
get_oeewithline_id=line-2, group_by=shift) Shift C. Its quality rate is 96.8% vs ~98.8% on shifts A and B — roughly 3× the scrap. (callsget_yield_loss) At standard cost that's about $480K annualized across the line, with shift C driving the majority. Worth checking what's different on C: staffing, changeover timing, or equipment settings that drift outside day-shift support hours.
The three MCP primitives, applied
| Primitive | What LineSight exposes |
|---|---|
| Tools (model-controlled) | get_oee · pareto_downtime · spc_analysis · get_yield_loss · log_action · list_actions · close_action |
| Resources (app-controlled) | plant://overview · plant://lines · plant://lines/{id} KPI snapshots · plant://reason-codes |
| Prompts (user-controlled) | /daily_huddle · /dmaic · /a3_report |
The split matters: analysis lives in tools so the model can chain them freely; context the user chooses to bring in (an @-mentioned line) comes from resources; and multi-step CI rituals with a defined shape (a DMAIC, an A3) ship as prompts so they run the same way every time.
flowchart LR
U[You] --> CLI[Chat CLI<br/>prompt-toolkit]
CLI --> C[Claude<br/>Anthropic API]
C <-->|MCP stdio| S[LineSight MCP server<br/>FastMCP]
S --> A[analytics.py<br/>OEE · Pareto · SPC · yield $]
A --> D[(production_log.csv<br/>downtime_log.csv)]
S --> R[(action_register.json)]
The demo dataset tells a story
data/ holds 90 days of seeded, reproducible shift-level records for a
three-line condiment plant (810 production records, ~2,300 downtime events).
Three problems are hidden in it — the same patterns you'd hunt for in a real
plant:
- line-2 bleeds availability to changeovers — one reason code carries ~52% of all downtime minutes. A Pareto finds it instantly.
- line-2, shift C has a quality problem — scrap runs ~3× the other shifts (cap-seal torque drift). Invisible in the line-level average; obvious the moment you group by shift.
- line-3 is degrading, not broken — filler-head bearing wear drags performance down over the final three weeks. No single bad day; the SPC chart catches the run below center line and the cascade of below-LCL points that a "top losses yesterday" report would miss.
Regenerate identical data anytime: python -m plant.data_gen (seeded).
Quick start
Requires Python 3.10+ and an Anthropic API key.
git clone https://github.com/marcoaguzman/linesight.git && cd linesight
python3 -m venv .venv && source .venv/bin/activate
pip install "anthropic>=0.51.0" "mcp[cli]>=1.8.0" "prompt-toolkit>=3.0.51" "python-dotenv>=1.1.0"
cp .env.example .env # then add your ANTHROPIC_API_KEY
python main.py
Or with uv: uv sync, set USE_UV=1 in .env,
then uv run main.py.
Verify without an API key
The smoke test drives every tool, resource, and prompt over a real MCP stdio connection — no Anthropic key needed:
python scripts/smoke_test.py # 18 checks, should all PASS
Use it from Claude Desktop instead
LineSight is a standard MCP server, so any MCP client can host it. For Claude
Desktop, add to claude_desktop_config.json:
{
"mcpServers": {
"linesight": {
"command": "/absolute/path/to/linesight/.venv/bin/python",
"args": ["/absolute/path/to/linesight/mcp_server.py"]
}
}
}
Project structure
linesight/
├── mcp_server.py # the MCP server: 7 tools, 4 resources, 3 prompts
├── mcp_client.py # generic MCP stdio client
├── main.py # chat CLI entry point
├── core/ # chat loop, Claude wrapper, tool dispatch, terminal UI
├── plant/
│ ├── analytics.py # OEE, Pareto, XmR control charts, yield-loss math
│ ├── store.py # CSV-backed data layer (swap for a historian/MES)
│ └── data_gen.py # seeded demo-data generator
├── data/ # the demo dataset (committed, reproducible)
└── scripts/smoke_test.py
Swapping the demo CSVs for a real historian or MES connection only touches
plant/store.py — the MCP surface stays identical.
Credits
The chat-client scaffolding (core/, mcp_client.py) is adapted from the
project built in Anthropic's MCP course;
the plant domain — server, analytics, dataset — is original work.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。