Skip to main content
Glama
MERURUXD

CODE V MCP

by MERURUXD

CODE V MCP

tests English · Windows · CODE V 10.2 · Python 3.10+ · 实验性 0.1.0

把本机的 CODE V 10.2 接入 MCP 客户端(如 Claude Desktop、Claude Code)。客户端可以用自然语言让它打开镜头、读取和修改参数、运行一阶/点列/MTF/波前分析、导出 CODE V 原生图,并把结果另存。服务通过 Windows COM 驱动一个自己启动的无界面 CODE V 会话,只在本机经 stdio 通信。

除 MCP 工具外,仓库还提供一组独立命令行工具,用于镜头评价与对比、参数扫描、整体缩放、换玻璃、受控 AUT 优化候选、多方案比较和报告素材整理。

NOTE

真实后端需要已安装、已注册 COM 并有可用许可证的 CODE V 10.2。CODE V 是 Synopsys 的商业软件,不随本项目提供;本项目与 Synopsys 无关联。没有 CODE V 时可以用模拟后端体验协议和流程,模拟结果一律标记为simulated,不能作为光学结论。

能做什么

MCP 工具

工具

作用

get_status

查看后端、CODE V 版本、会话与镜头状态、当前任务

open_lens

打开 .len 的工作副本,返回完整镜头数据

create_lens

在空会话中按类型化规格新建单变焦球面镜头,可加近轴像面求解(PIM)

get_lens

读取表面、半径、厚度、玻璃、孔径、视场(含渐晕因子)、波长、变焦位置

update_lens

批量修改半径/厚度/玻璃、视场、波长、系统孔径值等;整批回读核对,失败整批回滚

edit_lens_structure

对本服务新建的简单球面镜头插入/删除表面、设置光阑

run_analysis

一阶参数、点列图、衍射 MTF、波前 RMS/Strehl,或导出 CODE V 原生绘图(PNG)

get_analysis

查询任务状态,取回数值结果与图像

cancel_analysis

取消点列图或原生绘图任务,并区分“已请求”与“已确认停止”

save_lens_as

另存为新文件,不覆盖源文件或已有文件

close_session

释放本服务创建的 CODE V 会话

每项的参数边界、数值精度与口径见支持能力与限制。

独立命令行工具

均以 python -m codev_mcp.<名称> 运行,复用上面的工具或服务自己的会话,不提供任意命令入口。

名称

用途

说明

compare、batch

单镜头按设计规格评价;初始/最终镜头对比;批量逐对报告

对比与评价、批量、设计规格

scan

对一个表面的半径或厚度做固定网格扫描

参数扫描

scale

按目标焦距或系数整体缩放镜头

能力清单

edit、fieldset

按文件做类型化编辑(如换玻璃)、生成视场集合

视场集合与导入

glass、glass_near

查询本机玻璃目录、列出相近玻璃

玻璃目录

aut

按类型化规格生成分阶段 AUT 优化候选,人工确认后再显式接受

受控 AUT

schemes

从同一基线运行多个设计方案并汇总比较,只推荐不接受

多方案比较

export_seq、seq_import

导出可读 .seq;按白名单导入 .seq(不执行序列)

视场集合与导入

deliver、walkthrough

整理报告用的图、数据与宏;从执行记录生成设计记录

交付整理、执行记录

命令行工具的引擎工作目录由安装位置决定,请按下面的步骤在仓库根目录做可编辑安装后使用。

Related MCP server: Ansys Workbench MCP

怎么保证不弄坏镜头

MCP 客户端 ──stdio──> codev-mcp 服务 ──JSON 行──> 工作进程 ──COM──> 无界面 CODE V 会话
  • 工作副本:打开镜头时复制一份再操作,原文件不动;另存拒绝覆盖源文件和已存在的文件。

  • 事务式修改:每批修改前建恢复点,修改后逐项回读;任何一项不符(包括 CODE V 静默忽略修改)整批回滚。

  • 检查点:每次成功修改都保存、重新载入并比对后才报告成功;引擎中途崩溃时自动重建会话并从最近的检查点恢复。

  • 没有任意命令:发给 CODE V 的命令都由服务按类型化参数构造,路径、玻璃名和数值先经过校验。

  • 只管自己的进程:只清理确认由本服务启动的 CODE V 进程,不接管你打开的 CODE V 窗口。

  • 结果可追溯:每个结果带来源(codev 或 simulated)、单位、分析设置和原生输出;失败返回结构化错误类别。

快速开始

1. 安装

需要 Windows 和 Python 3.10 及以上(推荐 64 位;64 位 Python 可以驱动 32 位的 CODE V COM 服务)。克隆仓库后在根目录执行 PowerShell:

git clone https://github.com/MERURUXD/codev-mcp.git
cd codev-mcp
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.lock.txt
.\.venv\Scripts\python.exe -m pip install --no-deps -e .

2. 用模拟后端试运行

不需要 CODE V。下面的脚本经真实 MCP 协议新建一个模拟单透镜、做一阶分析并另存,结果写到 .codev-run/demo/result.json:

.\.venv\Scripts\python.exe examples/simulated_quickstart.py --output .codev-run/demo

输入与输出说明见模拟入门。

3. 接入 MCP 客户端

在客户端的 MCP 配置里加入下面这段,把路径换成你的仓库位置(JSON 里反斜杠要写两次)。没有 CODE V 时把 com 改成 simulated:

{
  "mcpServers": {
    "codev": {
      "command": "D:\\path\\to\\codev-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "codev_mcp", "--backend", "com",
               "--working-directory", "D:\\path\\to\\codev-mcp\\.codev-run"]
    }
  }
}

重启客户端后先调用 get_status,确认后端为 com 且能读到 CODE V 版本。工作目录存放会话、检查点和结果图片,必须可写,建议使用较短的纯英文路径。其他选项(超时、解释器、环境变量)和故障排查见安装说明。

4. 开始使用

可以直接对客户端这样说:

  • “打开 D:\lenses\design.len,列出每个面的半径、厚度和玻璃。”

  • “把第 3 面的厚度改成 5 mm,再给出 EFL 和后焦距。”

  • “画第 2 视场的点列图,并告诉我 RMS 半径。”

  • “计算 10、30、50 lp/mm 的 MTF。”

  • “导出 CODE V 的光路图(layout)。”

  • “另存为 D:\lenses\design-v2.len。”

用设计规格评价一个镜头(命令行):

.\.venv\Scripts\python.exe -m codev_mcp.compare --lens D:\lenses\design.len --spec docs\design\design-spec-dbgauss.json

示例规格里的阈值只是演示值,实际使用时按自己的指标填写,格式见设计规格。

不支持的内容

  • 任意 CODE V 命令或宏;

  • 在 MCP 工具里自动优化、做公差或灵敏度分析(AUT 只通过 aut 命令行生成候选,并且需要显式接受);

  • 对任意已有镜头增删表面、改面型或特殊面型(结构编辑只开放给本服务新建的简单球面镜头);

  • 远程访问,或控制用户已经打开的 CODE V 窗口;

  • 无焦系统 MTF、几何 MTF;多变焦镜头的原生绘图与波前分析。

完整清单与注意事项(长会话、同步/异步分析、精度、孔径编辑边界等)见支持能力与限制。

文档

主题

文档

安装、客户端配置与故障排查

docs/install.md

工具能力、数值口径与限制

docs/capabilities.md

镜头评价与对比、批量报告

comparison-workflow、batch-workflow、performance-workflow

设计规格与执行记录格式

design-spec、execution-record

受控 AUT 与多方案比较

controlled-aut、scheme-comparison

参数扫描、视场集合、.seq 导入导出

parameter-scan、field-set-and-seq-import

玻璃目录、交付整理

glass-catalog、deliverable

开发

自动化测试使用模拟后端和假 COM 会话,不需要 CODE V 或许可证:

$env:PYTHONPATH = Join-Path (Get-Location).Path 'src'
.\.venv\Scripts\python.exe -m unittest discover -s tests -t .

提交约定与架构约束见 CONTRIBUTING.md。问题与建议请提交 Issue。

许可

MIT

Available Tools

11 tools
cancel_analysisA

请求取消当前分析任务,并区分“已请求取消”与“确认停止”。

