Skip to content
Agentmart
Submit a tool

optlens

Debug and explain LP/MILP models: why infeasible, the smallest fix, what-if and sensitivity.

Connector by jjd-lab · GitHub account verified by the MCP Registry

IndexedApache-2.0Local (stdio)
Write a review

Install

Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.

npx agentmarket install connector/jjd-lab-optlens

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Debug and explain LP/MILP models: why infeasible, the smallest fix, what-if and sensitivity.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this server can do and what it asks for, from its tool list and install config. Checked Oct 25, 2026.

Tools
7 read · 3 write · 2 delete · 11 not yet classified
Secrets
None asked for
Install scripts
Not scanned yet
Runs as
Python package

Tools by what they do 23

Read from the source code; the running server may list different tools.

Read 7 · Look things up without changing anything.

  • compare_models
  • compare_versions
  • compute_iis
  • get_model_overview
  • query_constraints
  • query_variables
  • read_model_document

Write 3 · Create, change, send or run things.

  • add_model
  • modify_and_resolve
  • save_model_context

Delete 2 · Delete, drop, revoke or wipe things.

  • drop_test
  • run_python

Not yet classified 11 · We could not tell from the name and description.

  • attainable_limit
  • feasibility_relaxation
  • fix_menu
  • infeasibility_proof
  • marginal_value
  • open_model
  • sensitivity_report
  • suspicious_values
  • try_options
  • version_history
  • why_not

Files it touches

  • Any path the agent passes to its tools

