Skip to content

Claude Agent tool bridge removes isolated MCP conversation before tools/call, causing MCP error -32603 Conversation not found #116

@simonmoss49

Description

@simonmoss49

Summary
Claude Agent mode exposes Xcode-native tools successfully, but tool execution fails because the MCP conversation is removed before /tools/call requests arrive.
The agent can start a response, list available tools, and request Xcode-native tools such as XcodeRead / XcodeGrep, but every bridge tool call then fails with:
McpError: MCP error -32603: Conversation not found
This appears to be a lifecycle/race issue in the Claude Agent tool bridge, specifically around isolated conversations.
Environment

  • macOS: Apple Silicon Mac
  • Xcode: 26.3
  • xcode-copilot-server: 5.0.1
  • Node: v24.16.0
  • npm: 11.13.0
  • Auth: GitHub CLI auth, authenticated successfully as a Copilot user
  • Server installed as LaunchAgent
  • Proxy mode: auto
  • Log level: debug
    • Working directory: /Users//example-ios-app
      Running process:
      /usr/local/bin/node /Users//.npm-global/lib/node_modules/xcode-copilot-server/dist/index.js --launchd --port 8080 --log-level debug --cwd /Users//example-ios-app --auto-patch --idle-timeout 60
      What works
      The server starts correctly and returns models:
      curl --max-time 10 -s
      -H 'User-Agent: Xcode/26.0'
      http://127.0.0.1:8080/v1/models
      returns the expected Copilot model list, including:
      auto
      claude-sonnet-4.6
      claude-haiku-4.5
      claude-opus-4.6
      gpt-5.4
      gpt-5.3-codex
      gpt-5.4-mini
      gpt-5-mini
      Claude Agent also routes through the proxy correctly:
      POST /v1/messages?beta=true
      The agent sees Xcode-native tools and reports them as available, including tools such as:
      XcodeLS
      XcodeGlob
      XcodeGrep
      XcodeRead
      XcodeWrite
      XcodeUpdate
      BuildProject
      GetBuildLog
      RunAllTests
      RunSomeTests
      XcodeListNavigatorIssues
      DocumentationSearch
      What fails
      When Claude Agent tries to use Xcode-native tools, the MCP conversation has already been removed.
      Relevant log excerpt:
      2026-06-10T10:01:17.580Z · DEBUG Created conversation eefcd40f-252f-4c10-9dd6-3b4138f4dab4 (primary=false)
      2026-06-10T10:01:17.581Z ● INFO New conversation eefcd40f-252f-4c10-9dd6-3b4138f4dab4
      2026-06-10T10:01:18.771Z ● INFO Streaming response for conversation eefcd40f-252f-4c10-9dd6-3b4138f4dab4
      2026-06-10T10:01:18.780Z · DEBUG MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4: SSE stream opened
      2026-06-10T10:01:18.830Z · DEBUG MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4: method="tools/list", id=1
      2026-06-10T10:01:18.831Z · DEBUG MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4 tools/list: 36 tools
      2026-06-10T10:01:27.174Z · DEBUG Conversation eefcd40f-252f-4c10-9dd6-3b4138f4dab4 session ended, removing
      2026-06-10T10:01:27.179Z · DEBUG MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4: method="tools/call", id=2
      2026-06-10T10:01:27.180Z · DEBUG MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4: method="tools/call", id=3
      The corresponding tool failures:
      xcode-bridge-XcodeRead done (success=false, MCP server 'xcode-bridge': McpError: MCP error -32603: Conversation not found)
      xcode-bridge-XcodeGrep done (success=false, MCP server 'xcode-bridge': McpError: MCP error -32603: Conversation not found)
      After that, every subsequent tool call against the same MCP conversation fails the same way:
      MCP eefcd40f-252f-4c10-9dd6-3b4138f4dab4: method="tools/call"
      xcode-bridge-XcodeRead done (success=false, MCP server 'xcode-bridge': McpError: MCP error -32603: Conversation not found)
      Pattern observed
      Xcode / Claude Agent appears to send overlapping requests. The tool-capable request is placed into an isolated conversation:
      Primary d0af5908-a120-4e61-aa87-ce28c0f708a5 is busy, creating isolated conversation
      Created conversation eefcd40f-252f-4c10-9dd6-3b4138f4dab4 (primary=false)
      Tools in request: 36
      Tool bridge active (in-process MCP)
      The isolated conversation successfully exposes tools via tools/list, but is removed before real tools/call messages are handled.
      Expected behaviour
      The MCP conversation/session should remain available at least until pending or subsequent /mcp//tools/call requests have completed.
      Expected sequence:
      tools/list: 36 tools
      Tool request: XcodeRead
      /mcp/ tools/call
      xcode-bridge-XcodeRead done (success=true)
      Actual behaviour
      Actual sequence:
      tools/list: 36 tools
      Conversation session ended, removing
      /mcp/ tools/call
      MCP error -32603: Conversation not found
      Reproduction steps
  1. Install and run xcode-copilot-server as LaunchAgent in auto mode:
    xcode-copilot-server install-agent
    --cwd "$HOME/example-ios-app"
    --log-level debug
  2. Confirm local model list works:
    curl --max-time 10 -s
    -H 'User-Agent: Xcode/26.0'
    http://127.0.0.1:8080/v1/models
  3. In Xcode, use:
    Agents → Claude Agent
  4. Ask a question that requires Xcode-native file access, for example to read or inspect a Swift file in the project.
  5. Observe that Claude starts responding, sees tools, then fails when attempting XcodeRead, XcodeGrep, Glob, etc.
  6. Check logs:
    tail -f ~/Library/Logs/xcode-copilot-server.out.log
    tail -f ~/Library/Logs/xcode-copilot-server.err.log
    Additional notes
    The local Chat provider route appears usable:
    Chat → Copilot → /v1/chat/completions
    The failure is specific to Claude Agent / /v1/messages?beta=true with the in-process MCP tool bridge.
    This does not appear to be a GitHub authentication issue, model availability issue, Xcode permission issue, or basic proxy routing issue. The proxy starts, authenticates, lists models, routes Claude Agent requests, exposes tools, and receives MCP calls. The failing point appears to be conversation/session lifecycle around isolated MCP conversations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions