LabOps Agent MCP Server
Provides tools to update Slack Canvas with inventory information, manage lab inventory, forecasts, and orders directly from Slack.
Click on "Install 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., "@LabOps Agent MCP Servercheck TSH reagent inventory and forecast"
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.
LabOps Agent π¬
Slack Agent for Good β Slack Agent Builder Challenge 2026 (Salesforce/Devpost)
Predict. Alert. Act. All from Slack.
LabOps Agent is a Slack-native AI agent that predicts reagent stockouts in clinical laboratories before they happen, based on historical demand patterns by test type β and enables lab staff to act directly from Slack without switching to external LIMS systems.
The Problem
Clinical laboratories run on reagents. When a critical reagent runs out mid-operation, testing stops. Current solutions (Quartzy, Scispot) only send passive threshold alerts after stock is already low. No product today predicts stockouts based on test-type demand patterns.
Example: TSH demand spikes every autumn in Argentina (MarβMay, 2.5x ratio). A lab with 680 units, at a projected demand of ~147 units/day, runs out in ~6 days β inside the 7-day reorder window. Without prediction, they find out when the analyzer throws an error.
Related MCP server: MCP Slack Python
What LabOps Agent Does
Predicts stockouts using Prophet, calibrated with patterns derived from anonymized demand analysis in Argentine clinical labs
Alerts lab staff in
#labops-alertswith interactive Block Kit messages β before the stockout happensActs β staff orders reagents, assigns tasks, and updates inventory without leaving Slack
Why LabOps Agent is Different
No existing product (Quartzy, Scispot, Benchling) combines:
Prediction by test type β TSH spikes in autumn (MarβMay), Hemograma is stable; each reagent gets its own Prophet model
Native Slack agent β not a webhook or Zapier bridge; Bolt Python with Socket Mode, interactive Block Kit buttons, and modals
Domain expertise β built by someone with 4 years of B2B KAM experience in clinical diagnostics (Argentina), not a generic inventory template
Technologies Used
Technology | How It's Used | Platform |
MCP Server | Exposes 4 lab tools: | Anthropic/Slack |
Claude Tool-Use Agent | LLM selects and invokes MCP tools via | Anthropic |
Slack Channel History API | Queries #labops-alerts message history for past reagent incidents (works with the bot token) | Slack |
Claude API Summarization | Generates natural language summaries of reagent alert history | Anthropic |
Design decision note:
search.messages(Slack Search API) was evaluated but replaced byconversations_replies(Channel History API) for thread history retrieval.search.messagesrequires a workspace user token (xoxp-) which is not available in standard bot-token deployments; the bot token returns empty results. Thread-scoped history viaconversations_repliesprovides the relevant alert context without requiring a user token.
MCP Server
LabOps Agent exposes a real MCP Server using the official Anthropic MCP Python SDK:
# Run MCP Server (stdio transport)
cd backend
python mcp_server.pyTools available:
get_inventoryβ Query current reagent stockget_forecastβ Prophet demand forecastcreate_orderβ Create reagent orderupdate_canvasβ Update inventory Canvas
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SLACK WORKSPACE β
β #labops-alerts β Canvas Inventario β App Home β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β Bolt Python (Socket Mode)
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β FASTAPI BACKEND β
β βββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β MCP SERVER β β PREDICTION ENGINE β β
β β get_inventory β β Prophet + seasonality β β
β β get_forecast β β params from 414K B2B β β
β β create_order β β CV MAPE 8-11% (synth) β β
β β update_canvas β ββββββββββββββββββββββββββββ β
β βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββ
β SUPABASE β
β inventory β demand_history β orders β alerts_log β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββ
β CLAUDE API β
β Natural language explanations of predictions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββDemo Flow (3 minutes)
0:00β0:45 β Agent detects TSH will run out in ~6 days (demand forecast exceeds stock)
0:45β1:30 β Alert fires in #labops-alerts with Block Kit buttons:
π Ver proyecciΓ³n
π Ordenar reactivo
π€ Asignar al equipo
1:30β2:15 β User clicks "Ordenar reactivo" β modal opens β one click confirms β Canvas auto-updates
2:15β3:00 β Agent explains WHY TSH is at risk (seasonal demand pattern) β Claude API summarizes past incidents
Try it Live
Demo video (β€3 min): Watch on YouTube β full demo with voiceover narration. Live deploy:
https://labops-agent.onrender.com(Render persistent host β Socket Mode + FastAPI co-hosted) Sandbox workspace:https://labopsespacio.slack.com(invite-only sandbox).
Reproduce the live deploy (judge-reachable, chart renders)
Slack fetches forecast-chart images from its own servers, so the backend must be reachable over public HTTPS. Socket Mode also needs a persistent host, so this deploys to Render/Railway/Fly β not Vercel serverless (see Deployment).
Join the Slack Developer Program and create a Developer Sandbox workspace.
Create a new app from
slack-manifest.json, install it, and copy the Bot + App tokens.Deploy with the included
render.yamlblueprint (one persistent web service hosts both the chart endpoint and the Socket Mode websocket).After the first deploy, set
BACKEND_URL=https://labops-agent.onrender.com(or your service URL) and redeploy so the forecast chart renders in Slack.
Local + tunnel (for recording the demo on your machine):
docker-compose up --build # backend + slack client + DB
cloudflared tunnel --url http://localhost:8000 # public HTTPS for the chart
# set BACKEND_URL=https://<random>.trycloudflare.com in .env, restart slack_clientWithout a public BACKEND_URL, the forecast still shows as native Block Kit
fields β the chart image is simply omitted, never broken.
Setup Instructions
Prerequisites
Python 3.11+
Supabase account
Slack Developer Sandbox (via Slack Developer Program)
Anthropic API key
1. Clone and install
git clone https://github.com/Marianooss/labops-agent
cd labops-agent
pip install -r requirements.txt2. Configure environment
cp .env.example .env
# Fill in your keys:
# SUPABASE_URL, SUPABASE_KEY
# SLACK_BOT_TOKEN, SLACK_APP_TOKEN, SLACK_SIGNING_SECRET
# SLACK_USER_TOKEN (optional β only for Slack Search API, not used in current implementation)
# ANTHROPIC_API_KEY
# LABOPS_ALERTS_CHANNEL=#labops-alerts3. Set up Supabase
# Run in Supabase SQL Editor:
# 1. data/create_tables.sql
# 2. data/seed_data.sql4. Create Slack App (from manifest)
Go to api.slack.com/apps β Create New App
Select From an app manifest
Choose your Developer Sandbox workspace
Paste the contents of
slack-manifest.jsonClick Create
Go to OAuth & Permissions β Install to Workspace
Copy the Bot User OAuth Token and App-Level Token into your
.env
Manifest includes all required scopes: chat:write, channels:read, channels:history, groups:read, groups:history, im:write, users:read, app_mentions:read, canvases:read, canvases:write.
5. One-Click Docker Setup (recommended for judges)
# Clone and start everything (PostgreSQL + backend + slack client + auto-seed)
git clone https://github.com/Marianooss/labops-agent
cd labops-agent
docker-compose up --build
# Wait ~30s for DB init, then test:
curl "http://localhost:8000/alert/trigger?reagent_name=TSH"This runs the full stack locally without needing a cloud Supabase account:
dbβ PostgreSQL with auto-created schema and seed databackendβ FastAPI on http://localhost:8000slack_clientβ Bolt Python Socket Mode (waits gracefully if Slack tokens are missing)
To enable Slack integration, copy
.env.exampleto.envand fill inSLACK_BOT_TOKEN,SLACK_APP_TOKEN, andSLACK_SIGNING_SECRETbefore runningdocker-compose up.
6. Local Setup without Docker (one-script)
# Single command β starts backend + Slack client + seeds DB
python scripts/start_local.pyOr manually in separate terminals:
# Terminal 1: FastAPI backend
cd backend && uvicorn main:app --reload --port 8000
# Terminal 2: Slack agent
cd backend && python slack_client.pyNote: Backend commands must be run from the
backend/directory because modules use relative imports.
Deployment (Render / Railway / Fly)
Why not Vercel? The agent uses Slack Socket Mode, which holds a persistent
websocket. Vercel serverless functions are short-lived and cannot keep that
connection open. (If you must use Vercel, you would have to switch to HTTP Events
mode and expose /slack/events β a different integration path this repo does not
use.) Instead, deploy to a persistent host.
The included render.yaml provisions one web service that hosts
both:
the FastAPI HTTP app (serves the public
/chart/forecast/{reagent}PNG that Slack image blocks fetch β needs public HTTPS), andthe Socket Mode websocket, started in a background thread via
RUN_SOCKET_MODE=1(seebackend/main.pystartup).
Render β New β Blueprint β select this repo β fill the secret env vars
β after first deploy, set `BACKEND_URL=https://labops-agent.onrender.com` β redeployRailway and Fly.io work identically with the same Dockerfile
(it honors the host-injected $PORT).
Project Structure
labops-agent/
βββ backend/
β βββ main.py # FastAPI entry point
β βββ mcp_server.py # MCP tools (4 lab tools)
β βββ prediction.py # Prophet demand forecasting
β βββ slack_client.py # Bolt Python + event handlers
β βββ database.py # Dual backend: Supabase or PostgreSQL
β βββ claude_client.py # Claude API wrapper
β βββ blocks_loader.py # Block Kit / Canvas template loader
βββ blocks/
β βββ alert.json # Stockout alert Block Kit template
β βββ modal_order.json # Order reagent modal template
β βββ canvas.json # Inventory canvas template
βββ data/
β βββ create_tables.sql # Database schema
β βββ seed_data.sql # Demo data (DEMO badge)
βββ docs/
β βββ architecture.md # Technical architecture
β βββ impact.md # Impact metrics
β βββ demo_script.md # 3-minute demo script
βββ scripts/
β βββ init_db.py # Auto-seed PostgreSQL on Docker startup
β βββ start_local.py # One-script local startup (backend + slack + seed)
β βββ holdout_backtest.py # Monthly hold-out backtest (illustrative)
β βββ cross_validation.py # Rolling-origin CV (headline accuracy metric)
βββ notebooks/
β βββ cv_metrics.json # Rolling-origin CV results (real, reproducible)
β βββ holdout_metrics.json # Monthly hold-out results (caveated)
β βββ prophet_metrics.json # Consolidated metrics summary
βββ tests/
β βββ test_mcp.py # MCP tool unit tests
β βββ test_prediction.py # Prophet engine tests
β βββ test_integration.py # Bolt handler integration tests
βββ models/ # Prophet serialized models (.pkl)
βββ render.yaml # Render Blueprint (persistent host + Socket Mode)
βββ docker-compose.yml # One-click local stack
βββ Dockerfile # Backend container
βββ LICENSE # MIT License
βββ AGENTS.md # Development operating system
βββ BIBLE.md # Immutable declarations
βββ CLAUDE.md # Claude Code instructionsUiPath Components Used
None β this project uses Slack platform APIs (Channel History API, Canvas API) for messaging and surfaces, Anthropic MCP Server for tool exposure, and Claude API for natural language generation.
Demo Screenshots
Extracted from the final demo video (YouTube).
Block Kit Alert
Real-time Block Kit alert fired when Prophet predicts a stockout within the reorder lead time window.
Order Modal
Pre-filled order modal with model-suggested quantity and supplier dropdown β one click creates the order in Supabase.
Demand Forecast Chart
Prophet-generated forecast chart with 80% confidence interval, rendered live and embedded in the Slack thread.
Canvas Update
Inventory Canvas updates in real time after an order is confirmed.
Verified numbers from live deploy:
TSH demand: ~144 u/dΓa (hΓ‘bil), ~79 u/dΓa (fin de semana) β Prophet forecast, output real
/alert/trigger, out-of-peak (Jul-Sep)Stockout projection: 6 dΓas con 680 u stock (projected_stockout_date: 2026-07-08)
Forecast chart: renders from
https://labops-agent.onrender.com/chart/forecast/TSHCanvas: persists via
lab_configtable in Supabase
Data & Privacy
All data in this project is synthetic and clearly labeled with DEMO badges. No real patient data, no PHI. The prediction model's seasonal parameters (peak months, peak/trough ratios per test type) were derived from analysis of 414,289 real B2B demand records (Labmedicina, 2025-2026, anonymized β raw data not included, see data/DATASET_PROVENANCE.md); Prophet trains on a synthetic daily series encoding those parameters. Reported CV metrics (MAPE ~8-11%) are a synthetic-benchmark validation of the pipeline, not a real-consumption accuracy claim β see docs/architecture.md.
License
MIT License β see LICENSE
Builder
Mariano Adrian Oss Β· DevelopOss Β· Buenos Aires, Argentina
B2B KAM in clinical diagnostics (4 years) + AI Builder. This project applies real insider knowledge of clinical laboratory operations to a problem that existing software hasn't solved: uninterrupted diagnostic access for vulnerable patients inside the tools labs already use daily.
LabOps Agent Β· Slack Agent Builder Challenge 2026 Β· Track: Slack Agent for Good
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.
Latest Blog Posts
- 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/Marianooss/Labops-Agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server