原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

optlens

作者:jjd-lab版本 0.0.4i★ –i在你的电脑上运行
注册名称io.github.jjd-lab/optlens

安装

概览

作者提供的说明(英文原文)

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

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 其他

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "optlens": {
      "command": "uvx",
      "args": [
        "optlens"
      ]
    }
  }
}

在终端中运行这条命令

claude mcp add optlens -- uvx optlens

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "optlens": {
      "command": "uvx",
      "args": [
        "optlens"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "optlens": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "optlens"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 jjd-lab 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“其他”中的其他服务器比较i

  • 星标数多于此分类中其他 32568 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 32568 个服务器的 74% 更新
  • 基础检查结果等于或优于此分类中其他 32568 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

optlens 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.0.4)于13天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Spec Driven Development, Remote Desktop Commander, FlyDocs

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Spec Driven Development

作者:formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

在你的电脑上运行★ 440MIT14个月前更新
安装

Remote Desktop Commander

作者:desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

在云端运行★ 211昨天更新
安装

FlyDocs

作者:flydocs.ai

Spec-driven development workflow: your agent works issues, sessions and the status lifecycle.

在你的电脑上运行今天更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

optlens

A solver-agnostic debugger and explainer for LP and MILP models. Give it a model that is infeasible, or one that solves to an answer you don't trust. optlens finds the conflicting constraints, the smallest changes that fix them, and what each change costs. Every result is text that an agent or a person can read. Use it from your own Python, from Claude Code through the plugin, or from any MCP client.

optlens works on a model that is already built. It does not write models.

Website: optlens.dev

Install

Python 3.12 or later:

pip install "optlens[scip,mcp]"   # core: numpy, scipy, HiGHS

To run the quickstart below or the tests, clone the repository and install it from the clone (git clone https://github.com/jjd-lab/optlens && cd optlens && pip install ".[scip,mcp]").

Some networks cannot reach GitHub, for example behind a proxy or a VPN. There, copy the source over another way, such as a zip of the repository. Install it with pip install " [scip,mcp]", and add the Claude Code plugin with claude plugin marketplace add .

extraadds
scipSCIP (pyscipopt): a second open-source solver, with a native MIP IIS
gurobigurobipy: Gurobi, bring your own license. Its version must match your Gurobi. A Compute Server or token server rejects a newer client ("No compatible runtime available"), so install that major version, for example pip install "gurobipy==12.*". open_model shows the installed gurobipy version.
pyomo, pulpload Pyomo and PuLP models
mcpthe MCP server optlens-mcp and the Claude Code plugin

Quickstart

import optlens as od

from optlens.session import Session, Version

if name == "main": # solves run in worker processes, which start by re-importing this script md = od.load("tests/fixtures/ex_milp_tutorial__rhs_tighten__0.mps") # LP or MPS s = Session({"v0": Version(md, None, "original model")}) print(s.get_model_overview()) # size, status (here INFEASIBLE), constraint families print(s.compute_iis()) # the conflicting constraints, grouped by family print(s.fix_menu()) # the smallest change per family that restores feasibility print(s.modify_and_resolve(changes=[{"action": "set_rhs", "name": "resource[Monika]", "upper": 1}]))

Save it as a file and run it from the repository root. Keep the if __name__ == "__main__": guard in any script that solves. Solves run in worker processes. Windows starts them with spawn, and each one re-imports the script. Without the guard, the script runs again in every solver process.

Every Session method returns text, and optlens.session.TOOLS holds the matching JSON schemas for an agent. A session also covers feasibility relaxation, what-if edits as versions, why-not questions, sensitivity and marginal values, suspicious data values, and comparisons between versions or models.

A model built in Pyomo, gurobipy or PuLP loads directly, from the object or from the file that builds it. optlens runs the file without its if __name__ == "__main__": block and stops at the first solve call (optimize(), solve()). It reads the model of that call. Nothing is solved, so a large gurobipy model loads on Gurobi's size-limited license.

md = od.from_object(model)                      # a Pyomo ConcreteModel, gurobipy Model or PuLP LpProblem

md = od.load("my_model.py") # the model it solves, else its one model or build_model() md = od.load("my_model.py:make_scenario") # a named model, or a function with no arguments that returns one

LP files written by Gurobi (bracketed names, which HiGHS rejects) load without gurobipy.

optlens supports quadratic objectives (QP, MIQP). A convex QP solves on HiGHS. optlens sends a mixed-integer or non-convex one to SCIP automatically. Every question works as for a linear model, except sensitivity ranges. For a non-convex objective, shadow prices don't work either. optlens rejects quadratic constraints, indicator and other general constraints, and SOS when the model loads. optlens.dev/ask lists every question, format and solver.

Solvers

HiGHS comes with the core, and SCIP and Gurobi are extras. Pick one with OPTLENS_SOLVER (highs, scip, gurobi, or auto, the default), with open_model's solver in the MCP server, or with Session(..., prefer=...). Under auto without Gurobi, each model goes to HiGHS or SCIP. A larger MIP's first solve races both.

  • Every solve has a hard time limit. Solvers do not always honor their own limits. SCIP once ran 862 s on a 30 s limit. So each solve runs in a worker process, and optlens stops the process at the limit.
  • Gurobi does every step itself. A Gurobi session solves, computes IIS, relaxes, ranges and checks on Gurobi. It hands no step to another solver. Say you chose Gurobi and it cannot run a model, because it is not installed or the model is over the size-limited license. Then the tool stops and says so instead of switching. Under auto, optlens uses Gurobi when Gurobi can run here. It checks this once with a one-variable solve. It leaves out an installed gurobipy with no usable license, or a version your license server rejects, and open_model says why. For a model Gurobi cannot run, it falls back to HiGHS or SCIP and says so.
  • HiGHS and SCIP stand in for each other. This happens where only one can do a step: HiGHS has no MIP IIS, and SCIP does. It also happens when one gives no verdict within its limit, and then the other tries once. The result names the solver that did the step.
  • Every IIS is checked. Sometimes a solver's IIS has constraints that are feasible on their own. optlens rejects that IIS and rebuilds it on the same solver, by removing constraints one at a time. This guards against a known gurobipy 13.0.3 bug. computeIIS leaves out a one-variable row on a binary whose fractional limit rounds it to 0. For example, 160 open <= 100 with open >= 1 returns open >= 1 alone, which is feasible.
  • Gurobi is tested on small models and on one large one. The large one is a 279k-row hotel model, tested for solves, sensitivity, IIS, relaxations and repair menus. Other large models are untested, and reports are welcome.

On large models, with hundreds of thousands of constraints, the IIS search starts near the conflict. It starts from HiGHS's proof of infeasibility instead of searching the whole model.

Use it with your agent

Install as above, which puts optlens-mcp on your PATH. Then connect once. The agent gets the 24 tools and the method that goes with them: open the model first, lead with the cause, take every number from a solve, and re-solve before recommending a fix.

agentconnect
Claude Codeclaude plugin marketplace add jjd-lab/optlens then claude plugin install optlens@optlens (or the same as /plugin commands in a session)
Codex CLIcodex mcp add optlens -- optlens-mcp
Cursorin .cursor/mcp.json (or ~/.cursor/mcp.json): {"mcpServers": {"optlens": {"command": "optlens-mcp"}}}
VS Code (Copilot)in .vscode/mcp.json: {"servers": {"optlens": {"type": "stdio", "command": "optlens-mcp"}}}
Claude Desktopin claude_desktop_config.json (Settings > Developer > Edit Config): {"mcpServers": {"optlens": {"command": "optlens-mcp"}}}
Any other MCP clientrun optlens-mcp as a stdio server

The command must be on the PATH the agent sees. If it is not, give the full path to optlens-mcp, for example .venv/bin/optlens-mcp. OPTLENS_SOLVER (highs, scip, gurobi or auto) chooses the solver once.

Time limits. Solves stop at 45 s, so a call answers within a minute. OPTLENS_CALL_LIMIT (seconds, at least 30) is the most time one tool call may take. A tool's time_limit may ask for up to 15 s less than that. The agent asks for more time only when a solve stopped at its limit while still improving, and results say whether it was. Set the limit to how long your client waits for one tool call. open_model states the limits in force, and a result that a limit cut short says so.

clientwaits for a tool callOPTLENS_CALL_LIMIT
Claude Code (plugin)10 minutes, set by the plugin (calls past 2 minutes move to the background)110, set by the plugin
Claude Code (claude mcp add)MCP_TOOL_TIMEOUT (about 28 hours unless set; some environments set 60 s)60 unless set; to allow more, add "timeout": 600000 to the server's entry and set 110
Claude Desktop, MCP TypeScript SDK clients60 s60 (the default)
other clientssee the client's settings60 unless the client allows more

Large MIPs may not finish within any of these limits. Results then report the plan found, its bound and its gap.

Then ask: *"Why is plan.mps infeasible, and what fixes it?"* The agent opens the model and writes its context once. The context says what each constraint and variable family means. It is JSON in .optlens/context/, which you can review and commit. Then the agent works through the tools. For several steps or many solves it uses run_python. That is a persistent Python process with the engine preloaded as session and the model loaded once.

The Claude Code plugin is the same server plus a short skill that points to the server's method (plugin/README.md).

Security. optlens runs code on your machine, with your permissions, and has no sandbox. run_python executes the code the agent writes. Its process starts without your API keys and tokens, but it can read and write whatever your user can. In Claude Code you approve each call. Opening a .py model runs that file up to its first solve call. Open only models and code you trust. To report a vulnerability, see SECURITY.md.

Try it

To try the plugin without touching your own Claude Code setup, build a clean one in a folder of its own. The folder gets its own venv with optlens from GitHub, and its own Claude config with only the optlens plugin. It also gets a hotel week whose data load went wrong (packs/hotel/examples/try_week), with five questions to ask:

git clone https://github.com/jjd-lab/optlens && optlens/scripts/sandbox.sh ~/optlens-try

~/optlens-try/start.sh # log in on the first start; the questions are in ~/optlens-try/HOW-TO.md

It needs bash, Python 3.12+ and Claude Code, on macOS or Linux. On Windows, use WSL or the PowerShell steps in plugin/README.md. --project PATH puts your own model there instead. It is a separate setup, not a security sandbox (see Security above). Delete the folder to remove it.

Here is the same week in a clean Claude Code with the plugin. The animation comes from a recorded session, and each tool call shows its real duration:

Hotel pack

packs/hotel/ is a synthetic hotel revenue-management model: room type × night × length of stay × booking window × rate tier. It comes with its generator, its document, domain notes and helpers. It builds models from a few thousand to 837,000 constraints, so you can try optlens on something realistic and large.

Tests

python -m unittest discover -s tests -t .                             # the engine, fr

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx