Skip to main content

LensBench MCP (lensbench-mcp)

Platform requirement: Windows 10 / 11 (64-bit) for Free, Personal Basic and Personal Pro desktop editions (macOS & Linux are supported on Enterprise).

Official Model Context Protocol (MCP) launcher for LensBench by OpticChat (optic.chat) — a text-first optical lens design workbench with a built-in native ray-tracing and optimization engine, bidirectional Zemax .zmx interoperability, deterministic evidence IDs (ev-...) and diff-first human review.

LensBench ships its own local optical calculation engine and requires no external optical software — standard MCP and CLI are free across every edition (the Free edition covers learning, evaluation and teaching), letting you connect Claude Code, Claude Desktop, Cursor, VS Code (GitHub Copilot), OpenAI Codex or Google Antigravity with zero optic.chat token usage.


Key Capabilities

  • Plain-text .lens DSL: Git-diffable prescriptions using standard Zemax conventions (OBJ=0 … IMA, post-surface glass, mm / µm / °).
  • Bidirectional .zmx & .seq Interop: Import existing .zmx files, inspect prescriptions, reconcile paraxial/spot/MTF/Seidel numbers, and export .zmx.
  • Zero Hallucinated Numbers: Every optical analysis returns a deterministic ev-... evidence ID binding the prescription hash, engine build and sampling parameters, plus framed PNG plots directly to multimodal models.
  • Diff-First Safety & Undo: Mutating tools support dry_run=true to preview .lens diffs and before/after EFFL / BFL / FNO / TOTR before applying; every edit is journaled and reversible.
  • Context-Friendly On-Demand Toolset (--toolset auto): Pins 33 core tools (open, new, import_zmx, show, check, lens_apply, set, paraxial, spot, mtf, field_curvature, seidel, plot, spec_add, verify, optimize, job_*, find_tools, run_tool) while dynamically unlocking tolerancing, thermal defocus, ghost paths, ISO 10110 / GB 2D drawings, 3D STEP CAD and multi-physics study steps on demand.
  • Strict Workspace Sandbox: File reads and writes are confined to --root (E-PATH-ROOT blocks anything outside, including symlinks and ..), and untrusted strings inside third-party .lens / .zmx files are fenced inside ⟦ ⟧ markers.

Quick Setup (2 Minutes)

Step 1 — Install LensBench Desktop & Sign In (Windows 10/11 x64)

  1. Download the code-signed installer LensBench-Setup-<version>.exe from optic.chat/en/install.html (direct release post with SHA-256).
  2. Sign in once with your free optic.chat account inside the desktop app, or from a terminal using the bundled CLI (bridge\lb.exe inside your LensBench install folder, default %LOCALAPPDATA%\Programs\LensBench\bridge\lb.exe):
    & "$env:LOCALAPPDATA\Programs\LensBench\bridge\lb.exe" login
    # Headless / remote session:
    & "$env:LOCALAPPDATA\Programs\LensBench\bridge\lb.exe" login --device
    

Step 2 — Connect Your MCP Client

Option A: Zero-config via npx or uvx

Add to your client's MCP configuration (.mcp.json, claude_desktop_config.json, ~/.cursor/mcp.json, or ~/.gemini/config/mcp_config.json):

{
  "mcpServers": {
    "lensbench": {
      "command": "npx",
      "args": ["-y", "lensbench-mcp", "--root", "D:/lens-projects"]
    }
  }
}

Or with Python uvx:

{
  "mcpServers": {
    "lensbench": {
      "command": "uvx",
      "args": ["lensbench-mcp", "--root", "D:/lens-projects"]
    }
  }
}

For VS Code (.vscode/mcp.json), use the top-level "servers" key:

{
  "servers": {
    "lensbench": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "lensbench-mcp", "--root", "${workspaceFolder}"]
    }
  }
}

Option B: Direct local binary via lb mcp-config

Once LensBench is installed, generate or merge client configs directly using bridge\lb.exe (shown below assuming bridge is on PATH, or replace lb with "$env:LOCALAPPDATA\Programs\LensBench\bridge\lb.exe"):

lb mcp-config --client claude-code --lang en --write
lb mcp-config --client claude-desktop --lang en --write
lb mcp-config --client cursor --scope user --root D:/lens-projects --lang en --write
lb mcp-config --client vscode --lang en --write
lb mcp-config --client codex --lang en
lb mcp-config --client antigravity --lang en --write

Privacy & Local Computation

  • Local computation: Ray tracing, optimization and file I/O run locally on your machine; LensBench never uploads your design files (.lens prescriptions and scene project files stay on disk).
  • Online features & diagnostics: Standard local MCP checks account credentials and logs daily entry-point counts without uploading prescriptions. If you invoke online built-in AI, automated proposals or diagnostic advice, LensBench sends diagnostic information and analysis metrics computed from the design to optic.chat servers or backend LLM providers; we cannot rule out that hackers or backend LLM providers could reverse-engineer part or all of a design prescription from those diagnostics. See the full Privacy Policy and Terms of Use.

Metadata

Release files for lensbench-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lensbench-mcp 0.4.0
File Size Uploaded Provenance Actions
lensbench_mcp-0.4.0.tar.gz 8.5 kB With provenance Details for lensbench_mcp-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lensbench-mcp 0.4.0
File Interpreter ABI Platform Actions
lensbench_mcp-0.4.0-py3-none-any.whl Python 3 none any Details for lensbench_mcp-0.4.0-py3-none-any.whl

Total release size: 17.6 kB

Release files / lensbench_mcp-0.4.0.tar.gz

Download URL lensbench_mcp-0.4.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f6aa1533d190e66de4bc27a5d2f10db82475882e12763d0373bbf64c8dd39cf7
BLAKE2b-256 checksum
How to use checksums
ee4b8abb9e8eb58a899e32eb9bde741311f08615af2d7136233cfa1b2077f0c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / lensbench_mcp-0.4.0-py3-none-any.whl

Download URL lensbench_mcp-0.4.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98509afcbe5c744be9722c89703793aad01e8caa7da979ac15907e148a02ebc4
BLAKE2b-256 checksum
How to use checksums
27609e5934d24a6eab92ad0c0c128aa83c0c3bf83d473de70c2f88889b4cdc94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for lensbench-mcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lensbench_mcp-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page