mcp-optimizer
v0.4.1Mathematical 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…
| Parameter | Type | Description |
|---|---|---|
constraints * | array | List of constraints, each with 'expression' (coefficients), 'operator' ("<=", ">=", "=="), and 'rhs' (right-hand side value) |
objective * | object | Objective function with 'sense' ("minimize" or "maximize") and 'coefficients' (dict mapping variable names to coefficients) |
variables * | object | Variable definitions mapping variable names to their properties (type: "continuous"/"integer"/"binary", lower: bound, upper: bound) |
solver | string | Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX") |
time_limit_seconds | Maximum 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…
| Parameter | Type | Description |
|---|---|---|
constraints * | array | List of linear constraints |
objective * | object | Objective function with 'sense' and 'coefficients' |
variables * | object | Variable definitions with types "continuous", "integer", or "binary" |
solver | string | Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX") |
time_limit_seconds | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
constraints * | array | List of constraint definitions with coefficients and bounds |
objective * | object | Objective function definition with coefficients and direction |
variables * | array | List of variable definitions with bounds and types |
solver_name | string | Solver to use ("SCIP", "CBC", "GUROBI", "CPLEX") |
time_limit_seconds | number | Maximum solving time in seconds (default: 30.0) |
solve_assignment_problem_tool Solve Assignment Problem Tool
Solve assignment problem using OR-Tools Hungarian algorithm.
| Parameter | Type | Description |
|---|---|---|
costs * | array | 2D cost matrix where costs[i][j] is cost of assigning worker i to task j |
tasks * | array | List of task names |
workers * | array | List of worker names |
max_tasks_per_worker | Maximum tasks per worker (optional) | |
maximize | boolean | Whether to maximize instead of minimize (default: False) |
min_tasks_per_worker | Minimum tasks per worker (optional) |
solve_transportation_problem_tool Solve Transportation Problem Tool
Solve transportation problem using OR-Tools.
| Parameter | Type | Description |
|---|---|---|
consumers * | array | List of consumer dictionaries with 'name' and 'demand' keys |
costs * | array | 2D cost matrix where costs[i][j] is cost of shipping from supplier i to consumer j |
suppliers * | array | List 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…
| Parameter | Type | Description |
|---|---|---|
capacity * | number | Weight capacity constraint |
items * | array | List of items, each with 'name', 'value', 'weight', and optionally 'volume', 'quantity' |
knapsack_type | string | Type of knapsack problem ('0-1', 'bounded', 'unbounded') |
max_items_per_type | Maximum items per type for bounded knapsack | |
volume_capacity | Volume capacity constraint (optional) |
solve_traveling_salesman_problem Solve Traveling Salesman Problem
Solve Traveling Salesman Problem (TSP) to find the shortest route visiting all locations.
| Parameter | Type | Description |
|---|---|---|
locations * | array | List of location dictionaries with name and coordinates |
distance_matrix | Optional pre-calculated distance matrix | |
return_to_start | boolean | Whether to return to starting location (default: True) |
start_location | integer | Index of starting location (default: 0) |
time_limit_seconds | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
locations * | array | List of location dictionaries with name, coordinates, and demand |
vehicles * | array | List of vehicle dictionaries with capacity constraints |
depot | integer | Index of depot location (default: 0) |
distance_matrix | Optional pre-calculated distance matrix | |
time_limit_seconds | number | Maximum solving time in seconds (default: 30.0) |
time_matrix | Optional pre-calculated time matrix |
solve_job_shop_scheduling Solve Job Shop Scheduling
Solve Job Shop Scheduling Problem to optimize machine utilization and completion times.
| Parameter | Type | Description |
|---|---|---|
horizon * | integer | Maximum time horizon for scheduling |
jobs * | array | List of job dictionaries with tasks and constraints |
machines * | array | List of available machine names |
objective | string | Optimization objective ("makespan" or "total_completion_time") |
time_limit_seconds | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
days * | integer | Number of days to schedule |
employees * | array | List of employee names |
shifts * | array | List of shift dictionaries with time and requirements |
employee_constraints | Optional constraints and preferences per employee | |
time_limit_seconds | number | Maximum solving time in seconds (default: 30.0) |
optimize_portfolio_tool Optimize Portfolio Tool
Optimize portfolio allocation to maximize return or minimize risk.
| Parameter | Type | Description |
|---|---|---|
assets * | array | List of asset dictionaries with expected return, risk, and sector |
budget | number | Total budget to allocate (default: 1.0) |
max_allocation | number | Maximum allocation per asset (default: 1.0) |
min_allocation | number | Minimum allocation per asset (default: 0.0) |
objective | string | Optimization objective ("maximize_return", "minimize_risk", "maximize_sharpe", "risk_parity") |
risk_tolerance | Maximum acceptable portfolio risk (optional) | |
sector_constraints | Maximum allocation per sector (optional) | |
solver_name | string | Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX") |
time_limit_seconds | number | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
demand * | array | List of demand requirements per product per period |
periods * | integer | Number of planning periods |
products * | array | List of product dictionaries with costs and resource requirements |
resources * | array | List of resource dictionaries with capacity constraints |
inventory_costs | Optional inventory holding costs per product | |
objective | string | Optimization objective ("maximize_profit", "minimize_cost", "minimize_time") |
setup_costs | Optional setup costs per product | |
solver_name | string | Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX") |
time_limit_seconds | number | Maximum solving time in seconds (default: 30.0) |
validate_optimization_input Validate Optimization Input
Validate input data for optimization problems.
| Parameter | Type | Description |
|---|---|---|
input_data * | object | Input data to validate |
problem_type * | string | Type of optimization problem |