Tools (23)

Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].

  • add_model

    Load another model file (.lp, .mps or a .py that builds one) into this session under a name, next to the open model (v0), e.g. the scenarios of one study. Every tool then takes the name as its version; compare_models puts them side by side; compare_versions compares decisions when the models share their variables.

  • attainable_limit

    Description is built at runtime.

  • compare_models

    Side by side for several models or versions (default: v0 and every added model; one name gives that model's summary): status, objective, and with the same metrics for each, per constraint family the rows at a limit (for a one-row family such as a budget, its value against its limit), and per variable family the total and nonzero count. Use it first when a question compares scenarios, then drill into one with the other tools.

  • compare_versions

    What differs between two solved versions (default: v0 and the latest): status and objective, per variable family the total and nonzero count before and after, how many variables went up or down, the largest changes (with the total count), and the rows that became binding or slack. When the model has several equal-cost plans, the diff is against version_b's optimal plan closest to version_a's (one more solve), so it shows what the difference forces, not the solver's choice among ties; a first line says so. Use it before saying how a plan changed. Optional family limits it to one variable family…

  • compute_iis

    Irreducible infeasible subset of an infeasible version: the conflicting constraints with their expressions and bounds, grouped by family. Cost: seconds on an LP; on a MIP a search of many solves, which can take minutes on a large model and may stop at its time limit with a subset that is not minimal (it says so). Most useful when the conflict is small.

  • drop_test

    For each constraint family (the ones you pass, or all), drop all its rows and solve: which single family, removed, restores feasibility, and the objective then. One solve per family, in parallel; a quick way to see which families are levers before sizing a change.

  • feasibility_relaxation

    Minimal total change (sum of absolute RHS/bound changes) that makes an infeasible version feasible (one relaxation solve; slower than a plain solve on a large MIP). Returns one minimal fix: its changes, applied together, each with its current and suggested value; other minimal fixes of the same total may exist (fix_menu lists single-family fixes). Suggested values are exact: copy them as printed rather than rounding or recomputing them. only_families limits which constraint/variable families may change (others stay hard); relax_variable_bounds also allows variable bounds to move.

  • fix_menu

    Menu of repair levers for an infeasible version: for each conflicting constraint family (from the IIS by default, or the families you pass), the minimal change when ONLY that family may change, run in parallel. Each entry says whether that family alone is sufficient, its total change and the individual changes as current -> exact suggested value; the last entry is the unrestricted minimum across all families. Families whose rows all have RHS 0 are flagged as likely linking/definitional rather than business levers. Cost: one relaxation solve per family plus one, run in parallel; slow on a large…

  • get_model_overview

    Size, variable types and solve status of a model version, plus constraint and variable counts per family (the name before its index). Version 'v0' is the original model. One solve.

  • infeasibility_proof

    Only when the user asks for proof or for the numbers behind a conflict: the solver's checked proof that no plan exists, as what the conflicting families require against what they allow, each row with its weight (e.g. hours per unit). Exact for an LP and for a MIP whose conflict holds without integrality; it says so when the conflict needs whole numbers. Uses the IIS (computes it if needed). Explain it in the families' business meanings, not as the solver's sum.

  • marginal_value

    Value of changing one constraint's limit: re-solves the version with the active bound moved up and down by delta and reports the objective change per unit each way. Works for LP, QP and MIP (integer decisions may change).

  • modify_and_resolve

    Apply changes to a version, creating a new version, and solve it. Actions: set_rhs (lower/upper bound of a constraint; for <= use upper, for >= use lower, for = set both; a side left out stays unchanged, null removes that limit, so {'lower': 10, 'upper': null} turns <= 10 into >= 10), set_bounds (variable lower/upper), set_objective_coef (value), drop_constraint, set_coef (one coefficient: name is the constraint, column the variable, value the new coefficient; 0 removes the term), add_constraint (a new row: name, coefs {variable: coefficient}, lower and/or upper). Returns the new version id, i…

  • open_model

    Load an LP or MPS model file (optionally .gz), or a Python file that builds a Pyomo, gurobipy or PuLP model (model.py, or model.py:name for a model or a no-argument builder function; the file is run, and stops at its first solve call, whose model is taken), and make it the current model; its original is version 'v0'. Every other tool works on the current model. Optional document: a text file that describes the model (read with read_model_document). Optional solver: highs, scip or gurobi, to prefer over the default choice.

  • query_constraints

    Description is built at runtime.

  • query_variables

    Description is built at runtime.

Show 8 more tools
  • read_model_document

    The model's documentation: business description, assumptions, input data tables, the model-building code and the results it reports. Without a query it returns the whole document, or its section headings when the document is long; with a query it returns the sections whose heading or text contains it (case-insensitive). Use it to check what a constraint or input means, or to compare a result with the documented one.

  • run_python

    Description is built at runtime.

  • save_model_context

    Save the current model's business context once, from its document or code, so every later session shows the same meanings (the project's standard vocabulary for this model). Describe the model, not this data: what each family, index and input means and how they connect, without current values (capacities, rates, demand, results), which come from the open model and change with each data load. Map EVERY family open_model listed, with its exact name; do not describe families that are not listed (put components the code defines but the model lacks in not_in_model). Explain each index position in o…

  • sensitivity_report

    Description is built at runtime.

  • suspicious_values

    Constraint limits and variable bounds that break the pattern of their siblings (same family, same name pattern, or unusually large for the model), rows whose sense (<=, >=, =) differs from all their siblings, and, for a model that solves but gives a wrong optimum, objective coefficients with a lone opposite sign or a power-of-ten typo of their siblings', a constraint coefficient that alone keeps a row (or column) from matching others of the same shape, and a row missing from a numbered series or an indexed family; these often signal a data error such as a typo. Rows in the IIS are listed first…

  • try_options

    Try several candidate change sets at once: each is applied to the base version as its own new version and solved (in parallel), and the status, objective and objective change of each are listed. Use it to compare alternative fixes or a few candidate values. Change format as in modify_and_resolve.

  • version_history

    What a version contains: the chain of versions from the original model to it, each with its description, its own changes, and its status and objective if solved. Versions branch: any version (v0 too) can be the base of a new change, so use this to say which changes a plan includes and which it does not.

  • why_not

    Counterfactual on a solved version: force a variable to a value (or new bounds), re-solve as a new version, and report the new status, the objective change, which constraints switched between binding and slack (by family, with examples), and the variables that moved most.

Signals

Stars
0
Forks
0
Open issues
0
Weekly downloads
28
Last commit
Oct 24, 2026 (6 days ago)
Last release
Oct 8, 2026 (21 days ago)
Last package publish
Oct 8, 2026 (21 days ago)

From GitHub (fetched Oct 24, 2026) and the package registry.

Details

Registry name
io.github.jjd-lab/optlens
Version
0.0.2
Auth
No auth
Packages
pypi optlens
License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026
Cite this page

optlens MCP server. Agent Mart. https://agentmart.dev/connectors/jjd-lab-optlens (last updated 2026-10-24)