Sponsored by Deepsite.site

OptimEngine - Operations Scheduling & Routing Solver

Created By
MicheleCampi25 days ago
Solves Flexible Job Shop Scheduling (FJSP) and Capacitated Vehicle Routing with Time Windows (CVRPTW) using Google OR-Tools. MCP-native for AI agents. 5 tools: optimize_schedule, validate_schedule, optimize_routing, health_check, root.
Overview

⚡ OptimEngine — Operations Intelligence Solver

The first MCP Server for production scheduling, vehicle routing, and bin packing optimization.

An AI-native solver that assigns tasks to machines, deliveries to vehicles, and items to bins optimally using constraint programming. Built for the agentic economy: AI agents discover it, call it, and pay for it — autonomously.

MCP Compatible OR-Tools Python 3.12+ Tests License: MIT


What It Does

OptimEngine solves three families of NP-hard optimization problems that LLMs cannot compute:

1. Scheduling — Flexible Job Shop (FJSP)

Assign tasks to machines optimally with precedence, time windows, machine eligibility, setup times, priorities, and multiple objectives.

2. Routing — CVRPTW

Assign delivery locations to vehicles optimally with capacity constraints, time windows, service times, GPS coordinates, and multiple objectives.

3. Bin Packing

Assign items to bins/containers optimally with weight/volume constraints, item quantities, group constraints, and multiple objectives.

The core insight: LLMs understand optimization requests in natural language but cannot compute optimal solutions. These are NP-hard problems that require specialized solvers. OptimEngine is that solver, exposed as MCP tools that any AI agent can call.


MCP Tools

ToolProblemInputOutput
optimize_scheduleFlexible Job Shop SchedulingJobs, tasks, machines, constraintsOptimal schedule + Gantt + metrics
validate_scheduleSchedule verificationSchedule + constraintsViolations + suggestions
optimize_routingVehicle Routing + Time WindowsDepot, locations, vehicles, capacityOptimal routes + stop times + metrics
optimize_packingBin PackingItems (weight/volume), bins (capacity)Optimal assignments + bin summaries + metrics

Scheduling Capabilities

FeatureDetails
Flexible Job ShopTasks can run on multiple eligible machines
PrecedenceTasks within a job execute in defined order
Time WindowsEarliest start, latest end per job
Machine AvailabilityMachines have operational windows
Setup TimesPer-task setup time before processing
PrioritiesJob priority (1-10) for weighted objectives
4 ObjectivesMinimize makespan, total/max tardiness, balance load
Schedule ValidationVerify existing schedules, get violation reports
Gantt DataReady-to-render visualization in every response

Routing Capabilities

FeatureDetails
Capacity ConstraintsPer-vehicle maximum load
Time WindowsEarliest/latest arrival per location
Service TimesTime spent at each delivery point
GPS CoordinatesHaversine distance from lat/lon
Custom Distance MatrixOverride with your own distances/times
Drop VisitsSkip infeasible locations with penalty
Per-Vehicle LimitsMax travel time/distance per vehicle
4 ObjectivesMinimize distance, time, vehicles, or balance routes

Packing Capabilities

FeatureDetails
Weight + VolumeDual-dimension capacity constraints
Item QuantitiesPack N copies of an item type
Bin TypesMultiple bin sizes with different costs
Group ConstraintsKeep related items in the same bin
Max Items per BinLimit number of items per container
Partial PackingAllow unpacked items for over-constrained problems
4 ObjectivesMinimize bins, maximize value/items, balance load

Quick Start

1. Install & Run

git clone https://github.com/MicheleCampi/optim-engine.git
cd optim-engine
pip install -r requirements.txt
uvicorn api.server:app --host 0.0.0.0 --port 8000

Server starts at http://localhost:8000. Docs at /docs. MCP endpoint at /mcp.

2. Connect via MCP (Claude Desktop, Cursor, etc.)

{
  "mcpServers": {
    "optim-engine": {
      "command": "mcp-proxy",
      "args": ["https://optim-engine-production.up.railway.app/mcp"]
    }
  }
}

Example — Scheduling

curl -X POST https://optim-engine-production.up.railway.app/optimize_schedule \
  -H "Content-Type: application/json" \
  -d '{
    "jobs": [
      {"job_id": "J1", "tasks": [
        {"task_id": "cut", "duration": 3, "eligible_machines": ["M1", "M2"]},
        {"task_id": "weld", "duration": 2, "eligible_machines": ["M2"]}
      ], "due_date": 10},
      {"job_id": "J2", "tasks": [
        {"task_id": "cut", "duration": 4, "eligible_machines": ["M1"]},
        {"task_id": "weld", "duration": 3, "eligible_machines": ["M2"]}
      ], "due_date": 12}
    ],
    "machines": [{"machine_id": "M1"}, {"machine_id": "M2"}],
    "objective": "minimize_makespan"
  }'

