Skip to main content

Python wrapper for xcrun mcpbridge that adds structuredContent to MCP responses

Project description

XcodeMCPWrapper - mcpbridge-wrapper

Python 3.7+ License: MIT Coverage

A Python wrapper that makes Xcode 26.3's MCP bridge compatible with Cursor and other strict MCP-spec-compliant clients.

The Problem

Xcode's mcpbridge returns tool responses in the content field but omits the required structuredContent field when a tool declares an outputSchema. According to the MCP specification, when outputSchema is declared, responses must include structuredContent.

  • ✅ Claude Code and Codex CLI work (they have special handling for Apple's responses)
  • ❌ Cursor strictly follows the spec and rejects non-compliant responses

The Solution

mcpbridge-wrapper intercepts responses from xcrun mcpbridge and copies the data from content into structuredContent, making Xcode's MCP tools fully compatible with all MCP clients.

┌─────────────┐    MCP Protocol    ┌──────────────────┐   MCP Protocol   ┌────────────┐    XPC    ┌─────────┐
│   Cursor    │ ◄────────────────► │ mcpbridge-wrapper│ ◄──────────────► │ mcpbridge  │ ◄───────► │  Xcode  │
│ (MCP Client)│                    │  (This Project)  │                  │  (Bridge)  │           │  (IDE)  │
└─────────────┘                    └──────────────────┘                  └────────────┘           └─────────┘

Quick Start

Prerequisites

  • macOS with Xcode 26.3+
  • Python 3.7+
  • Xcode Tools MCP Server enabled (see below)

⚠️ Important: You MUST enable Xcode Tools MCP in Xcode settings:

  1. Open Xcode > Settings (⌘,)
  2. Select Intelligence in the sidebar
  3. Under Model Context Protocol, toggle Xcode Tools ON

If you see "Found 0 tools" in your MCP client logs, this setting is not enabled.

Installation

git clone https://github.com/SoundBlaster/XcodeMCPWrapper.git
cd XcodeMCPWrapper
./scripts/install.sh

Add the following to your ~/.bashrc or ~/.zshrc:

export PATH="$HOME/bin:$PATH"

Then reload config:

source ~/.zshrc

or use shortcut:

. ~/.zshrc

Uninstallation

To remove mcpbridge-wrapper from your system:

./scripts/uninstall.sh

Options:

  • --dry-run or -n: Show what would be removed without removing
  • --yes or -y: Skip confirmation prompt

Configuration

Cursor

Edit ~/.cursor/mcp.json with replacing YOUR_USERNAME with your real username:

{
  "mcpServers": {
    "xcode-tools": {
      "command": "/Users/YOUR_USERNAME/bin/mcpbridge-wrapper",
      "args": []
    }
  }
}

Claude Code

claude mcp add --transport stdio xcode -- ~/bin/mcpbridge-wrapper

Codex CLI

codex mcp add xcode -- ~/bin/mcpbridge-wrapper

Zed Agent

Edit ~/.zed/settings.json (or use the Zed > Settings menu):

{
  "xcode-tools": {
    "command": "/Users/YOUR_USERNAME/bin/mcpbridge-wrapper",
    "args": [],
    "env": {}
  }
}

Usage

Once configured, ask your AI assistant to use Xcode tools:

"Build my project"
"Run the tests"
"Find all Swift files in the project"
"Show me the build errors"

Documentation

Performance

  • Overhead: <0.01ms per transformation
  • Memory: <10MB footprint
  • Coverage: 98.2% test coverage

License

MIT License - see LICENSE for details.

Acknowledgments

  • Apple's Xcode team for the MCP bridge functionality
  • The MCP protocol specification
  • The Cursor, Claude, and Codex teams for AI-powered development tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpbridge_wrapper-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpbridge_wrapper-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file mcpbridge_wrapper-0.1.0.tar.gz.

File metadata

  • Download URL: mcpbridge_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpbridge_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28b8050f797122fe5a5ef44178d3cccd0d2d0ae8bfa6c132b035b11bc0a6522b
MD5 c90e0958f491b358fa3beec082c9b845
BLAKE2b-256 340c84b5c887a56137873ade793bb1f0d6f23119fa3707b58a5085bd456ec4db

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpbridge_wrapper-0.1.0.tar.gz:

Publisher: publish-mcp.yml on SoundBlaster/XcodeMCPWrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpbridge_wrapper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcpbridge_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5f2bfce3965ad91ba6bf34bf946414162cd79fdaa861dce1d9f5fa1effae54
MD5 ca9d8adb8f094857bc129ffbe7eaee4b
BLAKE2b-256 1128dfbd2aa9ad3ab55a1754c5aa2705862464f6d27b1e60d9d806f6a580d30d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpbridge_wrapper-0.1.0-py3-none-any.whl:

Publisher: publish-mcp.yml on SoundBlaster/XcodeMCPWrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page