{"abstract":[{"text":"Let agents access your project and Xcode capabilities using the Model Context Protocol.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/com.apple.documentation\/documentation\/technologies","doc:\/\/com.apple.Xcode\/documentation\/Xcode","doc:\/\/com.apple.Xcode\/documentation\/Xcode\/coding-intelligence"]]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/giving-external-agents-access-to-xcode"},"kind":"article","legalNotices":{"copyright":"Copyright &copy; 2026 Apple Inc. All rights reserved.","privacyPolicy":"https:\/\/www.apple.com\/privacy\/privacy-policy","termsOfUse":"https:\/\/www.apple.com\/legal\/internet-services\/terms\/site.html"},"metadata":{"availableLanguages":["de-DE","en-US","es-419","fr-FR","it-IT","ja-JP","ko-KR","pt-BR","zh-CN"],"role":"article","roleHeading":"Article","title":"Giving external agents access to Xcode"},"primaryContentSections":[{"content":[{"anchor":"Overview","level":2,"text":"Overview","type":"heading"},{"inlineContent":[{"text":"You can give permission for external agents, that you launch outside of Xcode, to modify your Xcode project and perform actions, such as building your app.","type":"text"}],"type":"paragraph"},{"inlineContent":[{"text":"If you use an external agent for development:","type":"text"}],"type":"paragraph"},{"items":[{"content":[{"inlineContent":[{"text":"Allow the agent access to Xcode in Intelligence settings.","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"text":"Configure the agent to access Xcode capabilities through the Model Context Protocol (MCP) server that Xcode provides.","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"text":"Open your project in Xcode and begin prompting the external agent that utilizes Xcode.","type":"text"}],"type":"paragraph"}]}],"type":"orderedList"},{"inlineContent":[{"text":"Xcode alerts you when the external agent connects to Xcode and when it’s active.","type":"text"}],"type":"paragraph"},{"anchor":"Update-Intelligence-settings-to-give-external-agents-access-to-Xcode","level":3,"text":"Update Intelligence settings to give external agents access to Xcode","type":"heading"},{"inlineContent":[{"text":"In Intelligence settings, allow external agents to connect with Xcode using its MCP server:","type":"text"}],"type":"paragraph"},{"items":[{"content":[{"inlineContent":[{"text":"Choose Xcode > Settings and select Intelligence in the sidebar.","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"text":"Under Model Context Protocol, choose either Always or “While Xcode is Open” from the “Allow External Agents to Use Xcode Tools” pop-up menu.","type":"text"}],"type":"paragraph"}]}],"type":"orderedList"},{"inlineContent":[{"identifier":"intelligence-settings","type":"image"}],"type":"paragraph"},{"inlineContent":[{"text":"To turn off this feature, choose Never from the “Allow External Agents to Use Xcode Tools” pop-up menu.","type":"text"}],"type":"paragraph"},{"anchor":"Configure-external-agents-to-use-the-MCP-server","level":3,"text":"Configure external agents to use the MCP server","type":"heading"},{"inlineContent":[{"text":"In Terminal, use the ","type":"text"},{"code":"xcrun mcpbridge","type":"codeVoice"},{"text":" command to configure the external agent to use Xcode Tools. For example, run the following command in Terminal to give Claude Code access to your open project and Xcode capabilities:","type":"text"}],"type":"paragraph"},{"code":["claude mcp add --transport stdio xcode -- xcrun mcpbridge"],"copyToClipboard":true,"lineAnnotations":[],"showLineNumbers":false,"syntax":null,"type":"codeListing","wrap":0},{"inlineContent":[{"text":"For Codex, run:","type":"text"}],"type":"paragraph"},{"code":["codex mcp add xcode -- xcrun mcpbridge"],"copyToClipboard":true,"lineAnnotations":[],"showLineNumbers":false,"syntax":null,"type":"codeListing","wrap":0},{"inlineContent":[{"text":"To verify the configuration, enter ","type":"text"},{"code":"claude mcp list","type":"codeVoice"},{"text":" or ","type":"text"},{"code":"codex mcp list","type":"codeVoice"},{"text":" in Terminal.","type":"text"}],"type":"paragraph"},{"inlineContent":[{"text":"Optionally, add hints about Xcode and your project to configuration files, such as the ","type":"text"},{"code":"AGENTS.md","type":"codeVoice"},{"text":" or ","type":"text"},{"code":"CLAUDE.md","type":"codeVoice"},{"text":" files, in the location that the external agent uses. For more information on configuring agents that run inside Xcode, see ","type":"text"},{"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/extending-and-customizing-agents#Customize-agent-environments","isActive":true,"type":"reference"},{"text":".","type":"text"}],"type":"paragraph"},{"inlineContent":[{"text":"Before prompting an external agent (outside of Xcode), be sure to open your project in Xcode.","type":"text"}],"type":"paragraph"}],"kind":"content"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"seeAlsoSections":[{"anchor":"Agent-configuration","generated":true,"identifiers":["doc:\/\/com.apple.Xcode\/documentation\/Xcode\/extending-and-customizing-agents","doc:\/\/com.apple.Xcode\/documentation\/Xcode\/updating-your-xcode-project-configuration-file-format"],"title":"Agent configuration"}],"references":{"Xcode-PageImage-card.png":{"alt":"The Xcode logo on a blue gradient background.","identifier":"Xcode-PageImage-card.png","type":"image","variants":[{"traits":["2x","light"],"url":"\/images\/com.apple.Xcode\/Xcode-PageImage-card@2x.png"},{"traits":["2x","dark"],"url":"\/images\/com.apple.Xcode\/Xcode-PageImage-card~dark@2x.png"}]},"doc://com.apple.Xcode/documentation/Xcode":{"abstract":[{"text":"Build, test, and submit your app with Apple’s integrated development environment.","type":"text"}],"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode","images":[{"identifier":"Xcode-PageImage-card.png","type":"card"}],"kind":"article","role":"collection","title":"Xcode","type":"topic","url":"\/documentation\/xcode"},"doc://com.apple.Xcode/documentation/Xcode/coding-intelligence":{"abstract":[{"text":"Use agents to help you explore code, add features, refine your interface, and leverage skills, such as localization and accessibility.","type":"text"}],"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/coding-intelligence","kind":"article","role":"collectionGroup","title":"Coding intelligence","type":"topic","url":"\/documentation\/xcode\/coding-intelligence"},"doc://com.apple.Xcode/documentation/Xcode/extending-and-customizing-agents":{"abstract":[{"text":"Expand agent capabilities for your specific needs and application domain.","type":"text"}],"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/extending-and-customizing-agents","kind":"article","role":"article","title":"Extending and customizing agents","type":"topic","url":"\/documentation\/xcode\/extending-and-customizing-agents"},"doc://com.apple.Xcode/documentation/Xcode/extending-and-customizing-agents#Customize-agent-environments":{"abstract":[],"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/extending-and-customizing-agents#Customize-agent-environments","kind":"section","title":"Customize agent environments","type":"topic","url":"\/documentation\/xcode\/extending-and-customizing-agents#Customize-agent-environments"},"doc://com.apple.Xcode/documentation/Xcode/updating-your-xcode-project-configuration-file-format":{"abstract":[{"text":"Configure your Xcode project to use the JSON project configuration file format that’s more human-readable and editable by coding intelligence agents.","type":"text"}],"identifier":"doc:\/\/com.apple.Xcode\/documentation\/Xcode\/updating-your-xcode-project-configuration-file-format","kind":"article","role":"article","title":"Updating your Xcode project configuration file format","type":"topic","url":"\/documentation\/xcode\/updating-your-xcode-project-configuration-file-format"},"doc://com.apple.documentation/documentation/technologies":{"abstract":[],"identifier":"doc:\/\/com.apple.documentation\/documentation\/technologies","kind":"technologies","role":"overview","title":"Technologies","type":"topic","url":"\/documentation\/technologies"},"intelligence-settings":{"alt":"A screenshot of the Intelligence settings showing the “Allow External Agents to Use Xcode Tools” setting under Model Context Protocol.","identifier":"intelligence-settings","type":"image","variants":[{"traits":["2x","light"],"url":"\/images\/com.apple.Xcode\/intelligence-settings@2x.png"},{"traits":["2x","dark"],"url":"\/images\/com.apple.Xcode\/intelligence-settings~dark@2x.png"}]}}}