# Xcode Setup

Xcode can run coding agents such as Claude Code and Codex inside its own interface. Once you connect the WEEGLOO MCP server to it, the agent running inside Xcode can directly create, read, and modify resources such as *Content Type*, *Content*, and *Media*. Along with the MCP server, the install tool also installs Skills and Rules, helping the agent use the WEEGLOO API as intended. Skills are guides for doing a specific task well, and Rules are rules to follow across all tasks. Below, choose the agent you want to use inside Xcode, set everything up at once with the install tool, then complete MCP-connection authentication.

For details on the MCP server and on Skills and Rules, see the [MCP](/ai/tools/mcp.md) and [Skills and Rules](/ai/tools/skill-rules.md) pages respectively. This page covers only how to connect to Xcode.

## Prerequisites {#prerequisites}

Running the install commands below requires Node.js. First, use the following commands to check whether it is installed and whether the version is 18 or higher.

```terminal
node --version   # v18 or higher is OK
npx --version    # OK if a version is printed
```

If Node.js is installed but npx is not, update npm to the latest version with the command below. Updating npm installs npx along with it.

```terminal
npm install -g npm@latest
```

If Node.js is not installed or its version is too old, install Node.js using the method that fits your operating system.

:::::tabs
::::tab{label="macOS"}
```terminal
brew install node
```

