Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Debug and explain LP/MILP models: why infeasible, the smallest fix, what-if and sensitivity.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"optlens": {
"command": "uvx",
"args": [
"optlens"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add optlens -- uvx optlensวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"optlens": {
"command": "uvx",
"args": [
"optlens"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"optlens": {
"type": "stdio",
"command": "uvx",
"args": [
"optlens"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub jjd-lab ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.0.4) เข้า registry 13 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, Fomu MCP
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Kenya government form guides: checklists, draft letters, eCitizen, Huduma, timelines. Sample data.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
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
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 .
| extra | adds |
|---|---|
scip | SCIP (pyscipopt): a second open-source solver, with a native MIP IIS |
gurobi | gurobipy: 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, pulp | load Pyomo and PuLP models |
mcp | the MCP server optlens-mcp and the Claude Code plugin |
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.
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.
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.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.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.
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.
| agent | connect |
|---|---|
| Claude Code | claude plugin marketplace add jjd-lab/optlens then claude plugin install optlens@optlens (or the same as /plugin commands in a session) |
| Codex CLI | codex mcp add optlens -- optlens-mcp |
| Cursor | in .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 Desktop | in claude_desktop_config.json (Settings > Developer > Edit Config): {"mcpServers": {"optlens": {"command": "optlens-mcp"}}} |
| Any other MCP client | run 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.
| client | waits for a tool call | OPTLENS_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 clients | 60 s | 60 (the default) |
| other clients | see the client's settings | 60 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.
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:
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.
python -m unittest discover -s tests -t . # the engine, frตัดมาแค่ช่วงต้น อ่านต่อใน repo