Skip to content

xcrun mcpbridge returns unparsed JSON string in content field instead of structuredContent #18371

Closed

Description

@peterfriese

Xcode 26.3's mcpbridge transmits tool results as a JSON string embedded within the content field, rather than providing proper object data in the structuredContent field.

This behavior breaks strict MCP clients (like gemini-cli) which expect structuredContent for tool results.

Sample Payload

Below is an example of the non-compliant JSON-RPC response observed from xcrun mcpbridge:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"windows\":[{\"title\":\"HelloWorld\",\"path\":\"/path/to/project\"}]}"
      }
    ]
    // Missing: structuredContent
  }
}

The expected behavior would be for the text content to be parsed and populated into structuredContent, or for the structuredContent field to be present directly.

Expected Payload

The result object should contain a parsed structuredContent field:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "..."
      }
    ],
    "structuredContent": {
      "windows": [
        {
          "title": "HelloWorld",
          "path": "/path/to/project"
        }
      ]
    }
  }
}

Activity

  1. added
    status/need-triageIssues that need to be triaged by the triage automation.
    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality
    on Feb 5, 2026
  2. changed the title [-]Enhance MCP tool result handling for Xcode 26.3 mcpbridge[/-] [+][Xcode] MCP Bridge returns non-compliant responses missing structuredContent[/+] on Feb 5, 2026
  3. changed the title [-][Xcode] MCP Bridge returns non-compliant responses missing structuredContent[/-] [+]Bug: `xcrun mcpbridge` returns unparsed JSON string in `content` field instead of `structuredContent`[/+] on Feb 5, 2026
  4. added a commit that references this issue on Feb 5, 2026
    fc78836
  5. changed the title [-]Bug: `xcrun mcpbridge` returns unparsed JSON string in `content` field instead of `structuredContent`[/-] [+]`xcrun mcpbridge` returns unparsed JSON string in `content` field instead of `structuredContent`[/+] on Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions