mcp-optimizer

v0.4.1
mcp-optimizer Checked 14 hours ago Published 1 year ago

Mathematical optimization MCP server with PuLP and OR-Tools support

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

solve_linear_program_tool Solve Linear Program Tool

Solve a linear programming problem using PuLP. This tool solves general linear programming problems where you want to optimize a linear objective function subject to linear constraints. Use cases: - Resource allocation: Distribute limited resources optimally - Diet planning: Create nutritionally balanced meal plans within budget - Manufacturing mix: Determine optimal product mix to maximize profit - Investment planning: Allocate capital across different investment options - Supply chain optimization: Minimize transportation and storage costs - Energy optimization: Optimize power generation a…

ParameterTypeDescription
constraints *arrayList of constraints, each with 'expression' (coefficients), 'operator' ("<=", ">=", "=="), and 'rhs' (right-hand side value)
objective *objectObjective function with 'sense' ("minimize" or "maximize") and 'coefficients' (dict mapping variable names to coefficients)
variables *objectVariable definitions mapping variable names to their properties (type: "continuous"/"integer"/"binary", lower: bound, upper: bound)
solverstringSolver to use ("CBC", "GLPK", "GUROBI", "CPLEX")
time_limit_secondsMaximum time to spend solving (optional)

solve_integer_program_tool Solve Integer Program Tool

Solve an integer or mixed-integer programming problem using PuLP. This tool solves optimization problems where some or all variables must take integer values, which is useful for discrete decision problems. Use cases: - Facility location: Decide where to build warehouses or service centers - Project selection: Choose which projects to fund (binary decisions) - Crew scheduling: Assign integer numbers of staff to shifts - Network design: Design networks with discrete components - Cutting stock: Minimize waste when cutting materials - Capital budgeting: Select investments when partial investmen…

ParameterTypeDescription
constraints *arrayList of linear constraints
objective *objectObjective function with 'sense' and 'coefficients'
variables *objectVariable definitions with types "continuous", "integer", or "binary"
solverstringSolver to use ("CBC", "GLPK", "GUROBI", "CPLEX")
time_limit_secondsMaximum time to spend solving (optional)

solve_mixed_integer_program Solve Mixed Integer Program

Solve Mixed-Integer Programming (MIP) problems with integer, binary, and continuous variables.

ParameterTypeDescription
constraints *arrayList of constraint definitions with coefficients and bounds
objective *objectObjective function definition with coefficients and direction
variables *arrayList of variable definitions with bounds and types
solver_namestringSolver to use ("SCIP", "CBC", "GUROBI", "CPLEX")
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

solve_assignment_problem_tool Solve Assignment Problem Tool

Solve assignment problem using OR-Tools Hungarian algorithm.

ParameterTypeDescription
costs *array2D cost matrix where costs[i][j] is cost of assigning worker i to task j
tasks *arrayList of task names
workers *arrayList of worker names
max_tasks_per_workerMaximum tasks per worker (optional)
maximizebooleanWhether to maximize instead of minimize (default: False)
min_tasks_per_workerMinimum tasks per worker (optional)

solve_transportation_problem_tool Solve Transportation Problem Tool

Solve transportation problem using OR-Tools.

ParameterTypeDescription
consumers *arrayList of consumer dictionaries with 'name' and 'demand' keys
costs *array2D cost matrix where costs[i][j] is cost of shipping from supplier i to consumer j
suppliers *arrayList of supplier dictionaries with 'name' and 'supply' keys

solve_knapsack_problem_tool Solve Knapsack Problem Tool

Solve knapsack optimization problems using OR-Tools. This tool solves knapsack problems where items need to be selected to maximize value while staying within capacity constraints. Use cases: - Cargo loading: Optimize loading of trucks, ships, or planes by weight and volume - Portfolio selection: Choose optimal set of investments within budget constraints - Resource allocation: Select projects or activities with limited budget or resources - Advertising planning: Choose optimal mix of advertising channels within budget - Menu planning: Select dishes for a restaurant menu considering costs an…

ParameterTypeDescription
capacity *numberWeight capacity constraint
items *arrayList of items, each with 'name', 'value', 'weight', and optionally 'volume', 'quantity'
knapsack_typestringType of knapsack problem ('0-1', 'bounded', 'unbounded')
max_items_per_typeMaximum items per type for bounded knapsack
volume_capacityVolume capacity constraint (optional)

solve_traveling_salesman_problem Solve Traveling Salesman Problem

Solve Traveling Salesman Problem (TSP) to find the shortest route visiting all locations.

ParameterTypeDescription
locations *arrayList of location dictionaries with name and coordinates
distance_matrixOptional pre-calculated distance matrix
return_to_startbooleanWhether to return to starting location (default: True)
start_locationintegerIndex of starting location (default: 0)
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

solve_vehicle_routing_problem Solve Vehicle Routing Problem

Solve Vehicle Routing Problem (VRP) to optimize routes for multiple vehicles.

ParameterTypeDescription
locations *arrayList of location dictionaries with name, coordinates, and demand
vehicles *arrayList of vehicle dictionaries with capacity constraints
depotintegerIndex of depot location (default: 0)
distance_matrixOptional pre-calculated distance matrix
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)
time_matrixOptional pre-calculated time matrix

solve_job_shop_scheduling Solve Job Shop Scheduling

Solve Job Shop Scheduling Problem to optimize machine utilization and completion times.

ParameterTypeDescription
horizon *integerMaximum time horizon for scheduling
jobs *arrayList of job dictionaries with tasks and constraints
machines *arrayList of available machine names
objectivestringOptimization objective ("makespan" or "total_completion_time")
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

solve_employee_shift_scheduling Solve Employee Shift Scheduling

Solve Employee Shift Scheduling to assign employees to shifts optimally.

ParameterTypeDescription
days *integerNumber of days to schedule
employees *arrayList of employee names
shifts *arrayList of shift dictionaries with time and requirements
employee_constraintsOptional constraints and preferences per employee
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

optimize_portfolio_tool Optimize Portfolio Tool

Optimize portfolio allocation to maximize return or minimize risk.

ParameterTypeDescription
assets *arrayList of asset dictionaries with expected return, risk, and sector
budgetnumberTotal budget to allocate (default: 1.0)
max_allocationnumberMaximum allocation per asset (default: 1.0)
min_allocationnumberMinimum allocation per asset (default: 0.0)
objectivestringOptimization objective ("maximize_return", "minimize_risk", "maximize_sharpe", "risk_parity")
risk_toleranceMaximum acceptable portfolio risk (optional)
sector_constraintsMaximum allocation per sector (optional)
solver_namestringSolver to use ("CBC", "GLPK", "GUROBI", "CPLEX")
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

optimize_production_plan_tool Optimize Production Plan Tool

Optimize multi-period production planning to maximize profit or minimize costs.

ParameterTypeDescription
demand *arrayList of demand requirements per product per period
periods *integerNumber of planning periods
products *arrayList of product dictionaries with costs and resource requirements
resources *arrayList of resource dictionaries with capacity constraints
inventory_costsOptional inventory holding costs per product
objectivestringOptimization objective ("maximize_profit", "minimize_cost", "minimize_time")
setup_costsOptional setup costs per product
solver_namestringSolver to use ("CBC", "GLPK", "GUROBI", "CPLEX")
time_limit_secondsnumberMaximum solving time in seconds (default: 30.0)

validate_optimization_input Validate Optimization Input

Validate input data for optimization problems.

ParameterTypeDescription
input_data *objectInput data to validate
problem_type *stringType of optimization problem