Skip to content

fix(mcp): deconflict local and remote MCP servers#23

Merged
hellno merged 1 commit intomainfrom
fix/mcp-deconflict-local-remote
Mar 17, 2026
Merged

fix(mcp): deconflict local and remote MCP servers#23
hellno merged 1 commit intomainfrom
fix/mcp-deconflict-local-remote

Conversation

@hellno
Copy link
Copy Markdown
Contributor

@hellno hellno commented Mar 17, 2026

Summary

  • Rename remote MCP server from "jack" to "jack-cloud" so tools are clearly namespaced (mcp__jack__* vs mcp__jack_cloud__*)
  • Rename 4 remote file tools to signal they're for terminal-less environments only: stage_file, list_staged_files, browse_deployed_source, read_deployed_file
  • Add negative guidance in tool descriptions ("if you have Read/Edit/Write tools, use those instead")
  • Add dual-connection detection to jack mcp install — auto-removes remote MCP configs that conflict with local
  • Narrow "prefer MCP" guidance in CLAUDE.md and agents://context to scope it to cloud operations only

Problem

When both local (stdio) and remote (HTTP) Jack MCP servers are connected in Claude Code, agents use remote file tools (update_file, read_project_file) instead of built-in filesystem tools, causing partial deploys:

Agent staged 2/3 files via remote MCP → deployed broken worker → remote MCP disconnected → agent stuck → told user "just run jack ship" (what it should have done from the start)

Tracked in #22.

Changes

File Change
apps/mcp-worker/src/server.ts Server rename + 4 tool renames + description hardening
apps/mcp-worker/src/tools/source.ts Update stale tool names in error suggestions
apps/mcp-worker/src/tools/deploy-code.ts Update stale tool names in error suggestions
apps/mcp-worker/src/staging.ts Update comment
apps/mcp-worker/CLAUDE.md New mutual exclusivity section + updated tool names
apps/cli/src/lib/mcp-config.ts Dual-connection detection and removal
apps/cli/src/mcp/resources/index.ts Narrowed agents://context guidance
apps/cli/src/commands/mcp.ts Narrowed mcp context output
CLAUDE.md Narrowed "prefer MCP" to cloud operations only

Test plan

  • Deploy renamed remote MCP worker and verify tools appear as stage_file, browse_deployed_source, etc.
  • In Claude Code with only local MCP: verify agent never attempts remote file tools
  • In claude.ai web with only remote MCP: verify stage_file + deploy(staged=true) workflow still works
  • Run jack mcp install with a remote MCP entry in ~/.claude.json and verify it gets removed with warning
  • Verify no stale old tool names remain in any user-facing strings

…deploys

Rename remote MCP server from "jack" to "jack-cloud" and rename file
tools to clearly signal they're for terminal-less environments only:
- update_file → stage_file
- list_staged_changes → list_staged_files
- list_project_files → browse_deployed_source
- read_project_file → read_deployed_file

Tool descriptions now include negative guidance ("if you have
Read/Edit/Write tools, use those instead") to prevent agents from
using remote file staging when local filesystem access is available.

Add dual-connection detection to jack mcp install — automatically
removes remote MCP configs that conflict with the local server.

Narrow CLAUDE.md and agents://context guidance from blanket "always
prefer MCP tools" to "prefer MCP for cloud operations, use built-in
tools for file editing."
@hellno hellno merged commit bbb2bd8 into main Mar 17, 2026
1 check passed
@hellno hellno deleted the fix/mcp-deconflict-local-remote branch March 17, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant