Skip to content

Commit 14c8cd3

Browse files
committed
feat(clients): harden MCP client surfaces and polish prerelease UX for b4
- make MCP initialize metadata report the CodeClone package version so clients can enforce runtime compatibility correctly - harden the VS Code extension with a minimum supported CodeClone gate, uv-based setup guidance, moved-view icons, titled quick picks, and leaner editor actions aligned with current VS Code UX guidance - improve the Claude Desktop bundle startup path and launcher handling, with refreshed tests and packaging flow - refresh README, MCP/client docs, changelog, and related CI-facing metadata around the current VS Code, Claude, and Codex surfaces
1 parent 0970965 commit 14c8cd3

39 files changed

+5473
-5350
lines changed

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: ✨ Feature request
22
description: Propose an enhancement to CodeClone
33
title: "[Feature]: "
4-
labels: ["enhancement"]
5-
assignees: []
4+
labels: [ "enhancement" ]
5+
assignees: [ ]
66

77
body:
88
- type: markdown

.github/ISSUE_TEMPLATE/mcp_server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: MCP server
22
description: Report an MCP bug or propose an MCP workflow/tooling improvement
33
title: "[MCP]: "
4-
labels: ["mcp"]
5-
assignees: []
4+
labels: [ "mcp" ]
5+
assignees: [ ]
66

77
body:
88
- type: markdown

.github/workflows/codeclone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: CodeClone
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
6-
paths: ["**/*.py"]
5+
types: [ opened, synchronize, reopened ]
6+
paths: [ "**/*.py" ]
77

88
permissions:
99
contents: read

CHANGELOG.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
### MCP server
66

7-
- Add `help(topic=...)` tool for workflow guidance, baseline semantics, and review-state routing.
7+
- Add `help(topic=...)` tool for workflow guidance, baseline semantics, analysis profile, and review-state routing
8+
(tool count: 20 → 21).
9+
- Add `analysis_profile` help topic for explicit conservative-first / deeper-review threshold guidance.
10+
- Enrich `_SERVER_INSTRUCTIONS` with triage-first workflow, budget-aware drill-down, and conservative-first threshold
11+
guidance so MCP-capable clients receive structured behavioral context on connect.
812
- Optimize MCP payloads: short finding IDs (sha256-based for block clones), compact `derived` section projection,
913
bounded `metrics_detail` with pagination.
14+
- Fix MCP initialize metadata so `serverInfo.version` reports the CodeClone package version rather than the underlying
15+
`mcp` runtime version.
1016

1117
### Report contract
1218

@@ -27,17 +33,27 @@
2733
- Add Health Score chapter: scoring inputs, report-only layers, phased expansion policy.
2834
- Document that future releases may lower scores due to broader scoring model, not only worse code.
2935

30-
### IDE integration (preview)
36+
### IDE and client integration (preview)
3137

3238
- Add VS Code extension (`codeclone-mcp` client) with baseline-aware triage, source drill-down, Explorer decorations,
3339
and HTML-report bridging.
40+
- Add conservative, deeper-review, and custom analysis profiles to the VS Code extension and pass them through to MCP.
41+
- Add limited Restricted Mode: onboarding works in untrusted workspaces, analysis stays gated until trust is granted.
3442
- Add Node unit tests, extension-host smoke tests, and `.vsix` packaging.
35-
- Add Claude Desktop `.mcpb` bundle wrapper for the local `codeclone-mcp` launcher with explicit launcher settings,
36-
local-stdio enforcement, and deterministic package build smoke.
37-
- Add a native Codex plugin with repo-local discovery metadata, bundled `codeclone-mcp` config, and a
38-
conservative-first CodeClone review skill.
43+
- Tighten the VS Code extension to current VS Code UX guidance: one primary editor action, titled Quick Picks,
44+
per-view icons, non-button tree details, and a hard minimum local CodeClone version gate (`>= 2.0.0b4`).
45+
- Add Claude Desktop `.mcpb` bundle wrapper for the local `codeclone-mcp` launcher with pre-loaded review instructions,
46+
explicit launcher settings, platform auto-discovery (macOS, Linux, Windows), local-stdio enforcement, signal
47+
forwarding, and deterministic package build smoke.
48+
- Add a native Codex plugin with repo-local discovery metadata, bundled `codeclone-mcp` config, pre-loaded instructions,
49+
and two skills: conservative-first full review and quick hotspot discovery.
3950

40-
## [2.0.0b3] - 20260401
51+
### Internal
52+
53+
- Extract shared `_json_io` module for deterministic JSON serialization across baseline, cache, and report paths.
54+
- Remove low-signal structural clone noise surfaced by stricter analysis passes without touching golden fixture debt.
55+
56+
## [2.0.0b3] - 2026-04-01
4157

