CODE V MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| --backend | No | Backend to use. Use `com` to drive a real CODE V 10.2 session via Windows COM, or `simulated` to run without CODE V (results marked as simulated). Passed as a command-line argument, e.g. args: ["-m", "codev_mcp", "--backend", "com"]. | com |
| --working-directory | No | Writable directory used to store session state, checkpoints, and result images. Must be writable; a short, ASCII-only path is recommended. Passed as a command-line argument, e.g. args: ["--working-directory", "D:\\path\\to\\codev-mcp\\.codev-run"]. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_statusB | 返回后端类型、CODE V 版本、会话与镜头状态、当前分析任务与支持能力。 |
| open_lensC | 打开一个 .len 镜头文件的工作副本,并返回其表面、材料、单位、波长与视场。 |
| create_lensA | 在空会话中按受限球面规格新建单变焦镜头,并发布核对过的恢复点。 image_solve="pim" 给最后一个普通面的厚度加 CODE V 近轴像面求解(PIM), 请求中的厚度只是初值;求解厚度之后由 CODE V 推导,不能再直接编辑。 |
| get_lensA | 读取当前镜头的表面、材料、单位、孔径、波长、视场与变焦位置。 视场含渐晕因子 vux/vlx/vuy/vly(CODE V VUX/VLX/VUY/VLY),可经 update_lens 修改。 zoom_position 用于多变焦镜头,只影响按变焦位置取值的数据。 |
| 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 只改已有的 单一、居中、圆形显式通光孔径半径。自动孔径、遮拦和复合定义只读。 |
| edit_lens_structureB | 对本服务新建的简单镜头批量插入或删除普通球面、设置光阑,回读并核对恢复。 |
| run_analysisA | 提交一阶参数、点列图、MTF、当前焦面 WAV 或原生绘图,返回任务状态。 MTF 必须由调用方给出频率网格;原生绘图用 options.plot_type 选择类型, 由 CODE V 自己绘制并导出为 PNG。WAV 只支持单变焦镜头的全部视场和波长, 固定 NRD=20,不改变焦面。点列图与原生绘图异步执行,需要轮询 get_analysis;一阶参数、MTF 和 WAV 同步完成。同一时刻只允许一个分析任务。 |
| get_analysisB | 获取当前分析任务的状态、数值结果与图像。 结果以文本 JSON 返回,图像同时作为 MCP 图像内容返回,并在结果文件中保留副本。 |
| cancel_analysisA | 请求取消当前分析任务,并区分“已请求取消”与“确认停止”。 只对异步任务(点列图与原生绘图导出)有意义;取消原生绘图时还会关闭 CODE V 已经打开的绘图文件。 |
| save_lens_asB | 把当前工作副本另存为新文件;拒绝覆盖源文件或已存在的文件。 |
| close_sessionB | 释放本服务创建的 CODE V 会话,并返回释放后的状态。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
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.
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.
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.
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.