只对异步任务(点列图与原生绘图导出)有意义;取消原生绘图时还会关闭 CODE V 已经打开的绘图文件。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
taskNo
notesNo
sourceYes
requestedYesTrue when a task existed and was asked to stop.
still_runningNoTrue when the backend could not confirm that it stopped.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does disclose real traits: the operation is a request whose completion is not immediate, and cancelling a native plot additionally closes the CODE V plot file already opened. It omits any note on permissions, idempotency, or behavior if no task is running.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both load-bearing: the first states the action and its two-state semantics, the second scopes applicability and the side effect. Nothing is repeated or wasted, and the core action is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, and with zero parameters the surface is small. The description covers applicability and the main side effect; only edge-case behavior (e.g. calling when nothing is running) is left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is nothing for the description to disambiguate; baseline 4 applies. The description adds no parameter information, which is appropriate here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource ('请求取消当前分析任务' / request cancellation of the current analysis task) and even distinguishes the two resulting states (requested vs. confirmed stopped). It does not name a sibling such as run_analysis or get_status to route against, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states an explicit applicability condition: only meaningful for asynchronous tasks (spot diagram and native plot export), which implicitly excludes synchronous analyses. No alternative tool is named for the cases where cancellation is not applicable, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

close_sessionB

释放本服务创建的 CODE V 会话,并返回释放后的状态。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
taskNo
readyNo
sourceYes
backendYes
detailsNo
warningsNo
lens_openNo
capabilitiesNo
current_lensNo
session_openNo
codev_versionNo
service_versionYes
working_directoryNo

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It does disclose the postcondition (returns the released session's status), but omits whether the operation is idempotent, what happens if no session exists, and whether release is irreversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single compact sentence covering both the action and its postcondition, with the action front-loaded. The clause about returning the post-release status is mildly redundant given an output schema exists, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless cleanup call with an output schema covering the return value, the description supplies enough to invoke it correctly. The remaining gap is lifecycle/prerequisite context rather than anything structural.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters and the schema is fully described, so there is nothing for the description to disambiguate. The baseline of 4 for a parameterless tool applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (release/close) and resource (the CODE V session), and scopes it to the session 'created by this service'. Among the lens-oriented siblings there is no competing session-lifecycle tool, so the purpose is unambiguous without further differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says what the tool does but gives no when-to-use or when-not guidance. It does not state prerequisites (an open session), whether it is safe to call when none exists, or how it relates to any session-opening flow, leaving the agent to infer usage entirely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_lensA

在空会话中按受限球面规格新建单变焦镜头,并发布核对过的恢复点。

image_solve="pim" 给最后一个普通面的厚度加 CODE V 近轴像面求解(PIM), 请求中的厚度只是初值;求解厚度之后由 CODE V 推导,不能再直接编辑。

ParametersJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathNoFile the working copy was opened from.
titleNo
unitsYes
fieldsNo
sourceYes
apertureNo
surfacesYes
warningsNo
raw_listingNoVerbatim surface listing the values were parsed from.
wavelengthsNo
stop_surfaceYes
zoom_positionNo
aperture_usageNo
dimension_codeYesRaw CODE V GetDimension value: 0 inch, 1 cm, 2 mm.
zoom_positionsNo

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does disclose real behavior: it publishes a verified recovery point (a side effect), requires an empty session, and explains that with image_solve='pim' the surface thickness becomes CODE V-derived and no longer directly editable. It omits permission/error behavior, but the non-obvious mutation semantics are well covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core action and precondition, then the image_solve caveat. Every sentence carries information, though the PIM explanation is slightly dense.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation. The description covers the key non-obvious aspects (empty-session requirement, recovery point, PIM behavior); remaining gaps like units handling and aperture kinds are documented in the nested schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Top-level schema coverage is reported as 0%, and the description compensates richly for exactly one field (image_solve='pim' and its non-editable consequence). The many nested fields (units, aperture_kind, wavelengths, fields, surfaces) rely entirely on their nested schema descriptions and get no extra meaning from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: creates a new single-zoom lens from restricted spherical specs. The 'in an empty session' qualifier and the 'typed values only' framing help distinguish it from open_lens/update_lens, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'empty session' precondition is a useful usage constraint, but the description never states when to prefer create_lens over open_lens or edit_lens_structure, nor any explicit exclusion. Usage is implied by session state rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

edit_lens_structureB

对本服务新建的简单镜头批量插入或删除普通球面、设置光阑,回读并核对恢复。

ParametersJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
lensNo
stepsYes
sourceYes
appliedNo
warningsNo
rolled_backNo
restore_pointNo
session_validNo

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It hints at a readback/verify-and-restore step (回读并核对恢复), but for a destructive structural mutation it never states reversibility, atomicity across the batch, permission requirements, or what happens to existing surfaces. The behavioral picture is left largely unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single compact sentence that front-loads the scope and the operation set. Nothing is padded, though it is terse to the point of under-specification rather than tightly informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is not required, and the scope plus operation types are covered. However, with no annotations on a mutation tool and no parameter guidance, the definition leaves meaningful gaps for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only loosely maps to the three operation kinds (insert_sphere, delete_surface, set_stop) without explaining fields like glass, radius, thickness, before_surface, or new_stop_surface. The one useful schema note ('native CODE V numbers') lives in the schema, not the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names specific verbs and resources: batch insert/delete ordinary spherical surfaces and set the aperture stop on simple lenses created by this service. This distinguishes it from the general update_lens sibling, though it doesn't name that sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It scopes usage to 'simple lenses newly created by this service' (对本服务新建的简单镜头), which implies when the tool applies, but it never names an alternative such as update_lens or states when not to use it. Usage is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_analysisB

获取当前分析任务的状态、数值结果与图像。

结果以文本 JSON 返回,图像同时作为 MCP 图像内容返回,并在结果文件中保留副本。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It does disclose useful non-obvious traits: results come back as text JSON, images are additionally emitted as MCP image content, and a copy is retained in the result file. It omits failure behavior when no analysis is running, permissions, and whether repeated calls are cheap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences: the first front-loads purpose and scope, the second covers the return channels. No filler, no restatement of the name or title, and the most decision-relevant information comes first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A no-parameter read tool with an output schema and full schema coverage needs little text, so the description is close to sufficient. However, the unresolved overlap with the sibling get_status and the absence of any precondition (an analysis must be running) leave a real gap for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there are no parameter semantics to explain; the baseline for a parameterless tool is 4. The description adds no misleading parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource ("get the status, numerical results, and images of the current analysis task") and scopes it to the current analysis, so the agent knows what it retrieves. It does not differentiate itself from the sibling get_status, which creates residual ambiguity about which of the two to call.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use guidance, no statement of prerequisites (e.g. call after run_analysis, only valid while an analysis is active), and no exclusion of the sibling get_status or run_analysis. The phrase "current analysis task" weakly implies post-startup use, but the agent must infer everything.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_lensA

读取当前镜头的表面、材料、单位、孔径、波长、视场与变焦位置。

视场含渐晕因子 vux/vlx/vuy/vly(CODE V VUX/VLX/VUY/VLY),可经 update_lens 修改。 zoom_position 用于多变焦镜头,只影响按变焦位置取值的数据。

ParametersJSON Schema
NameRequiredDescriptionDefault
zoom_positionNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathNoFile the working copy was opened from.
titleNo
unitsYes
fieldsNo
sourceYes
apertureNo
surfacesYes
warningsNo
raw_listingNoVerbatim surface listing the values were parsed from.
wavelengthsNo
stop_surfaceYes
zoom_positionNo
aperture_usageNo
dimension_codeYesRaw CODE V GetDimension value: 0 inch, 1 cm, 2 mm.
zoom_positionsNo

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full burden for a read-only tool. It usefully discloses the scoping nuance that zoom_position only affects data fetched by zoom position, and that field data carries CODE V VUX/VLX/VUY/VLY vignetting factors, but it never states read-only/no-side-effect semantics or anything about volume/size of the returned data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short paragraphs, front-loaded with the tool's scope and followed by the two operative caveats (vignetting-factor naming/write path, zoom_position scoping). No filler, though the parenthetical CODE V identifier list is dense reference material rather than selection guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described; given that, the description covers what is read, the zoom-position behavior, and the write counterpart. It leaves minor gaps about the relationship to get_status and whether a session must be open first.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain the single parameter, and it does: zoom_position is for multi-zoom lenses and only affects zoom-position-dependent values. The default-null / 'omit for the current position' semantics are implied rather than stated, keeping it short of a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence uses a specific verb (读取/read) plus the resource (当前镜头/current lens) and enumerates exactly which data blocks it returns (surfaces, materials, units, aperture, wavelength, field, zoom position). This clearly separates it from write-oriented siblings like update_lens and edit_lens_structure, so an agent can route without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the condition for the optional parameter (zoom_position applies to multi-zoom lenses only) and points at the alternative tool for the write path (vignetting factors can be modified via update_lens). It never states explicitly when to prefer get_lens over get_status or get_analysis, so the routing is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statusB

返回后端类型、CODE V 版本、会话与镜头状态、当前分析任务与支持能力。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
taskNo
readyNo
sourceYes
backendYes
detailsNo
warningsNo
lens_openNo
capabilitiesNo
current_lensNo
session_openNo
codev_versionNo
service_versionYes
working_directoryNo

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses the scope of state inspected (session, lens, analysis task, capabilities), which implicitly frames this as a non-mutating inspection, but it never explicitly confirms read-only/idempotent behavior, side effects, cost, or state freshness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no preamble or filler, and the most important noun (status) is implied by the name and reinforced by the field list. It is a comma-separated enumeration rather than structured prose, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description is not obliged to explain return formats, and a parameterless status tool needs little else. The only gap is the absence of any guidance on when the reported state is meaningful or how often to re-check, which is minor given the tool's simplicity and its English-named sibling set.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is nothing for the description to disambiguate and the baseline is 4. No argument semantics are needed or missing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a clear verb (return/get) and enumerates the specific resources reported: backend type, CODE V version, session and lens state, current analysis task, and supported capabilities. No sibling tool (open_lens, get_lens, run_analysis, etc.) overlaps with this diagnostic role, so an agent can identify it without opening the schema. It stops short of explicitly contrasting itself with siblings, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use statement, no prerequisites, and no mention of alternatives or follow-up tools. The list of returned state only implicitly suggests a 'check before you act' role; the agent must infer when this call is warranted versus get_lens or get_analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

open_lensC

打开一个 .len 镜头文件的工作副本,并返回其表面、材料、单位、波长与视场。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathNoFile the working copy was opened from.
titleNo
unitsYes
fieldsNo
sourceYes
apertureNo
surfacesYes
warningsNo
raw_listingNoVerbatim surface listing the values were parsed from.
wavelengthsNo
stop_surfaceYes
zoom_positionNo
aperture_usageNo
dimension_codeYesRaw CODE V GetDimension value: 0 inch, 1 cm, 2 mm.
zoom_positionsNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. 'Working copy' hints at session state, but it never says whether the underlying file is modified, whether the copy must later be released via close_session, whether repeated opens are allowed, or what permissions are needed. For a state-creating operation this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One compact sentence, front-loaded with the action and resource, followed by the returned data. No padding or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be re-explained, and the description correctly enumerates the returned categories. However, for a session-opening tool with no annotations and a documented sibling (close_session), the lifecycle and file-safety context an agent needs is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single required 'path' parameter is never explained. The mention of a '.len 镜头文件' does implicitly signal the expected file type, which gives partial meaning, but format, absolute-vs-relative path, and error behavior are all unaddressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb ('打开' / open) and a specific resource (a working copy of a .len lens file), and lists what the call surfaces (surfaces, materials, units, wavelengths, fields). This distinguishes it reasonably from create_lens and get_lens, though it never explicitly names an alternative sibling. It is clear but lacks the explicit sibling differentiation that would earn a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no statement of when to prefer this over create_lens, get_lens, or open-a-new-session flows, and no mention of prerequisites or the close_session lifecycle. The agent is left to infer the correct moment to call it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_analysisA

提交一阶参数、点列图、MTF、当前焦面 WAV 或原生绘图,返回任务状态。

MTF 必须由调用方给出频率网格;原生绘图用 options.plot_type 选择类型, 由 CODE V 自己绘制并导出为 PNG。WAV 只支持单变焦镜头的全部视场和波长, 固定 NRD=20,不改变焦面。点列图与原生绘图异步执行,需要轮询 get_analysis;一阶参数、MTF 和 WAV 同步完成。同一时刻只允许一个分析任务。

ParametersJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
kindYes
errorNo
stateYes
sourceYes
task_idYes
progressNo
settingsNo
warningsNo
created_atYes
raw_outputNoVerbatim backend output; truncated content is flagged in warnings.
started_atNo
finished_atNo
history_onlyNoTrue when the results belong to an earlier lens or lens revision, so they are kept as history rather than describing the lens that is open now.
output_truncatedNo

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden and does a good job: it discloses sync vs async execution per analysis kind, the one-task-at-a-time concurrency constraint, that WAV fixes NRD=20 and does not change the focal plane, and that MTF needs a caller-supplied frequency grid. It omits error/failure behavior and permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the submission action and the returned status, then layers constraints per analysis kind. Dense but each sentence conveys a distinct constraint; no obvious padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be explained, and the description covers the key operational traits an agent needs (async vs sync, polling via get_analysis, single-task limit, WAV restrictions). Only some option-level parameter details are left to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Reported schema description coverage is 0% for the top-level argument, so the description must compensate. It clarifies that native plots are selected via options.plot_type and that MTF frequencies must be supplied by the caller, but leaves ray_grid, azimuth, field_numbers, zoom_position and wavelength_numbers unaddressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and the resources it submits (一阶参数、点列图、MTF、当前焦面 WAV、原生绘图) and notes it returns task status. It is distinguishable from get_analysis by being the submission step, but it does not explicitly name that sibling as the polling counterpart in the purpose statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete usage context: spot diagram and native plots are asynchronous and require polling get_analysis, while first-order, MTF and WAV complete synchronously; only one analysis task is allowed at a time; WAV is limited to single-zoom lenses over all fields/wavelengths. No explicit 'when not to use' or routing among siblings beyond the async note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

save_lens_asB

把当前工作副本另存为新文件;拒绝覆盖源文件或已存在的文件。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathYes
sourceYes
raw_outputNo
overwrittenNo
bytes_writtenNo

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It usefully discloses the refusal behavior (no overwrite of source or existing files), which is real behavioral context. It stops there, though: nothing about permissions, what happens to the original working copy, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence that states the action first and the constraint second. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, and the save-as plus refusal behavior is covered. Gaps remain around what 'current working copy' refers to and the undocumented path parameter, leaving it only minimally adequate for a 1-param tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single 'path' parameter is never mentioned in the description. The name 'path' is largely self-explanatory, but the description adds no meaning about its format, target location, or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('save the current working copy as a new file'), which is clearly distinct from the mutation siblings like update_lens or create_lens. It does not explicitly name a sibling to differentiate from, but the save-as semantics are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It communicates a when-not condition ('refuses to overwrite the source file or existing files'), which implies you should use it for creating a new copy rather than overwriting. However, it names no alternatives and gives no explicit trigger conditions for choosing it over create_lens or update_lens.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_lensA

批量修改已有表面、视场、波长及受限孔径参数。

一批修改共享一个恢复点;只要有一条被拒绝,整批都不会生效。 由求解或拾取控制的参数会被拒绝,多变焦镜头必须给出 zoom_position。 视场可改 y_angle、x_angle、weight 与渐晕因子 vux/vlx/vuy/vly(-0.99~0.99)。 field_set 整体替换视场集合(1~10 个角度视场,含个数、角度、权重与渐晕因子), 单独成一次事务、不能与 edits 同批;省略的权重与渐晕因子沿用同编号视场的值, 新增视场权重为 1、渐晕为 0,像面求解(如 PIM)保持不变。仅支持单变焦、角度定义的视场。 孔径首版仅支持单变焦:target=aperture、parameter=value 保持现有 EPD/FNO/NA/NAO 类型只改数值;表面 clear_aperture_radius 只改已有的 单一、居中、圆形显式通光孔径半径。自动孔径、遮拦和复合定义只读。

ParametersJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
sourceYes
outcomesYes
warningsNo
field_setNoPresent when the request replaced the field set.
raw_outputNo
rolled_backNo
restore_pointNoIdentifier of the recovery point taken before editing.
session_validNoFalse once the session can no longer be trusted for edits.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: it states the whole batch is one transaction sharing a recovery point and that any single rejection rolls back the entire batch, which is critical for an agent to know before writing. It also discloses rejection rules (solves/pickups), read-only restrictions (auto aperture, obscurations, compound definitions), and inheritance semantics for field_set.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the atomicity rule are front-loaded, and the dense blocks on field_set and aperture constraints each add non-redundant rules. It is long, but the length tracks the real complexity of the tool; only the aperture section feels slightly compressed given how many edge cases it mentions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a batch-mutation tool with no annotations, the description covers atomicity, per-target selectors, zoom handling, field_set transaction isolation, and read-only cases. An output schema exists, so return values need not be explained, and nothing an agent needs to call this correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Top-level schema coverage is reported as 0%, but the description compensates by enumerating the per-target parameter names, the vignetting valid range (-0.99..0.99), the 1-10 field count limit of field_set, and the meaning of target=aperture/parameter=value. The nested $defs also carry their own descriptions, so this is well beyond the schema alone, though it does not restate every nested field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: batch-modifying existing surface, field, wavelength, and constrained-aperture parameters. The emphasis on '已有' (existing) parameters cleanly separates it from a structure-editing sibling like edit_lens_structure, which adds or removes optical elements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It sets concrete conditions and exclusions: solve/pickup-controlled parameters are rejected, multi-zoom lenses must supply zoom_position, field_set cannot be batched with edits, and only single-zoom angle-defined fields / single-zoom apertures are supported. It stops short of naming sibling tools (e.g. edit_lens_structure) as the alternative for structural changes, so it is context-rich but not fully routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 11 tool updatesv0.1.0
    • First observedcancel_analysis
    • First observedclose_session
    • First observedcreate_lens
    • First observededit_lens_structure
    • First observedget_analysis
    • First observedget_lens
    • First observedget_status
    • First observedopen_lens
    • First observedrun_analysis
    • First observedsave_lens_as
    • First observedupdate_lens

TDQS

A3.6/5.0

Scored across 11 tools

Disambiguation4/5

Tools mostly target distinct actions, but get_status overlaps with get_lens and get_analysis for state reporting, and open_lens vs get_lens both return lens details. update_lens and edit_lens_structure also require care to distinguish parameter edits from structural edits, though the detailed descriptions help.

Naming Consistency4/5

All names use snake_case with a verb-first pattern, e.g. get_status, open_lens, run_analysis. Minor deviations like edit_lens_structure (verb_noun_noun) and save_lens_as (preposition) keep it from perfect consistency.

Tool Count5/5

11 tools is well-scoped for a session-based optical design server, covering session lifecycle, lens open/create/read/update/structure-edit/save, and analysis run/get/cancel. Each tool appears to earn its place without redundancy.

Completeness4/5

Core workflows for simple single-zoom lenses and analyses are covered: open, create, get, update, structural edit, save as, close, and full analysis lifecycle. However, there is no delete-lens or in-place save tool, and recovery points cannot be restored, leaving minor gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients like Codex to control Ansys Workbench and ICEM CFD locally, executing scripts, managing projects, and running simulations.
    2
    MIT
  • A
    license
    C
    quality
    C
    maintenance
    Enables MCP clients to create and edit technical drawings, manage layers and geometry, process GIS/research mapping data, generate previews and layouts, and automate AutoCAD documents on Windows through COM.
    225
    50 npm
    MIT
  • A
    license
    C
    quality
    A
    maintenance
    A Windows-only MCP server that enables AI assistants to automate Ansys Zemax OpticStudio through the ZOS-API, exposing sequential and non-sequential mode, analysis, optimization, glass, tolerancing, configuration, and lifecycle operations. It supports stdio, SSE, and Streamable HTTP transports, with per-tool capability statuses distinguishing live-verified, offline-implemented, and scaffolded functionality.
    2
    143
    2
    MIT