4258
2.0.0b3 is the release where CodeClone stops looking like "a strong analyzer with extras" and starts looking like a
4359
coherent platform: canonical-report-first, agent-facing, CI-native, and product-grade.
@@ -95,7 +111,7 @@ coherent platform: canonical-report-first, agent-facing, CI-native, and product-
95111

96112
- Ship Composite Action v2 with configurable quality gates, SARIF upload to Code Scanning, and PR summary comments.
97113

98-
## [2.0.0b2] - 20260328
114+
## [2.0.0b2] - 2026-03-28
99115

100116
### Dependencies
101117

@@ -109,7 +125,7 @@ coherent platform: canonical-report-first, agent-facing, CI-native, and product-
109125
- Keep Overview KPI micro-badges inside cards at extreme browser/mobile widths.
110126
- Restyle Report Provenance summary badges to match the card-style badge language used across the report.
111127

112-
## [2.0.0b1] - 20260325
128+
## [2.0.0b1] - 2026-03-25
113129

114130
Major upgrade: CodeClone evolves from a structural clone detector into a
115131
**baseline-aware code-health and CI governance tool** for Python.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Live sample report:
5757
## Quick Start
5858

5959
```bash
60-
uv tool install codeclone
60+
uv tool install codeclone # use --pre for beta
6161

6262
codeclone . # analyze
6363
codeclone . --html # HTML report
@@ -164,10 +164,10 @@ Optional read-only MCP server for AI agents and IDE clients.
164164
21 tools + 10 resources — never mutates source, baselines, or repo state.
165165
166166
```bash
167-
uv tool install "codeclone[mcp]"
167+
uv tool install "codeclone[mcp]" # or: uv pip install "codeclone[mcp]"
168168

