Skip to content

Commit ebcd474

Browse files
committed
feat(claude): prefer workspace runtimes and poetry envs before global launchers
1 parent 333ccc8 commit ebcd474

File tree

10 files changed

+654
-39
lines changed

10 files changed

+654
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
projections.
1212
- Make baseline mismatch handling more explicit in MCP and the VS Code client by surfacing baseline/runtime python tags
1313
and whether comparison is proceeding without a valid baseline.
14-
- Make the Codex plugin prefer workspace-local launchers before `PATH`, with Poetry environment fallback for
14+
- Make the Claude Desktop bundle and Codex plugin prefer workspace-local launchers before `PATH`, with Poetry environment fallback for
1515
python-tag-safe MCP startup.
16+
- Add `workspace_root` user-config field to the Claude Desktop bundle: setting it to the project directory forces the
17+
launcher to prefer `.venv` inside that path even when Claude Desktop starts with a different working directory
18+
(fixes python-tag mismatch caused by system-wide interpreter fallback).
1619
- Refresh branch metadata and client docs for the `2.0.0b5` line.
1720
- Update the README repository health badge to `87 (B)`.
1821

docs/book/22-claude-desktop-bundle.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ The wrapper:
5757
5. proxies stdio until shutdown
5858

5959
The wrapper may auto-discover a few common global install locations, but it is
60-
primarily designed for:
60+
now prefers:
6161

62-
- `codeclone-mcp` on `PATH`
62+
- a workspace-local `.venv`
63+
- the active Poetry environment for the current workspace
64+
- user-local install locations and `PATH`
6365
- or an explicit launcher command in bundle settings
6466

65-
Repository-local virtual environments are intentionally outside the default
66-
bundle contract.
67+
This keeps the launcher closer to the active project Python when possible.
6768

6869
## Design rules
6970

docs/claude-desktop-bundle.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,30 @@ production-first structural review.
1010

1111
## Install
1212

13+
The bundle prefers the current workspace launcher first:
14+
15+
1. `./.venv/bin/codeclone-mcp`
16+
2. the current Poetry environment launcher
17+
3. user-local install paths and `PATH`
18+
19+
```bash
20+
uv venv
21+
uv pip install --python .venv/bin/python "codeclone[mcp]>=2.0.0b4"
22+
.venv/bin/codeclone-mcp --help
23+
```
24+
25+
Global fallback:
26+
1327
```bash
14-
uv tool install --pre "codeclone[mcp]" # or: uv pip install --pre "codeclone[mcp]"
15-
codeclone-mcp --help # verify
28+
uv tool install "codeclone[mcp]>=2.0.0b4"
29+
codeclone-mcp --help
1630
```
1731

1832
## Bundle workflow
1933

2034
1. Build: `cd extensions/claude-desktop-codeclone && node scripts/build-mcpb.mjs`
2135
2. Claude Desktop: **Settings → Extensions → Install Extension** → select `.mcpb`
22-
3. If `codeclone-mcp` is not on `PATH`, set **CodeClone launcher command** in
36+
3. If you want to bypass auto-discovery, set **CodeClone launcher command** in
2337
the bundle settings to an absolute path.
2438

2539
## Settings
@@ -31,9 +45,9 @@ codeclone-mcp --help # verify
3145

3246
## Runtime model
3347

34-
Node wrapper launches `codeclone-mcp` via local `stdio`. Auto-discovers the
35-
launcher in `~/.local/bin`, macOS `~/Library/Python/*/bin`, or Windows Python
36-
paths. Falls back to `PATH`.
48+
Node wrapper launches `codeclone-mcp` via local `stdio`. It prefers a
49+
workspace-local `.venv`, then a Poetry environment, then user-local install
50+
paths, then `PATH`.
3751

3852
## Privacy
3953

@@ -42,7 +56,8 @@ See [Privacy Policy](privacy-policy.md).
4256

4357
## Current limits
4458

45-
- expects a global or explicitly configured launcher
59+
- expects either a workspace launcher, a user-local/global launcher, or an
60+
explicitly configured absolute launcher path
4661
- local install surface, not a hosted service layer
4762