:::note
If you do not have Homebrew, install it first from [brew.sh](https://brew.sh), or download Node.js directly from [nodejs.org](https://nodejs.org).
:::
::::
::::tab{label="Windows"}
```terminal
winget install OpenJS.NodeJS.LTS
```

:::note
If winget is missing or not recognized, download the LTS installer from [nodejs.org](https://nodejs.org). After installing, you need to open a new terminal.
:::
::::
::::tab{label="Linux"}
Distribution packages can be outdated, so we recommend installing with nvm, which works across many distributions.

```terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.5/install.sh | bash
source ~/.bashrc
nvm install --lts
```

:::note
To download the installer directly, check [nodejs.org](https://nodejs.org).
:::
::::
:::::

Xcode must also be installed. If you do not have it yet, you can get it from [Download Xcode](https://developer.apple.com/xcode/).

## Connecting {#connect}

For a default install, copy the install command on this page and run it once in your terminal. To go through the install steps and choose each one yourself, open **Custom install**. An Xcode connection is always installed into the current project, so run the install command inside the project folder you want to connect.

::::::::tabs
:::::::tab{label="Default install"}
::::::tabs{variant=segmented caption="Coding tool"}
:::::tab{label="Claude Code"}
::::step{title="Install MCP and Skills"}
Copy the install command and run it in your terminal. **Be sure to run it inside the project folder you want to connect.**

```bash
npx weegloo@latest -y --agent claude --host xcode --location project --token <Personal Access Token>
```
::::
::::step{title="Authenticate the MCP connection"}
Authenticate in the following order.

1. Run Claude Code in your terminal. **Be sure to run it inside the project folder you want to connect.**

   ```terminal
   claude
   ```

2. The first time you run it, it may ask whether to enable the new MCP servers. In that case, confirm that `weegloo` and `weegloo-upload` are checked, and press `Enter` to submit.

   ```terminal readonly
   New MCP servers found in .mcp.json
   Select any you wish to enable.

   > [√] weegloo
     [√] weegloo-upload
   ```

3. Enter `/mcp` to open the MCP server management screen.

   ```terminal
   /mcp
   ```

4. Select `weegloo` from the list. It shows as `needs authentication`.

   ```terminal readonly
   Manage MCP servers

   > weegloo · ∆ needs authentication
     weegloo-upload · √ connected
   ```

   :::note
   **If you do not see the servers in the list**: If `weegloo` and `weegloo-upload` do not appear in the list, you may not have submitted them on the enable screen in step 2, or they may be disabled. Quit Claude Code, enter the command below in your terminal, and run `claude` again. When the same screen as step 2 appears again, make sure `weegloo` and `weegloo-upload` are checked and press `Enter` to submit.

   ```terminal
   claude mcp reset-project-choices
   ```
   :::

5. Confirm the connection URL is `https://ai.weegloo.com/mcp` and select **Authenticate**.

   ```terminal readonly
   Weegloo MCP Server

   Status:  ∆ needs authentication
   URL:     https://ai.weegloo.com/mcp

   > 1. Authenticate
     2. Disable
   ```

6. When you select **Authenticate**, a WEEGLOO authentication page like the one below opens in your browser. Copy your token with the **Copy token** button, paste it, and click **Connect Server**. Once `weegloo` changes to `connected`, you are done.

   ```weegloo-token
   ```

   ![WEEGLOO authentication screen](/install/authorize-en.png)

:::note
After installing, you need to open a new Xcode Agent session for the settings to take effect.
:::
::::
:::::
:::::tab{label="Codex"}
::::step{title="Install MCP and Skills"}
Copy the install command and run it in your terminal. **Be sure to run it inside the project folder you want to connect.**

```bash
npx weegloo@latest -y --agent codex --host xcode --location project --token <Personal Access Token>
```
::::
::::step{title="Authenticate the MCP connection"}
Authenticate in the following order.

1. Running the command below in your terminal opens the WEEGLOO authentication page in your browser.

   ```terminal
   codex mcp login weegloo
   ```

2. On the WEEGLOO authentication page that opens, copy your token with the **Copy token** button below, paste it, and click **Connect Server**. **An agent that was already running needs to be restarted after authentication completes for the changes to take effect.**

   ```weegloo-token
   ```

   ![WEEGLOO authentication screen](/install/authorize-en.png)

:::note
After installing, you need to open a new Xcode Agent session for the settings to take effect.
:::
::::
:::::
::::::
:::::::
:::::::tab{label="Custom install"}
Run `npx weegloo` interactively and install by choosing the prompted items yourself.

::::::tabs{variant=segmented caption="Coding tool"}
:::::tab{label="Claude Code"}
::::step{title="Run the install tool"}
Move to the project folder you want to connect, then run the command below in that folder and choose each prompted item in turn. Where it asks for the token, use the **Copy token** button below to copy the token and paste it. **Be sure to run it inside that project folder.**

```weegloo-token
```

```terminal
npx weegloo@latest
```

```terminal readonly
✔ Select your IDE: Claude Code
✔ What would you like to install? MCP server, Skills and Rules
✔ Enter your Weegloo Personal Access Token: ****     ← the token you copied
✔ Select the MCP server group: default
✔ Where would you like to install the configuration? Project
  …
✔  Installation complete!
```
::::
::::step{title="Authenticate the MCP connection"}
Authenticate in the following order.

1. Run Claude Code in your terminal. **Be sure to run it inside the project folder you want to connect.**

   ```terminal
   claude
   ```

2. The first time you run it, it may ask whether to enable the new MCP servers. In that case, confirm that `weegloo` and `weegloo-upload` are checked, and press `Enter` to submit.

   ```terminal readonly
   New MCP servers found in .mcp.json
   Select any you wish to enable.

   > [√] weegloo
     [√] weegloo-upload
   ```

3. Enter `/mcp` to open the MCP server management screen.

   ```terminal
   /mcp
   ```

4. Select `weegloo` from the list. It shows as `needs authentication`.

   ```terminal readonly
   Manage MCP servers

   > weegloo · ∆ needs authentication
     weegloo-upload · √ connected
   ```

   :::note
   **If you do not see the servers in the list**: If `weegloo` and `weegloo-upload` do not appear in the list, you may not have submitted them on the enable screen in step 2, or they may be disabled. Quit Claude Code, enter the command below in your terminal, and run `claude` again. When the same screen as step 2 appears again, make sure `weegloo` and `weegloo-upload` are checked and press `Enter` to submit.

   ```terminal
   claude mcp reset-project-choices
   ```
   :::

5. Confirm the connection URL is `https://ai.weegloo.com/mcp` and select **Authenticate**.

   ```terminal readonly
   Weegloo MCP Server

   Status:  ∆ needs authentication
   URL:     https://ai.weegloo.com/mcp

   > 1. Authenticate
     2. Disable
   ```

6. When you select **Authenticate**, a WEEGLOO authentication page like the one below opens in your browser. Copy your token with the **Copy token** button, paste it, and click **Connect Server**. Once `weegloo` changes to `connected`, you are done.

   ```weegloo-token
   ```

   ![WEEGLOO authentication screen](/install/authorize-en.png)

:::note
After installing, you need to open a new Xcode Agent session for the settings to take effect.
:::
::::
:::::
:::::tab{label="Codex"}
::::step{title="Run the install tool"}
Move to the project folder you want to connect, then run the command below in that folder and choose each prompted item in turn. Where it asks for the token, use the **Copy token** button below to copy the token and paste it. **Be sure to run it inside that project folder.**

```weegloo-token
```

```terminal
npx weegloo@latest
```

```terminal readonly
✔ Select your IDE: Codex
✔ What would you like to install? MCP server, Skills and Rules
✔ Enter your Weegloo Personal Access Token: ****     ← the token you copied
✔ Select the MCP server group: default
✔ Where would you like to install the configuration? Project
  …
✔  Installation complete!
```
::::
::::step{title="Authenticate the MCP connection"}
Authenticate in the following order.

1. Running the command below in your terminal opens the WEEGLOO authentication page in your browser.

   ```terminal
   codex mcp login weegloo
   ```

2. On the WEEGLOO authentication page that opens, copy your token with the **Copy token** button below, paste it, and click **Connect Server**. **An agent that was already running needs to be restarted after authentication completes for the changes to take effect.**

   ```weegloo-token
   ```

   ![WEEGLOO authentication screen](/install/authorize-en.png)

:::note
After installing, you need to open a new Xcode Agent session for the settings to take effect.
:::
::::
:::::
::::::
:::::::
::::::::

## MCP Server Configuration File {#mcp-config-file}

:::note
The install tool automatically creates and manages the configuration file, so you do not need to check it yourself. The content below is reference material for users who need the concrete configuration file structure and paths.
:::

The install tool registers the server in the configuration file of the agent you chose to use inside Xcode. An Xcode connection is always installed into the current project, so the file is created inside the project folder too. The file differs depending on the agent you chose.

- Claude Code: `.mcp.json` in the project folder (the format is the same as in [Claude Code Setup](/ai/tools/connect/claude-code-setup.md#mcp-config-file))
- Codex: `.codex/config.toml` in the project folder (the format is the same as in [Codex Setup](/ai/tools/connect/codex-setup.md#mcp-config-file))

There is one difference specific to using it inside Xcode. A `PATH` entry is added to the `env` of the `weegloo-upload` server, which handles files. Xcode runs agents with a minimal `PATH`, and without this entry it cannot find the `npx` needed to run the server. For Claude Code (`.mcp.json`), it looks like the following.

```json
{
  "mcpServers": {
    "weegloo-upload": {
      "command": "npx",
      "args": ["-y", "weegloo-upload"],
      "env": {
        "PATH": "/Users/jiwoo/.nvm/versions/node/v22.14.0/bin:/usr/bin:/bin",
        "UPLOAD_API_URL": "https://upload.weegloo.com/v1",
        "AUTH_BEARER_TOKEN": "<Personal Access Token>"
      }
    }
  }
}
```

This `PATH` is hardcoded with the location of the Node that ran the install. If you move Node to a new version, this path no longer matches, so after upgrading, run the install tool again to refresh the value.

## Skills and Rules {#skills-and-rules}

Skills and Rules also follow the approach of the agent you chose. For their detailed locations, see the Skills and Rules sections of [Claude Code Setup](/ai/tools/connect/claude-code-setup.md#skills) and [Codex Setup](/ai/tools/connect/codex-setup.md#skills).

## What to Do Next {#what-to-do-next}

- [MCP](/ai/tools/mcp.md): Covers the foundations of the connection, such as server groups and the file upload server.
- [Skills and Rules](/ai/tools/skill-rules.md): Covers what the Skills and Rules that the install tool sets up alongside it are.
- [Keeping up to date](/ai/tools/skill-rules.md#keeping-up-to-date): Covers how to keep the Skills and Rules you installed up to date.
- [Migrating Static Pages with AI](/getting-started/quick-start/intro-7/intro-7-1.md): Follow the flow of migrating a real page into a content-based service with the MCP connection you set up.