169-
codeclone-mcp --transport stdio # local (Claude Code, Codex, Copilot, Gemini CLI)
170-
codeclone-mcp --transport streamable-http # remote / HTTP-only clients
169+
codeclone-mcp --transport stdio # local (Claude Code, Codex, Copilot, Gemini CLI)
170+
codeclone-mcp --transport streamable-http # remote / HTTP-only clients
171171
```
172172

173173
Docs:
@@ -177,11 +177,11 @@ Docs:
177177

178178
### Native Client Surfaces
179179

180-
| Surface | Location | Purpose |
181-
|---------------------------|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
182-
| **VS Code extension** | [`extensions/vscode-codeclone/`](https://github.com/orenlab/codeclone/tree/main/extensions/vscode-codeclone) | Triage-first structural review in the editor |
183-
| **Claude Desktop bundle** | [`extensions/claude-desktop-codeclone/`](https://github.com/orenlab/codeclone/tree/main/extensions/claude-desktop-codeclone) | Local `.mcpb` install surface |
184-
| **Codex plugin** | [`plugins/codeclone/`](https://github.com/orenlab/codeclone/tree/main/plugins/codeclone) | Native Codex discovery, skill, and MCP definition |
180+
| Surface | Location | Purpose |
181+
|---------------------------|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
182+
| **VS Code extension** | [`extensions/vscode-codeclone/`](https://github.com/orenlab/codeclone/tree/main/extensions/vscode-codeclone) | Triage-first structural review in the editor |
183+
| **Claude Desktop bundle** | [`extensions/claude-desktop-codeclone/`](https://github.com/orenlab/codeclone/tree/main/extensions/claude-desktop-codeclone) | Local `.mcpb` install with pre-loaded instructions |
184+
| **Codex plugin** | [`plugins/codeclone/`](https://github.com/orenlab/codeclone/tree/main/plugins/codeclone) | Native discovery, two skills, and MCP definition |
185185

186186
All three are thin wrappers over the same `codeclone-mcp` contract — no second analysis engine.
187187

codeclone/mcp_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ def build_mcp_server(
114114
log_level=log_level,
115115
dependencies=(f"codeclone=={__version__}",),
116116
)
117+
# FastMCP otherwise reports the `mcp` package version in initialize/serverInfo.
118+
mcp._mcp_server.version = __version__
117119

118120
def tool(*args: Any, **kwargs: Any) -> Callable[[MCPCallable], MCPCallable]:
119121
return cast(

docs/book/20-mcp-interface.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Current server characteristics:
4141
- process-count policy:
4242
- `processes` is an optional override
4343
- when omitted, MCP defers to the core CodeClone runtime
44+
- initialize metadata:
45+
- `serverInfo.version` reflects the CodeClone package version
46+
- clients may use it for compatibility checks
4447
- root contract:
4548
- analysis tools require an absolute repository root
4649
- relative roots such as `.` are rejected in MCP because server cwd may

docs/book/21-vscode-extension.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The intended IDE path mirrors CodeClone MCP:
6161
1. `Analyze Workspace` or `Review Changes`
6262
2. compact overview and priority review
6363
3. review new regressions or production hotspots
64-
4. use `Analysis Depth` only when you need a higher-sensitivity follow-up
64+
4. use `Set Analysis Depth` only when you need a higher-sensitivity follow-up
6565
5. reveal source
6666
6. open canonical finding or remediation only when needed
6767

@@ -118,6 +118,7 @@ The extension runs as a workspace extension and requires:
118118
- local filesystem access
119119
- local git access for changed-files review
120120
- a local `codeclone-mcp` launcher, or an explicitly configured launcher
121+
- CodeClone `2.0.0b4` or newer
121122

122123
For this reason:
123124

docs/claude-desktop-bundle.md

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,39 @@
11
# Claude Desktop Bundle
22

3-
CodeClone ships a local Claude Desktop bundle in
3+
Local `.mcpb` bundle wrapper for `codeclone-mcp` in
44
`extensions/claude-desktop-codeclone/`.
55

6-
It is a small Node-based `.mcpb` wrapper around the local `codeclone-mcp`
7-
launcher.
6+
Installable package instead of hand-editing client JSON. Same canonical MCP
7+
surface used by CLI, VS Code, Codex, and Claude Code. The manifest includes
8+
pre-loaded instructions that guide Claude toward conservative-first,
9+
production-first structural review.
810

9-
## What it is for
10-
11-
The bundle exists to make local CodeClone setup in Claude Desktop easier:
12-
13-
- installable `.mcpb` package instead of hand-editing client JSON
14-
- the same read-only `codeclone-mcp` surface already used by other MCP clients
15-
- explicit local-stdio runtime
16-
- optional launcher override when `codeclone-mcp` is not already on `PATH`
17-
18-
It does not bundle Python or CodeClone itself.
19-
20-
## Install requirements
21-
22-
Install CodeClone with the optional MCP extra first:
11+
## Install
2312

2413
```bash
25-
uv tool install "codeclone[mcp]"
26-
```
27-
28-
If you want to keep the launcher inside an existing environment instead:
29-
30-
```bash
31-
uv pip install "codeclone[mcp]"
32-
```
33-
34-
Verify the launcher:
35-
36-
```bash
37-
codeclone-mcp --help
14+
uv tool install "codeclone[mcp]" # or: uv pip install "codeclone[mcp]"
15+
codeclone-mcp --help # verify
3816
```
3917

4018
## Bundle workflow
4119

42-
1. Build the `.mcpb` package from `extensions/claude-desktop-codeclone/`.
43-
2. In Claude Desktop, open `Settings -> Extensions -> Advanced settings`.
44-
3. Install the generated `.mcpb`.
45-
4. If Claude Desktop cannot resolve `codeclone-mcp`, set an explicit launcher
46-
command in the bundle settings.
47-
48-
## Runtime model
49-
50-
The bundle runs a small Node wrapper that launches `codeclone-mcp` via local
51-
`stdio`. Claude Desktop talks to the same canonical MCP surface as every other
52-
client — the bundle only handles launcher resolution.
20+
1. Build: `cd extensions/claude-desktop-codeclone && node scripts/build-mcpb.mjs`
21+
2. Claude Desktop: **Settings → Extensions → Install Extension** → select `.mcpb`
22+
3. If `codeclone-mcp` is not on `PATH`, set **CodeClone launcher command** in
23+
the bundle settings to an absolute path.
5324

5425
## Settings
5526

56-
### `CodeClone launcher command`
27+
| Setting | Purpose |
28+
|--------------------------------|------------------------------------------------------|
29+
| **CodeClone launcher command** | Absolute path or bare command for `codeclone-mcp` |
30+
| **Advanced launcher args** | JSON array of extra args (transport is always stdio) |
5731

58-
Optional absolute path or bare command name for `codeclone-mcp`.
59-
60-
### `Advanced launcher args (JSON array)`
61-
62-
Optional JSON array of additional launcher arguments for advanced setups.
63-
64-
The bundle rejects transport and network-listener arguments because the Claude
65-
Desktop package is intentionally local-stdio-only.
66-
67-
## Design decisions
32+
## Runtime model
6833

69-
- **Small wrapper, not a shadow runtime** — Node only locates and launches
70-
`codeclone-mcp`
71-
- **Setup honesty** — missing launchers fail with a clear install hint
72-
- **Local-only transport** — no streamable HTTP or remote-listener switches
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`.
7337