4863
For the underlying MCP contract, see:

extensions/claude-desktop-codeclone/README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,25 @@ Read-only, baseline-aware, local stdio only.
88

99
## Install
1010

11+
The bundle prefers the current workspace launcher first:
12+
13+
1. `./.venv/bin/codeclone-mcp`
14+
2. the current Poetry environment launcher
15+
3. user-local install paths and `PATH`
16+
17+
Recommended workspace-local setup:
18+
1119
```bash
12-
uv tool install --pre "codeclone[mcp]"
13-
codeclone-mcp --help # verify launcher
20+
uv venv
21+
uv pip install --python .venv/bin/python "codeclone[mcp]>=2.0.0b4"
22+
.venv/bin/codeclone-mcp --help
1423
```
1524

16-
If you want to keep the launcher inside an existing environment instead, use:
25+
Global fallback:
1726

1827
```bash
19-
uv pip install --pre "codeclone[mcp]"
28+
uv tool install "codeclone[mcp]>=2.0.0b4"
29+
codeclone-mcp --help
2030
```
2131

2232
Build and install the bundle:
@@ -29,8 +39,8 @@ node scripts/build-mcpb.mjs
2939
Then in Claude Desktop: **Settings → Extensions → Install Extension** → select
3040
the `.mcpb` from `dist/`.
3141

32-
If `codeclone-mcp` is not on `PATH`, set **CodeClone launcher command** in the
33-
extension settings to an absolute path.
42+
If you want to bypass auto-discovery entirely, set **CodeClone launcher
43+
command** in the extension settings to an absolute path.
3444

3545
## Configuration
3646

extensions/claude-desktop-codeclone/manifest.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": "0.3",
33
"name": "codeclone",
44
"display_name": "CodeClone",
5-
"version": "2.0.0-b5.0",
5+
"version": "2.0.0-b5.1",
66
"description": "Baseline-aware structural review for Claude Desktop through a local CodeClone MCP launcher.",
77
"long_description": "CodeClone for Claude Desktop wraps the local codeclone-mcp launcher as an MCP bundle. It keeps Claude on the same canonical MCP surface used by the CLI, HTML report, VS Code extension, and Codex plugin — read-only, baseline-aware, local stdio only.",
88
"author": {
@@ -98,15 +98,22 @@
9898
],
9999
"env": {
100100
"CODECLONE_MCP_COMMAND": "${user_config.launcher_command}",
101-
"CODECLONE_MCP_ARGS_JSON": "${user_config.launcher_args_json}"
101+
"CODECLONE_MCP_ARGS_JSON": "${user_config.launcher_args_json}",
102+
"CODECLONE_WORKSPACE_ROOT": "${user_config.workspace_root}"
102103
}
103104
}
104105
},
105106
"user_config": {
107+
"workspace_root": {
108+
"type": "string",
109+
"title": "Workspace root path",
110+
"description": "Optional absolute path to the Python project root (the directory that contains .venv or venv). When set, the launcher prefers that virtual environment over user-local or system-wide installs. Useful when Claude Desktop starts outside the project directory.",
111+
"required": false
112+
},
106113
"launcher_command": {
107114
"type": "string",
108115
"title": "CodeClone launcher command",
109-
"description": "Optional absolute path or bare command name for codeclone-mcp. Leave empty to use auto-discovery and PATH.",
116+
"description": "Optional absolute path or bare command name for codeclone-mcp. Leave empty to prefer workspace launchers, then user-local paths, then PATH.",
110117
"required": false
111118
},
112119
"launcher_args_json": {

extensions/claude-desktop-codeclone/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/claude-desktop-codeclone/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@orenlab/codeclone-claude-desktop",
3-
"version": "2.0.0-b5.0",
3+
"version": "2.0.0-b5.1",
44
"private": true,
55
"description": "Claude Desktop MCP bundle wrapper for the local CodeClone MCP launcher.",
66
"license": "MPL-2.0",

0 commit comments

Comments
 (0)