Example — Routing

curl -X POST https://optim-engine-production.up.railway.app/optimize_routing \
  -H "Content-Type: application/json" \
  -d '{
    "depot_id": "warehouse",
    "locations": [
      {"location_id": "warehouse", "demand": 0},
      {"location_id": "customer_A", "demand": 20, "time_window_end": 3000, "service_time": 10},
      {"location_id": "customer_B", "demand": 15, "time_window_end": 4000, "service_time": 10},
      {"location_id": "customer_C", "demand": 25, "time_window_end": 5000, "service_time": 15}
    ],
    "vehicles": [
      {"vehicle_id": "truck_1", "capacity": 40},
      {"vehicle_id": "truck_2", "capacity": 40}
    ],
    "distance_matrix": [
      {"from_id": "warehouse", "to_id": "customer_A", "distance": 500, "travel_time": 500},
      {"from_id": "warehouse", "to_id": "customer_B", "distance": 800, "travel_time": 800},
      {"from_id": "warehouse", "to_id": "customer_C", "distance": 600, "travel_time": 600},
      {"from_id": "customer_A", "to_id": "warehouse", "distance": 500, "travel_time": 500},
      {"from_id": "customer_A", "to_id": "customer_B", "distance": 400, "travel_time": 400},
      {"from_id": "customer_A", "to_id": "customer_C", "distance": 700, "travel_time": 700},
      {"from_id": "customer_B", "to_id": "warehouse", "distance": 800, "travel_time": 800},
      {"from_id": "customer_B", "to_id": "customer_A", "distance": 400, "travel_time": 400},
      {"from_id": "customer_B", "to_id": "customer_C", "distance": 300, "travel_time": 300},
      {"from_id": "customer_C", "to_id": "warehouse", "distance": 600, "travel_time": 600},
      {"from_id": "customer_C", "to_id": "customer_A", "distance": 700, "travel_time": 700},
      {"from_id": "customer_C", "to_id": "customer_B", "distance": 300, "travel_time": 300}
    ],
    "objective": "minimize_total_distance"
  }'

Example — Bin Packing

curl -X POST https://optim-engine-production.up.railway.app/optimize_packing \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {"item_id": "laptop", "weight": 3, "volume": 8, "value": 1200, "quantity": 10},
      {"item_id": "monitor", "weight": 8, "volume": 25, "value": 500, "quantity": 5},
      {"item_id": "keyboard", "weight": 1, "volume": 3, "value": 80, "quantity": 20}
    ],
    "bins": [
      {"bin_id": "small_box", "weight_capacity": 20, "volume_capacity": 50, "cost": 5, "quantity": 5},
      {"bin_id": "large_box", "weight_capacity": 50, "volume_capacity": 120, "cost": 12, "quantity": 3}
    ],
    "objective": "minimize_bins"
  }'

Use Cases

  • Manufacturing: Production scheduling for contract manufacturing (cosmetics, pharma, food)
  • Logistics: Last-mile delivery routing with time windows and capacity
  • Warehouse: Bin packing for palletization, container loading, order fulfillment
  • Cloud/IT: Resource allocation (VMs to servers, jobs to clusters)
  • Food Delivery: Multi-driver route optimization
  • Supply Chain: End-to-end scheduling + routing + packing

Architecture

AI Agent (Claude, GPT, Gemini, etc.)
    ▼ MCP Protocol
┌────────────────────────────────────────┐
│  FastAPI + fastapi-mcp                  │  ← API layer
├────────────┬────────────┬──────────────┤
│ Scheduling │  Routing   │  Bin Packing │
│ CP-SAT     │  Routing   │  CP-SAT      │
│            │  Library   │              │  ← OR-Tools solvers
├────────────┴────────────┴──────────────┤
│  Pydantic Models                        │  ← Schema contract
└────────────────────────────────────────┘

Stack: Python 3.12 · FastAPI · OR-Tools (CP-SAT + Routing) · fastapi-mcp · Pydantic v2


Tests

pip install pytest
python -m pytest tests/ -v

97 tests covering: flexible job shop, time windows, due dates, machine availability, setup times, CVRPTW routing, capacity, GPS distances, bin packing, weight/volume constraints, group constraints, partial packing, and realistic manufacturing/delivery/warehouse scenarios.


Landing Page

🌐 optim-engine.vercel.app

Marketplace Listings


License

MIT


Built with Google OR-Tools — the optimization toolkit used by Google for fleet routing, scheduling, and resource allocation at scale.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.