7438
## Privacy
7539

@@ -78,10 +42,8 @@ See [Privacy Policy](privacy-policy.md).
7842

7943
## Current limits
8044

81-
- the bundle expects a global or explicitly configured launcher; it does not
82-
auto-discover repository-local virtual environments
83-
- it is a local install surface for Claude Desktop, not a hosted service layer
84-
- it does not change CodeClone MCP semantics or add bundle-only tools
45+
- expects a global or explicitly configured launcher
46+
- local install surface, not a hosted service layer
8547

8648
For the underlying MCP contract, see:
8749

docs/codex-plugin.md

Lines changed: 20 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,42 @@
11
# Codex Plugin
22

33
CodeClone ships a native Codex plugin in `plugins/codeclone/`.
4-
5-
This is the Codex-native surface for CodeClone. It uses the local plugin model
6-
instead of pretending Codex wants a VS Code-style extension package.
7-
8-
## What it is for
9-
10-
The plugin gives Codex:
11-
12-
- a repo-local discoverable plugin entry
13-
- a local MCP server definition for `codeclone-mcp`
14-
- a focused CodeClone review skill
15-
- starter prompts aligned with the canonical CodeClone workflow
16-
17-
It stays read-only and does not create a second analysis model.
4+
Repo-local discovery via `.agents/plugins/marketplace.json`.
185

196
## What ships in the plugin
207

21-
- `.codex-plugin/plugin.json` for plugin metadata and prompts
22-
- `.mcp.json` for the local `codeclone-mcp --transport stdio` definition
23-
- `skills/codeclone-review/SKILL.md` for conservative-first, triage-first usage
24-
guidance
25-
- `.agents/plugins/marketplace.json` for repo-local plugin discovery
8+
| File | Purpose |
9+
|------------------------------|----------------------------------------------------|
10+
| `.codex-plugin/plugin.json` | Plugin metadata, prompts, instructions |
11+
| `.mcp.json` | Local `codeclone-mcp --transport stdio` definition |
12+
| `skills/codeclone-review/` | Conservative-first full review skill |
13+
| `skills/codeclone-hotspots/` | Quick hotspot discovery skill |
14+
| `assets/` | Plugin branding |
2615

27-
## Runtime model
16+
## Install
2817

29-
Additive — Codex discovers the plugin from `.agents/plugins/marketplace.json`,
30-
gets a local MCP definition and a review skill. Does not mutate
31-
`~/.codex/config.toml` or install a second server binary.
32-
33-
## Relationship to `codex mcp add`
18+
```bash
19+
uv tool install "codeclone[mcp]" # or: uv pip install "codeclone[mcp]"
20+
codeclone-mcp --help # verify
21+
```
3422

35-
Codex already supports direct MCP registration:
23+
Manual MCP registration without the plugin:
3624

3725
```bash
3826
codex mcp add codeclone -- codeclone-mcp --transport stdio
3927
```
4028

41-
That path remains valid and is still the simplest manual setup.
42-
43-
The plugin exists for the native Codex plugin/discovery surface:
44-
45-
- plugin card metadata
46-
- local marketplace entry
47-
- bundled CodeClone review skill
48-
- repo-local MCP definition
49-
50-
## Product decisions
29+
## Runtime model
5130

52-
- **Codex-native path** — local plugin system for discovery and skills
53-
- **Canonical MCP first** — same `codeclone-mcp` server as every other client
54-
- **Skill-guided review** — workflow guidance, not a second analyzer
55-
- **No hidden config writes** — does not rewrite user MCP config
31+
Additive — Codex discovers the plugin from `.agents/plugins/marketplace.json`,
32+
gets a local MCP definition and two skills. Does not mutate
33+
`~/.codex/config.toml` or install a second server binary.
5634

5735
## Current limits
5836

59-
- if you already registered `codeclone-mcp` manually in `~/.codex/config.toml`,
60-
you may see a duplicate Codex MCP surface until you keep only one setup path
37+
- if you already registered `codeclone-mcp` manually, keep only one setup path
38+
to avoid duplicate MCP surfaces
6139
- the bundled `.mcp.json` assumes `codeclone-mcp` resolves on `PATH`
62-
- explicit launcher overrides still belong in user config, not inside the
63-
plugin manifest
64-
65-
## Source of truth
66-
67-
The Codex plugin is only a local presentation and discovery layer over:
68-
69-
- `codeclone-mcp`
70-
- the canonical report semantics behind MCP
71-
- the existing CodeClone docs and contracts
7240

7341
For the underlying interface contract, see:
7442

0 commit comments

Comments
 (0)