Repository navigation
fix(claude-connect): resolve the dev server in the bridge so one plugin cache serves every project (#243) - #266
Merged
Merged
Conversation
…in cache serves every project (#243) Claude caches the connect plugin at cache/conciv/conciv-connect/<version> with no project component, so two projects on one machine overwrote each other's cached .mcp.json and sessions bridged to the wrong project's dev server. The generated plugin now carries no url at all: the bridge walks up from its working directory, reads .conciv/mcp-endpoint.json per request, and fails naming the directory it searched when nothing is recorded. Attach writes that endpoint file outside the plugin tree, and the marketplace check compares plugin contents instead of the registering project's path, so a second project no longer triggers reinstall ping-pong and a dev server that restarts on a new port needs no reinstall. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Makes Claude’s shared plugin cache project-agnostic by resolving each project’s dev-server endpoint at request time.
Changes:
- Stores MCP endpoints outside the cached plugin tree.
- Resolves endpoints by walking upward from Claude’s working directory.
- Adds multi-project, restart, install-state, and bridge tests.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.changeset/project-agnostic-claude-bridge.md |
Documents the fix. |
packages/claude-connect/package.json |
Exports the endpoint API. |
packages/claude-connect/tsdown.config.ts |
Builds the endpoint module. |
packages/claude-connect/src/bridge.ts |
Resolves endpoints per request. |
packages/claude-connect/src/endpoint.ts |
Generates project endpoint files. |
packages/claude-connect/src/install-state.ts |
Compares marketplace contents. |
packages/claude-connect/src/plugin-files.ts |
Removes URLs from plugin files. |
packages/claude-connect/test/bridge.it.test.ts |
Tests runtime resolution. |
packages/claude-connect/test/install-state.test.ts |
Tests multi-project state. |
packages/claude-connect/test/plugin-files.test.ts |
Tests project-independent output. |
packages/cli/src/init/steps/harness/claude.ts |
Generates the complete plugin tree. |
packages/cli/test/steps/harness/claude.test.ts |
Updates init coverage. |
packages/harness/src/claude/attach.ts |
Writes and removes endpoint files. |
packages/harness/test/claude-attach.test.ts |
Tests attach behavior across projects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+29
| for (;;) { | ||
| found.push(join(dir, stateDirName, endpointFileName)) | ||
| const parent = dirname(dir) | ||
| if (parent === dir) return found | ||
| dir = parent |
Comment on lines
+22
to
+26
| function endpointPaths() { | ||
| const found = [] | ||
| let dir = resolve(process.cwd()) | ||
| for (;;) { | ||
| found.push(join(dir, stateDirName, endpointFileName)) |
This was referenced Aug 6, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #243. The review-approved project-agnostic bridge:
TDD with real servers: two-project clobber, ping-pong, per-project resolution, below-root resolution, port-restart follow, fail-loud - all captured failing pre-fix (14 failures on revert-check), all green post-fix. claude-connect 24/24 bridge ITs, harness claude-attach 32/32, cli init steps green.
Gates: typecheck 29/29, build 13/13, test 29/29 (serial), lint 95/95, format clean, fallow 0 introduced. Changeset included.
Noted for #263 (which moves this code): contract changes - single claudeConnectPluginFiles({stateDir}) generator, new /endpoint subpath, CLAUDE_CONNECT_BRIDGE_URL_VAR deleted. Follow-up candidate: dev server refreshing the endpoint file on startup without a re-attach (core-side).
🤖 Generated with Claude Code