codev-mcp 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/NOTICE +3 -1
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/PKG-INFO +86 -9
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/README.md +84 -7
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/ROADMAP.md +35 -19
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/pyproject.toml +2 -2
- codev_mcp-0.2.0/scripts/build_mcpb.py +236 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/__init__.py +1 -1
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/server.py +81 -7
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/settings.py +7 -1
- codev_mcp-0.2.0/tests/test_approval.py +44 -0
- codev_mcp-0.2.0/tests/test_envelope.py +218 -0
- codev_mcp-0.2.0/tests/test_mcpb.py +44 -0
- codev_mcp-0.2.0/tests/test_versions.py +36 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/.gitignore +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/LICENSE +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/attach_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/coverage_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/edit_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/field_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/idle_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/mcp_client_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/monte_carlo_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/optimize_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/plot_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/reference_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/smoke_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/snapshot_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/sysdata_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/tolerance_test.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/scripts/version_check.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/__main__.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/analyses.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/build_data.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/doctor.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/edits.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/engine.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/montecarlo.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/optimize.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/paths.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/plots.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/procs.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/reference.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/snapshots.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/sysdata.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/toldata.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/src/codev_mcp/tolerance.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/conftest.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/fake_codev.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_attach.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_doctor.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_engine.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_montecarlo.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_optimize.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_parsers.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_refbuild.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_reference.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_server.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_settings.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_sysdata.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_toldata.py +0 -0
- {codev_mcp-0.1.0 → codev_mcp-0.2.0}/tests/test_tolerance.py +0 -0
|
@@ -4,7 +4,9 @@ Copyright 2026 The CodeV-mcp Authors
|
|
|
4
4
|
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
5
|
|
|
6
6
|
CodeV-mcp is an independent project. It is not affiliated with, endorsed by,
|
|
7
|
-
or sponsored by
|
|
7
|
+
or sponsored by Keysight Technologies, Inc., which has owned CODE V since
|
|
8
|
+
October 2025, or by Synopsys, Inc., its previous owner. CODE V is a trademark
|
|
9
|
+
of its owner.
|
|
8
10
|
|
|
9
11
|
This project contains no CODE V software, documentation or data. It drives a
|
|
10
12
|
separately licensed CODE V installation at run time, and the reference data it
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: codev-mcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: codev-mcp for CODE V: an unofficial MCP server that drives your licensed CODE V install over COM
|
|
5
5
|
Project-URL: Homepage, https://github.com/br24563/CodeV-mcp
|
|
6
6
|
Project-URL: Issues, https://github.com/br24563/CodeV-mcp/issues
|
|
7
7
|
Project-URL: Roadmap, https://github.com/br24563/CodeV-mcp/blob/main/ROADMAP.md
|
|
8
|
-
Author:
|
|
8
|
+
Author: Brendan Ryan
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
License-File: NOTICE
|
|
@@ -41,13 +41,65 @@ and a four-glass substitution study, and what the trial changed in the tools.
|
|
|
41
41
|
What the agent can change, what Claude asks first, how the licence is used
|
|
42
42
|
and what leaves your machine: [SECURITY.md](SECURITY.md).
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
codev-mcp is not made, endorsed or supported by Keysight Technologies, which
|
|
45
|
+
has owned CODE V since buying it from Synopsys in October 2025, nor by
|
|
46
|
+
Synopsys. CODE V is a trademark of its owner.
|
|
47
|
+
|
|
48
|
+
## Install as a Claude Code plugin
|
|
49
|
+
|
|
50
|
+
You need Windows, CODE V installed with its COM server registered (the
|
|
51
|
+
installer does this), and [uv](https://docs.astral.sh/uv/), which fetches
|
|
52
|
+
codev-mcp and a Python for it. No Python setup is needed. Install uv once:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
winget install astral-sh.uv
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then, in Claude Code:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
/plugin install codev-mcp --marketplace br24563/CodeV-mcp
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
On older Claude Code versions, run `/plugin marketplace add br24563/CodeV-mcp`
|
|
65
|
+
first, then `/plugin install codev-mcp@codev-mcp`.
|
|
66
|
+
|
|
67
|
+
The plugin brings the server, pinned to a released version on PyPI, and four
|
|
68
|
+
skills: design review, optimization loop, glass substitution and tolerancing.
|
|
69
|
+
Its settings are the idle timeout, the data folder and the CODE V install
|
|
70
|
+
folder (see [Configuration](#configuration)); leave the folders blank for the
|
|
71
|
+
defaults. Then ask Claude to build the reference data (`build_reference_data`,
|
|
72
|
+
a few minutes, no licence) so it can search the CODE V manual and glass
|
|
73
|
+
catalogs. If something does not work, ask it to run `diagnose`.
|
|
74
|
+
|
|
75
|
+
The plugin asks you before `run_command`, `start_long_command`, `save_lens`,
|
|
76
|
+
`restore_snapshot` and `delete_snapshot`, the tools that can run any CODE V
|
|
77
|
+
command, overwrite a file or discard work. It does this with a hook, because a
|
|
78
|
+
plugin cannot ship permission rules, so the prompt appears even where your own
|
|
79
|
+
rules would allow the tool. If you would rather not be asked, register the
|
|
80
|
+
server yourself (below) and write your own rules. The plugin's tools are named
|
|
81
|
+
`mcp__plugin_codev-mcp_codev__<tool>`.
|
|
82
|
+
|
|
83
|
+
## Install in Claude Desktop
|
|
84
|
+
|
|
85
|
+
On Windows with CODE V installed, download `codev-mcp-<version>.mcpb` from the
|
|
86
|
+
[latest release](https://github.com/br24563/CodeV-mcp/releases/latest) and
|
|
87
|
+
open it (if Windows asks which app to use, choose Claude), or drag it into
|
|
88
|
+
Claude Desktop. Nothing else is needed: Claude Desktop fetches a Python and
|
|
89
|
+
codev-mcp itself, so the first tool call can take a minute or two. The
|
|
90
|
+
extension's settings are the same three as the plugin's. Claude Desktop asks
|
|
91
|
+
for your approval the first time a tool is used and then remembers it, so,
|
|
92
|
+
unlike the plugin, it does not ask before every risky call (see
|
|
93
|
+
[SECURITY.md](SECURITY.md)). Desktop extensions do
|
|
94
|
+
not update themselves: install the new `.mcpb` for each release.
|
|
95
|
+
|
|
96
|
+
## Install from source
|
|
97
|
+
|
|
98
|
+
Requirements:
|
|
45
99
|
|
|
46
100
|
- Windows with CODE V installed and its COM server registered (the installer does this)
|
|
47
101
|
- Python 3.11+
|
|
48
102
|
|
|
49
|
-
## Install
|
|
50
|
-
|
|
51
103
|
```powershell
|
|
52
104
|
py -3.12 -m venv .venv
|
|
53
105
|
.venv\Scripts\python.exe -m pip install -e .
|
|
@@ -201,6 +253,14 @@ paths are kept short and relative to the starting directory.
|
|
|
201
253
|
|
|
202
254
|
## Register with Claude Code
|
|
203
255
|
|
|
256
|
+
Without the plugin, register the published package (needs uv):
|
|
257
|
+
|
|
258
|
+
```powershell
|
|
259
|
+
claude mcp add codev -- uvx codev-mcp==0.2.0
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
or a source checkout:
|
|
263
|
+
|
|
204
264
|
```powershell
|
|
205
265
|
claude mcp add codev -- C:\full\path\to\.venv\Scripts\python.exe -m codev_mcp
|
|
206
266
|
```
|
|
@@ -259,6 +319,20 @@ An ask rule still asks under `bypassPermissions`. In a headless run
|
|
|
259
319
|
|
|
260
320
|
## Tools
|
|
261
321
|
|
|
322
|
+
Every tool returns a JSON object (for `plot`, the first content item) with at
|
|
323
|
+
least these keys:
|
|
324
|
+
|
|
325
|
+
| Key | Meaning |
|
|
326
|
+
|---|---|
|
|
327
|
+
| `ok` | `true` if the call did what was asked |
|
|
328
|
+
| `errors` | Error messages CODE V raised during the call (empty for tools that do not use CODE V) |
|
|
329
|
+
| `warnings` | Warning messages CODE V raised, or setting problems for `session_status` |
|
|
330
|
+
| `error_detail` | Present when `ok` is `false`: what went wrong, in one message |
|
|
331
|
+
|
|
332
|
+
`ok` can be `true` with warnings, since CODE V often accepts a command and
|
|
333
|
+
only warns. Some failures also carry an older key (`error` or `exception`);
|
|
334
|
+
`error_detail` always holds the message, so read that one.
|
|
335
|
+
|
|
262
336
|
| Tool | Purpose |
|
|
263
337
|
|---|---|
|
|
264
338
|
| `attach_to_window` / `detach_from_window` | Drive your open CODE V window instead of a background session; detaching leaves it open |
|
|
@@ -293,8 +367,9 @@ An ask rule still asks under `bypassPermissions`. In a headless run
|
|
|
293
367
|
|
|
294
368
|
The reference tools never start CODE V.
|
|
295
369
|
|
|
296
|
-
|
|
297
|
-
|
|
370
|
+
In tools that use CODE V, `errors` and `warnings` (and `plots`, the plot
|
|
371
|
+
files written) come from CODE V's COM events, so the agent can tell "ran"
|
|
372
|
+
from "ran cleanly".
|
|
298
373
|
|
|
299
374
|
CODE V is started on the first tool call that needs it, not when the server starts.
|
|
300
375
|
|
|
@@ -306,6 +381,7 @@ CODE V is started on the first tool call that needs it, not when the server star
|
|
|
306
381
|
| `CODEV_START_DIR` | `<data folder>\work` | CODE V starting directory; snapshots and plots are kept under it. Snapshots from the earlier `%TEMP%\codev-mcp` default are copied here on first use |
|
|
307
382
|
| `CODEV_DIR` | from the COM registration | CODE V install folder used by the reference build |
|
|
308
383
|
| `CODEV_IDLE_MINUTES` | `20` | Release the licence seat after this long without a tool call; `0` turns it off |
|
|
384
|
+
| `CODEV_REQUIRE_APPROVAL` | off | `1` marks `run_command`, `start_long_command`, `save_lens`, `restore_snapshot` and `delete_snapshot` as needing the user's approval on every call (`anthropic/requiresUserInteraction`). Claude Code honours it, even in auto mode; Claude Desktop currently does not. The Desktop Extension sets it; the plugin uses its ask hook instead |
|
|
309
385
|
| `CODEV_MCP_DATA` | `%USERPROFILE%\codev-mcp` | The data folder: reference database and the default working folder. A database built under the earlier `%LOCALAPPDATA%\codev-mcp` default is still read if none exists here |
|
|
310
386
|
|
|
311
387
|
Avoid pointing either folder into `%LOCALAPPDATA%` or `%APPDATA%`. When the
|
|
@@ -363,8 +439,9 @@ and vendor material stays out) and [ROADMAP.md](ROADMAP.md).
|
|
|
363
439
|
|
|
364
440
|
Apache License 2.0; see [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
365
441
|
|
|
366
|
-
This is an independent project, not affiliated with or endorsed by
|
|
367
|
-
CODE V
|
|
442
|
+
This is an independent project, not affiliated with or endorsed by Keysight
|
|
443
|
+
Technologies (CODE V's owner since October 2025) or Synopsys (its previous
|
|
444
|
+
owner). CODE V is a trademark of its owner. The repository contains no CODE V
|
|
368
445
|
software, documentation or data: the server drives your own licensed install,
|
|
369
446
|
and the reference data it builds stays on your machine. Please keep
|
|
370
447
|
vendor-derived material (manual text, glass catalogues, CODE V lens files) out
|
|
@@ -13,13 +13,65 @@ and a four-glass substitution study, and what the trial changed in the tools.
|
|
|
13
13
|
What the agent can change, what Claude asks first, how the licence is used
|
|
14
14
|
and what leaves your machine: [SECURITY.md](SECURITY.md).
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
codev-mcp is not made, endorsed or supported by Keysight Technologies, which
|
|
17
|
+
has owned CODE V since buying it from Synopsys in October 2025, nor by
|
|
18
|
+
Synopsys. CODE V is a trademark of its owner.
|
|
19
|
+
|
|
20
|
+
## Install as a Claude Code plugin
|
|
21
|
+
|
|
22
|
+
You need Windows, CODE V installed with its COM server registered (the
|
|
23
|
+
installer does this), and [uv](https://docs.astral.sh/uv/), which fetches
|
|
24
|
+
codev-mcp and a Python for it. No Python setup is needed. Install uv once:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
winget install astral-sh.uv
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then, in Claude Code:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
/plugin install codev-mcp --marketplace br24563/CodeV-mcp
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
On older Claude Code versions, run `/plugin marketplace add br24563/CodeV-mcp`
|
|
37
|
+
first, then `/plugin install codev-mcp@codev-mcp`.
|
|
38
|
+
|
|
39
|
+
The plugin brings the server, pinned to a released version on PyPI, and four
|
|
40
|
+
skills: design review, optimization loop, glass substitution and tolerancing.
|
|
41
|
+
Its settings are the idle timeout, the data folder and the CODE V install
|
|
42
|
+
folder (see [Configuration](#configuration)); leave the folders blank for the
|
|
43
|
+
defaults. Then ask Claude to build the reference data (`build_reference_data`,
|
|
44
|
+
a few minutes, no licence) so it can search the CODE V manual and glass
|
|
45
|
+
catalogs. If something does not work, ask it to run `diagnose`.
|
|
46
|
+
|
|
47
|
+
The plugin asks you before `run_command`, `start_long_command`, `save_lens`,
|
|
48
|
+
`restore_snapshot` and `delete_snapshot`, the tools that can run any CODE V
|
|
49
|
+
command, overwrite a file or discard work. It does this with a hook, because a
|
|
50
|
+
plugin cannot ship permission rules, so the prompt appears even where your own
|
|
51
|
+
rules would allow the tool. If you would rather not be asked, register the
|
|
52
|
+
server yourself (below) and write your own rules. The plugin's tools are named
|
|
53
|
+
`mcp__plugin_codev-mcp_codev__<tool>`.
|
|
54
|
+
|
|
55
|
+
## Install in Claude Desktop
|
|
56
|
+
|
|
57
|
+
On Windows with CODE V installed, download `codev-mcp-<version>.mcpb` from the
|
|
58
|
+
[latest release](https://github.com/br24563/CodeV-mcp/releases/latest) and
|
|
59
|
+
open it (if Windows asks which app to use, choose Claude), or drag it into
|
|
60
|
+
Claude Desktop. Nothing else is needed: Claude Desktop fetches a Python and
|
|
61
|
+
codev-mcp itself, so the first tool call can take a minute or two. The
|
|
62
|
+
extension's settings are the same three as the plugin's. Claude Desktop asks
|
|
63
|
+
for your approval the first time a tool is used and then remembers it, so,
|
|
64
|
+
unlike the plugin, it does not ask before every risky call (see
|
|
65
|
+
[SECURITY.md](SECURITY.md)). Desktop extensions do
|
|
66
|
+
not update themselves: install the new `.mcpb` for each release.
|
|
67
|
+
|
|
68
|
+
## Install from source
|
|
69
|
+
|
|
70
|
+
Requirements:
|
|
17
71
|
|
|
18
72
|
- Windows with CODE V installed and its COM server registered (the installer does this)
|
|
19
73
|
- Python 3.11+
|
|
20
74
|
|
|
21
|
-
## Install
|
|
22
|
-
|
|
23
75
|
```powershell
|
|
24
76
|
py -3.12 -m venv .venv
|
|
25
77
|
.venv\Scripts\python.exe -m pip install -e .
|
|
@@ -173,6 +225,14 @@ paths are kept short and relative to the starting directory.
|
|
|
173
225
|
|
|
174
226
|
## Register with Claude Code
|
|
175
227
|
|
|
228
|
+
Without the plugin, register the published package (needs uv):
|
|
229
|
+
|
|
230
|
+
```powershell
|
|
231
|
+
claude mcp add codev -- uvx codev-mcp==0.2.0
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
or a source checkout:
|
|
235
|
+
|
|
176
236
|
```powershell
|
|
177
237
|
claude mcp add codev -- C:\full\path\to\.venv\Scripts\python.exe -m codev_mcp
|
|
178
238
|
```
|
|
@@ -231,6 +291,20 @@ An ask rule still asks under `bypassPermissions`. In a headless run
|
|
|
231
291
|
|
|
232
292
|
## Tools
|
|
233
293
|
|
|
294
|
+
Every tool returns a JSON object (for `plot`, the first content item) with at
|
|
295
|
+
least these keys:
|
|
296
|
+
|
|
297
|
+
| Key | Meaning |
|
|
298
|
+
|---|---|
|
|
299
|
+
| `ok` | `true` if the call did what was asked |
|
|
300
|
+
| `errors` | Error messages CODE V raised during the call (empty for tools that do not use CODE V) |
|
|
301
|
+
| `warnings` | Warning messages CODE V raised, or setting problems for `session_status` |
|
|
302
|
+
| `error_detail` | Present when `ok` is `false`: what went wrong, in one message |
|
|
303
|
+
|
|
304
|
+
`ok` can be `true` with warnings, since CODE V often accepts a command and
|
|
305
|
+
only warns. Some failures also carry an older key (`error` or `exception`);
|
|
306
|
+
`error_detail` always holds the message, so read that one.
|
|
307
|
+
|
|
234
308
|
| Tool | Purpose |
|
|
235
309
|
|---|---|
|
|
236
310
|
| `attach_to_window` / `detach_from_window` | Drive your open CODE V window instead of a background session; detaching leaves it open |
|
|
@@ -265,8 +339,9 @@ An ask rule still asks under `bypassPermissions`. In a headless run
|
|
|
265
339
|
|
|
266
340
|
The reference tools never start CODE V.
|
|
267
341
|
|
|
268
|
-
|
|
269
|
-
|
|
342
|
+
In tools that use CODE V, `errors` and `warnings` (and `plots`, the plot
|
|
343
|
+
files written) come from CODE V's COM events, so the agent can tell "ran"
|
|
344
|
+
from "ran cleanly".
|
|
270
345
|
|
|
271
346
|
CODE V is started on the first tool call that needs it, not when the server starts.
|
|
272
347
|
|
|
@@ -278,6 +353,7 @@ CODE V is started on the first tool call that needs it, not when the server star
|
|
|
278
353
|
| `CODEV_START_DIR` | `<data folder>\work` | CODE V starting directory; snapshots and plots are kept under it. Snapshots from the earlier `%TEMP%\codev-mcp` default are copied here on first use |
|
|
279
354
|
| `CODEV_DIR` | from the COM registration | CODE V install folder used by the reference build |
|
|
280
355
|
| `CODEV_IDLE_MINUTES` | `20` | Release the licence seat after this long without a tool call; `0` turns it off |
|
|
356
|
+
| `CODEV_REQUIRE_APPROVAL` | off | `1` marks `run_command`, `start_long_command`, `save_lens`, `restore_snapshot` and `delete_snapshot` as needing the user's approval on every call (`anthropic/requiresUserInteraction`). Claude Code honours it, even in auto mode; Claude Desktop currently does not. The Desktop Extension sets it; the plugin uses its ask hook instead |
|
|
281
357
|
| `CODEV_MCP_DATA` | `%USERPROFILE%\codev-mcp` | The data folder: reference database and the default working folder. A database built under the earlier `%LOCALAPPDATA%\codev-mcp` default is still read if none exists here |
|
|
282
358
|
|
|
283
359
|
Avoid pointing either folder into `%LOCALAPPDATA%` or `%APPDATA%`. When the
|
|
@@ -335,8 +411,9 @@ and vendor material stays out) and [ROADMAP.md](ROADMAP.md).
|
|
|
335
411
|
|
|
336
412
|
Apache License 2.0; see [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
337
413
|
|
|
338
|
-
This is an independent project, not affiliated with or endorsed by
|
|
339
|
-
CODE V
|
|
414
|
+
This is an independent project, not affiliated with or endorsed by Keysight
|
|
415
|
+
Technologies (CODE V's owner since October 2025) or Synopsys (its previous
|
|
416
|
+
owner). CODE V is a trademark of its owner. The repository contains no CODE V
|
|
340
417
|
software, documentation or data: the server drives your own licensed install,
|
|
341
418
|
and the reference data it builds stays on your machine. Please keep
|
|
342
419
|
vendor-derived material (manual text, glass catalogues, CODE V lens files) out
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
The long-term goal is for this to become an official Claude connector for
|
|
4
4
|
CODE V. Two facts shape the plan:
|
|
5
5
|
|
|
6
|
-
- **"Official" needs
|
|
6
|
+
- **"Official" needs Keysight.** Keysight Technologies has owned CODE V
|
|
7
|
+
since buying Synopsys's Optical Solutions Group in October 2025, and an
|
|
7
8
|
official connector would normally be published or endorsed by the vendor.
|
|
8
|
-
Reviewers also cannot test it without a CODE V licence
|
|
9
|
-
|
|
9
|
+
Reviewers also cannot test it without a CODE V licence, and Keysight's EULA
|
|
10
|
+
bars third parties from using a customer's (section 4.6). The realistic
|
|
11
|
+
path is a project good enough that Keysight wants to adopt or sponsor it.
|
|
10
12
|
- **It ships as a local extension, not a remote connector.** The server drives
|
|
11
13
|
CODE V over COM on the user's Windows machine, so it is distributed as a
|
|
12
14
|
Claude Desktop Extension (`.mcpb`), a Claude Code plugin, and a listing in
|
|
@@ -37,7 +39,7 @@ Works reliably on other lenses and other machines.
|
|
|
37
39
|
- [x] GitHub Actions running the unit tests on every push.
|
|
38
40
|
- [x] MCP tool annotations (read-only, destructive, idempotent hints).
|
|
39
41
|
- [x] Packaging ready for PyPI; publishing itself still to do.
|
|
40
|
-
- [
|
|
42
|
+
- [x] Publish to PyPI (trusted publishing from a release tag): 0.1.0, as the
|
|
41
43
|
first step of Phase 3.
|
|
42
44
|
- [x] `codev-mcp-doctor`: checks install, COM registration, AppData
|
|
43
45
|
redirection, data folder, reference data, leftover processes, and
|
|
@@ -90,36 +92,41 @@ decisions in [docs/adr/](docs/adr/). Order:
|
|
|
90
92
|
Claude Code plugin marketplace and the MCP Registry. Two findings changed
|
|
91
93
|
the plan: the directory no longer accepts `.mcpb` submissions, and plugins
|
|
92
94
|
cannot ship permission rules.
|
|
93
|
-
- [
|
|
95
|
+
- [x] Publish 0.1.0 to PyPI (the Phase 1 item), with an `mcp-name` line in
|
|
94
96
|
the README for the Registry's ownership check.
|
|
95
|
-
- [
|
|
97
|
+
- [x] MCP Registry listing as `io.github.br24563/codev-mcp`, published from
|
|
96
98
|
the release workflow.
|
|
97
|
-
- [
|
|
99
|
+
- [x] Claude Code plugin `codev-mcp` (server key `codev`), with this
|
|
98
100
|
repository as its marketplace: server through a pinned `uvx`, the skills,
|
|
99
101
|
and a `PreToolUse` ask hook in place of the ask rules
|
|
100
102
|
([ADR 0001](docs/adr/0001-plugin-asks-through-a-hook.md)). Its one
|
|
101
|
-
prerequisite is `uv`.
|
|
102
|
-
- [
|
|
103
|
+
prerequisite is `uv`. pywin32 works when uv installs it.
|
|
104
|
+
- [x] Desktop Extension (`.mcpb`, `server.type: "uv"`), Windows-only,
|
|
103
105
|
attached to each GitHub release and added to the Registry listing, not
|
|
104
106
|
submitted to the directory
|
|
105
107
|
([ADR 0002](docs/adr/0002-desktop-extension-outside-the-directory.md)).
|
|
106
|
-
It relies on Claude Desktop's own tool approval.
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
It relies on Claude Desktop's own tool approval. Built by
|
|
109
|
+
`scripts/build_mcpb.py`; it pins the PyPI release, so Desktop runs the
|
|
110
|
+
published package. (pywin32 works under uv, so no PyInstaller fallback.)
|
|
111
|
+
Checked in Claude Desktop: manifest 0.4 and the uv runtime are accepted,
|
|
112
|
+
settings arrive. Desktop asks before a tool's first use and remembers the
|
|
113
|
+
answer across reinstalls; it ignores `requiresUserInteraction`, so unlike
|
|
114
|
+
the plugin it does not ask before every risky call.
|
|
115
|
+
- [x] Settings in every channel: idle timeout, data folder, and an optional
|
|
109
116
|
CODE V install folder for the reference build
|
|
110
117
|
([ADR 0003](docs/adr/0003-no-codev-path-setting.md)).
|
|
111
|
-
- [
|
|
118
|
+
- [x] No terminal steps: `build_reference_data` and `diagnose` tools.
|
|
112
119
|
- [ ] Licence seat on disconnect: measure whether a server ended 300 ms after
|
|
113
120
|
disconnect leaves CODE V holding a seat; if so, end orphaned CODE V
|
|
114
121
|
processes on the next start.
|
|
115
122
|
- [ ] One `v*` tag publishes PyPI, the `.mcpb` and the Registry listing, with
|
|
116
123
|
versions in lockstep.
|
|
117
|
-
- [
|
|
124
|
+
- [x] `SECURITY.md`: what the agent can change, what is asked first, licence
|
|
118
125
|
seats, that nothing leaves the machine except tool results Claude sees,
|
|
119
126
|
and how to report a vulnerability.
|
|
120
127
|
- [ ] README rewritten as the documentation page, around the channels.
|
|
121
128
|
- [ ] Name "codev-mcp for CODE V", marked unofficial and not affiliated with
|
|
122
|
-
Synopsys in every listing. A short video is optional.
|
|
129
|
+
Keysight or Synopsys in every listing. A short video is optional.
|
|
123
130
|
|
|
124
131
|
**Done when** a Windows account with CODE V and no Python installs
|
|
125
132
|
codev-mcp from the plugin marketplace and from the `.mcpb`, runs a design
|
|
@@ -127,17 +134,26 @@ review with no terminal step, and the Registry listing is live.
|
|
|
127
134
|
|
|
128
135
|
## Phase 4: toward official status
|
|
129
136
|
|
|
130
|
-
-
|
|
131
|
-
|
|
137
|
+
- Get Keysight's position on its EULA (May 2025, doc 5991-3402): written
|
|
138
|
+
consent under section 5.2, which bars integrating or combining the
|
|
139
|
+
Software with third-party software without it; and whether section 4.4,
|
|
140
|
+
which bars using the Software (defined to include its documentation and
|
|
141
|
+
data) as prompt-based input to a generative AI program, covers
|
|
142
|
+
`search_manual`, `read_manual_page` and the glass lookups. Ask about the
|
|
143
|
+
name "codev-mcp" at the same time.
|
|
144
|
+
- Approach Keysight with demo results, the safety design (read-back,
|
|
132
145
|
snapshots, ask rules, licence handling) and early users: adoption,
|
|
133
146
|
co-maintenance, sponsorship, or a reference for their own connector.
|
|
134
|
-
- With
|
|
147
|
+
- With Keysight involved, submit the plugin to Anthropic's directory (which
|
|
135
148
|
no longer accepts `.mcpb` extensions), with a test licence for reviewers:
|
|
136
149
|
its policy expects reviewers to test every tool.
|
|
137
150
|
- Support channel, a table of supported CODE V versions, a release cadence.
|
|
138
151
|
|
|
139
152
|
## Risks
|
|
140
153
|
|
|
141
|
-
-
|
|
154
|
+
- Keysight's EULA: sections 5.2 (integration with third-party software) and
|
|
155
|
+
4.4 (prompt input to generative AI) read literally against this project.
|
|
156
|
+
The largest unknown. A site's separate signed agreement, or an older
|
|
157
|
+
Synopsys-era contract, may override it.
|
|
142
158
|
- Most testing needs a CODE V licence, so CI covers only the unit layer.
|
|
143
159
|
- Windows-only, single maintainer.
|
|
@@ -4,13 +4,13 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codev-mcp"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "codev-mcp for CODE V: an unofficial MCP server that drives your licensed CODE V install over COM"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
license = "Apache-2.0"
|
|
12
12
|
license-files = ["LICENSE", "NOTICE"]
|
|
13
|
-
authors = [{ name = "
|
|
13
|
+
authors = [{ name = "Brendan Ryan" }]
|
|
14
14
|
keywords = ["mcp", "model-context-protocol", "code-v", "optical-design", "lens-design", "claude"]
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Development Status :: 3 - Alpha",
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"""Build the Claude Desktop extension (.mcpb) for the version in pyproject.toml.
|
|
2
|
+
|
|
3
|
+
.venv\\Scripts\\python.exe scripts\\build_mcpb.py [--out dist] [--schema mcpb-manifest-v0.4.schema.json]
|
|
4
|
+
.venv\\Scripts\\python.exe scripts\\build_mcpb.py --dev-wheel # test build from this checkout
|
|
5
|
+
|
|
6
|
+
The bundle uses MCPB's ``uv`` server type (manifest 0.4): Claude Desktop
|
|
7
|
+
provides uv, which fetches a Python and installs the dependencies. The bundle
|
|
8
|
+
holds no codev-mcp source. Its ``pyproject.toml`` pins ``codev-mcp`` at this
|
|
9
|
+
version from PyPI, and ``src/server.py`` starts it, so Desktop runs exactly the
|
|
10
|
+
published package. That means the version must be on PyPI before the bundle
|
|
11
|
+
works, as the release workflow ensures.
|
|
12
|
+
|
|
13
|
+
The manifest's tool list is read from the server itself, so it cannot drift.
|
|
14
|
+
With ``--schema`` the manifest is also checked against MCPB's JSON schema
|
|
15
|
+
(needs ``jsonschema``).
|
|
16
|
+
|
|
17
|
+
With ``--dev-wheel`` the bundle instead carries a wheel built from this
|
|
18
|
+
checkout and installs codev-mcp from it, for testing unreleased changes in
|
|
19
|
+
Claude Desktop. Never attach a dev build to a release.
|
|
20
|
+
|
|
21
|
+
Prints the bundle's path and SHA-256 (the MCP Registry's ``fileSha256``).
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
import argparse
|
|
27
|
+
import asyncio
|
|
28
|
+
import hashlib
|
|
29
|
+
import json
|
|
30
|
+
import re
|
|
31
|
+
import subprocess
|
|
32
|
+
import sys
|
|
33
|
+
import tempfile
|
|
34
|
+
import tomllib
|
|
35
|
+
import zipfile
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
|
|
38
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
39
|
+
REPO = "https://github.com/br24563/CodeV-mcp"
|
|
40
|
+
|
|
41
|
+
SERVER_PY = '''\
|
|
42
|
+
"""Start codev-mcp, installed by uv from PyPI (see pyproject.toml)."""
|
|
43
|
+
|
|
44
|
+
from codev_mcp.server import main
|
|
45
|
+
|
|
46
|
+
main()
|
|
47
|
+
'''
|
|
48
|
+
|
|
49
|
+
PYPROJECT = '''\
|
|
50
|
+
# Installed by Claude Desktop's uv; no build system, so this folder is not
|
|
51
|
+
# packaged itself. codev-mcp is pinned to the release this bundle belongs to.
|
|
52
|
+
[project]
|
|
53
|
+
name = "codev-mcp-desktop-extension"
|
|
54
|
+
version = "{version}"
|
|
55
|
+
description = "Claude Desktop extension wrapper for codev-mcp {version}"
|
|
56
|
+
requires-python = ">=3.11"
|
|
57
|
+
dependencies = ["codev-mcp=={version}"]
|
|
58
|
+
'''
|
|
59
|
+
|
|
60
|
+
DEV_PYPROJECT = '''\
|
|
61
|
+
# DEV BUILD: codev-mcp comes from the wheel in this bundle, built from a
|
|
62
|
+
# checkout, not from PyPI. For testing only.
|
|
63
|
+
[project]
|
|
64
|
+
name = "codev-mcp-desktop-extension"
|
|
65
|
+
version = "{version}"
|
|
66
|
+
description = "Claude Desktop extension wrapper for codev-mcp (dev build)"
|
|
67
|
+
requires-python = ">=3.11"
|
|
68
|
+
dependencies = ["codev-mcp"]
|
|
69
|
+
|
|
70
|
+
[tool.uv.sources]
|
|
71
|
+
codev-mcp = {{ path = "wheels/{wheel}" }}
|
|
72
|
+
'''
|
|
73
|
+
|
|
74
|
+
LONG_DESCRIPTION = """\
|
|
75
|
+
codev-mcp lets Claude drive your own licensed CODE V install over its COM API: \
|
|
76
|
+
open and edit lenses with every change read back, run analyses (spot size, \
|
|
77
|
+
wavefront, MTF, distortion), optimize with typed constraints, tolerance with TOR \
|
|
78
|
+
and Monte Carlo, plot, and search your CODE V manual and glass catalogs.
|
|
79
|
+
|
|
80
|
+
Windows only. Needs CODE V installed with its COM server registered. Any tool \
|
|
81
|
+
that needs CODE V takes a licence seat, released after the idle timeout.
|
|
82
|
+
|
|
83
|
+
After installing, ask Claude to run `build_reference_data` once (a few minutes, \
|
|
84
|
+
no licence) so it can search the manual and glass catalogs, and `diagnose` if \
|
|
85
|
+
something does not work. See SECURITY.md for what the agent can change and what \
|
|
86
|
+
leaves your machine.
|
|
87
|
+
|
|
88
|
+
Unofficial: codev-mcp is not made, endorsed or supported by Keysight Technologies \
|
|
89
|
+
(CODE V's owner since October 2025) or Synopsys (its previous owner). CODE V is a \
|
|
90
|
+
trademark of its owner."""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def project_version() -> str:
|
|
94
|
+
return tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))["project"]["version"]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def server_tools() -> list[dict]:
|
|
98
|
+
sys.path.insert(0, str(ROOT / "src"))
|
|
99
|
+
from codev_mcp import server
|
|
100
|
+
|
|
101
|
+
try:
|
|
102
|
+
tools = asyncio.run(server.mcp.list_tools())
|
|
103
|
+
finally:
|
|
104
|
+
server.engine.shutdown()
|
|
105
|
+
return [{"name": t.name, "description": (t.description or "").strip().splitlines()[0]} for t in tools]
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def manifest(version: str, tools: list[dict]) -> dict:
|
|
109
|
+
return {
|
|
110
|
+
"manifest_version": "0.4",
|
|
111
|
+
"name": "codev-mcp",
|
|
112
|
+
"display_name": "codev-mcp for CODE V",
|
|
113
|
+
"version": version,
|
|
114
|
+
"description": "Unofficial: lets Claude drive your licensed CODE V install over COM. Windows only.",
|
|
115
|
+
"long_description": LONG_DESCRIPTION,
|
|
116
|
+
"author": {"name": "Brendan Ryan", "url": REPO},
|
|
117
|
+
"repository": {"type": "git", "url": REPO},
|
|
118
|
+
"homepage": REPO,
|
|
119
|
+
"documentation": f"{REPO}#readme",
|
|
120
|
+
"support": f"{REPO}/issues",
|
|
121
|
+
"license": "Apache-2.0",
|
|
122
|
+
"keywords": ["code-v", "optical-design", "lens-design"],
|
|
123
|
+
"privacy_policies": [f"{REPO}/blob/main/SECURITY.md"],
|
|
124
|
+
"server": {
|
|
125
|
+
"type": "uv",
|
|
126
|
+
"entry_point": "src/server.py",
|
|
127
|
+
"mcp_config": {
|
|
128
|
+
"command": "uv",
|
|
129
|
+
"args": ["run", "--directory", "${__dirname}", "src/server.py"],
|
|
130
|
+
"env": {
|
|
131
|
+
# Ask before every call to the risky tools (Desktop has no ask hook).
|
|
132
|
+
"CODEV_REQUIRE_APPROVAL": "1",
|
|
133
|
+
"CODEV_IDLE_MINUTES": "${user_config.idle_minutes}",
|
|
134
|
+
"CODEV_MCP_DATA": "${user_config.data_folder}",
|
|
135
|
+
"CODEV_DIR": "${user_config.codev_dir}",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
"tools": tools,
|
|
140
|
+
"tools_generated": False,
|
|
141
|
+
"compatibility": {"platforms": ["win32"], "runtimes": {"python": ">=3.11"}},
|
|
142
|
+
"user_config": {
|
|
143
|
+
"idle_minutes": {
|
|
144
|
+
"type": "number",
|
|
145
|
+
"title": "Idle timeout (minutes)",
|
|
146
|
+
"description": "Minutes without a tool call before CODE V is stopped to free the licence seat. "
|
|
147
|
+
"0 turns this off.",
|
|
148
|
+
"default": 20,
|
|
149
|
+
"min": 0,
|
|
150
|
+
"required": False,
|
|
151
|
+
},
|
|
152
|
+
"data_folder": {
|
|
153
|
+
"type": "directory",
|
|
154
|
+
"title": "Data folder",
|
|
155
|
+
"description": "Where snapshots, plots and the reference data go. Leave blank for codev-mcp in "
|
|
156
|
+
"your user folder. Not under AppData, which CODE V cannot see from here.",
|
|
157
|
+
"required": False,
|
|
158
|
+
},
|
|
159
|
+
"codev_dir": {
|
|
160
|
+
"type": "directory",
|
|
161
|
+
"title": "CODE V install folder",
|
|
162
|
+
"description": "Used only to build the reference data. Leave blank to find it from CODE V's COM "
|
|
163
|
+
"registration.",
|
|
164
|
+
"required": False,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def check_schema(doc: dict, schema_path: Path) -> None:
|
|
171
|
+
import jsonschema
|
|
172
|
+
|
|
173
|
+
schema = json.loads(schema_path.read_text(encoding="utf-8"))
|
|
174
|
+
jsonschema.validators.validator_for(schema)(schema).validate(doc)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def dev_wheel() -> tuple[str, bytes]:
|
|
178
|
+
"""Build a wheel from this checkout: (file name, bytes)."""
|
|
179
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
180
|
+
subprocess.run([sys.executable, "-m", "build", "--wheel", "--outdir", tmp, str(ROOT)],
|
|
181
|
+
check=True, capture_output=True)
|
|
182
|
+
[wheel] = Path(tmp).glob("*.whl")
|
|
183
|
+
return wheel.name, wheel.read_bytes()
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def build(out_dir: Path, schema: Path | None = None, dev: bool = False) -> tuple[Path, str]:
|
|
187
|
+
version = project_version()
|
|
188
|
+
if not re.fullmatch(r"\d+\.\d+\.\d+([a-z0-9.+-]*)?", version):
|
|
189
|
+
raise SystemExit(f"unexpected version {version!r} in pyproject.toml")
|
|
190
|
+
doc = manifest(version, server_tools())
|
|
191
|
+
binary: dict[str, bytes] = {}
|
|
192
|
+
if dev:
|
|
193
|
+
wheel_name, wheel_bytes = dev_wheel()
|
|
194
|
+
binary[f"wheels/{wheel_name}"] = wheel_bytes
|
|
195
|
+
doc["display_name"] += " (dev build)"
|
|
196
|
+
pyproject = DEV_PYPROJECT.format(version=version, wheel=wheel_name)
|
|
197
|
+
else:
|
|
198
|
+
pyproject = PYPROJECT.format(version=version)
|
|
199
|
+
if schema:
|
|
200
|
+
check_schema(doc, schema)
|
|
201
|
+
files = {
|
|
202
|
+
"manifest.json": json.dumps(doc, indent=2) + "\n",
|
|
203
|
+
"pyproject.toml": pyproject,
|
|
204
|
+
"src/server.py": SERVER_PY,
|
|
205
|
+
"README.md": (ROOT / "README.md").read_text(encoding="utf-8"),
|
|
206
|
+
"SECURITY.md": (ROOT / "SECURITY.md").read_text(encoding="utf-8"),
|
|
207
|
+
"LICENSE": (ROOT / "LICENSE").read_text(encoding="utf-8"),
|
|
208
|
+
"NOTICE": (ROOT / "NOTICE").read_text(encoding="utf-8"),
|
|
209
|
+
}
|
|
210
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
211
|
+
path = out_dir / f"codev-mcp-{version}{'-dev' if dev else ''}.mcpb"
|
|
212
|
+
# Fixed timestamps and order, so the same inputs give the same bytes and SHA-256.
|
|
213
|
+
with zipfile.ZipFile(path, "w", zipfile.ZIP_DEFLATED) as z:
|
|
214
|
+
contents = {name: text.replace("\r\n", "\n").encode() for name, text in files.items()} | binary
|
|
215
|
+
for name in sorted(contents):
|
|
216
|
+
info = zipfile.ZipInfo(name, date_time=(2020, 1, 1, 0, 0, 0))
|
|
217
|
+
info.compress_type = zipfile.ZIP_DEFLATED
|
|
218
|
+
info.external_attr = 0o644 << 16
|
|
219
|
+
z.writestr(info, contents[name])
|
|
220
|
+
return path, hashlib.sha256(path.read_bytes()).hexdigest()
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def main(argv: list[str] | None = None) -> int:
|
|
224
|
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
225
|
+
ap.add_argument("--out", default="dist", help="output folder (default: dist)")
|
|
226
|
+
ap.add_argument("--schema", type=Path, help="MCPB manifest JSON schema to validate against")
|
|
227
|
+
ap.add_argument("--dev-wheel", action="store_true",
|
|
228
|
+
help="test build: install codev-mcp from a wheel of this checkout, not PyPI")
|
|
229
|
+
args = ap.parse_args(argv)
|
|
230
|
+
path, sha = build(Path(args.out), args.schema, args.dev_wheel)
|
|
231
|
+
print(json.dumps({"path": str(path), "sha256": sha}))
|
|
232
|
+
return 0
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
if __name__ == "__main__":
|
|
236
|
+
raise SystemExit(main())
|