> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Your AI Client

> Configuration for Claude Desktop, Claude Code, Cursor, VS Code Copilot, OpenAI Codex, ZenCoder, and other MCP hosts.

Choose the installation guide for the application you use:

<CardGroup cols={2}>
  <Card title="Claude Code CLI" icon="terminal" href="/mcp-server/claude-code-plugin#install-in-claude-code-cli">
    Install the plugin from your terminal, with an agent skill and workflow commands.
  </Card>

  <Card title="Claude Desktop" icon="desktop" href="/mcp-server/claude-desktop-bundle">
    Install the MCP Bundle through the Desktop app's extension dialog.
  </Card>
</CardGroup>

The manual configurations below run `npx -y @mainwp/mcp` with your Dashboard URL, WordPress username, and [Application Password](/mcp-server/quickstart#before-you-start). Use them for another AI client or when you prefer a manual server connection.

If you keep credentials in a central `~/.config/mainwp-mcp/settings.json` instead (see [Configuration Reference](/mcp-server/reference/configuration#configuration-file)), omit the `env` block in any of these examples.

In MainWP Dashboard 6.3, open **AI > MainWP MCP** for [guided setup](/mcp-server/quickstart#guided-setup-in-mainwp-dashboard). The Application Password success dialog also offers a **Connect an AI tool** panel with prefilled Claude Code, Cursor, and VS Code configurations. Copy the format for your client while the password is visible; see [Application Passwords](/api-reference/rest-api/application-passwords#connect-an-ai-tool).

<Tabs>
  <Tab title="Claude Desktop">
    For extension installation, use [Install in Claude Desktop](/mcp-server/claude-desktop-bundle). The instructions below are the manual config-file alternative.

    Edit the Claude Desktop configuration file:

    * **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
    * **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

    Add the MainWP server to the `mcpServers` block (create the file if it does not exist):

    ```json theme={null} theme={null} theme={null}
    {
      "mcpServers": {
        "mainwp": {
          "command": "npx",
          "args": ["-y", "@mainwp/mcp"],
          "env": {
            "MAINWP_URL": "https://your-dashboard.com",
            "MAINWP_USER": "admin",
            "MAINWP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
          }
        }
      }
    }
    ```

    Replace the URL with your Dashboard address, the username with the WordPress user that owns the Application Password, and the password with the one WordPress generated. Spaces in the password are fine either way, WordPress accepts it with or without them.

    Restart Claude Desktop after saving.
  </Tab>

  <Tab title="Claude Code CLI">
    For the plugin, agent skill, and workflow commands, use [Install in Claude Code CLI](/mcp-server/claude-code-plugin#install-in-claude-code-cli). The commands below add only the MCP server manually.

    Add the server from your terminal:

    ```bash theme={null}
    claude mcp add --transport stdio --scope user mainwp \
      --env MAINWP_URL=https://your-dashboard.com \
      --env MAINWP_USER=admin \
      --env MAINWP_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
      -- npx -y @mainwp/mcp
    ```

    With a central settings file, the short form works:

    ```bash theme={null}
    claude mcp add --transport stdio --scope user mainwp -- npx -y @mainwp/mcp
    ```

    User scope makes the server available across projects. The command contains the password and can remain in shell history. You can also define the same server in `~/.claude.json`.
  </Tab>

  <Tab title="Cursor">
    Add to `~/.cursor/mcp.json` globally. This configuration contains a password; keep it out of a shared project's `.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "mainwp": {
          "command": "npx",
          "args": ["-y", "@mainwp/mcp"],
          "env": {
            "MAINWP_URL": "https://your-dashboard.com",
            "MAINWP_USER": "admin",
            "MAINWP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
          }
        }
      }
    }
    ```

    Cursor also supports `${env:VAR_NAME}` placeholders if you prefer referencing system environment variables.
  </Tab>

  <Tab title="VS Code Copilot">
    Add to `.vscode/mcp.json` in your project (requires VS Code 1.101+ with Agent Mode):

    ```json theme={null}
    {
      "servers": {
        "mainwp": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@mainwp/mcp"],
          "env": {
            "MAINWP_URL": "https://your-dashboard.com",
            "MAINWP_USER": "admin",
            "MAINWP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
          }
        }
      }
    }
    ```

    VS Code can prompt for the password at runtime so it is never stored in the file:

    ```json theme={null}
    {
      "inputs": [
        {
          "type": "promptString",
          "id": "mainwp_password",
          "description": "MainWP Application Password",
          "password": true
        }
      ],
      "servers": {
        "mainwp": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@mainwp/mcp"],
          "env": {
            "MAINWP_URL": "https://your-dashboard.com",
            "MAINWP_USER": "admin",
            "MAINWP_APP_PASSWORD": "${input:mainwp_password}"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="OpenAI Codex">
    Add to `~/.codex/config.toml`:

    ```toml theme={null}
    [mcp_servers.mainwp]
    command = "npx"
    args = ["-y", "@mainwp/mcp"]

    [mcp_servers.mainwp.env]
    MAINWP_URL = "https://your-dashboard.com"
    MAINWP_USER = "admin"
    MAINWP_APP_PASSWORD = "xxxx xxxx xxxx xxxx xxxx xxxx"
    ```
  </Tab>

  <Tab title="ZenCoder">
    In VS Code, add the server under `zencoder.mcpServers` in `settings.json`:

    ```json theme={null}
    {
      "zencoder.mcpServers": {
        "mainwp": {
          "command": "npx",
          "args": ["-y", "@mainwp/mcp"],
          "env": {
            "MAINWP_URL": "https://your-dashboard.com",
            "MAINWP_USER": "admin",
            "MAINWP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
          }
        }
      }
    }
    ```

    In JetBrains, go to **Settings → Tools → Zencoder → MCP Servers** and use the same JSON structure.
  </Tab>

  <Tab title="Other MCP hosts">
    Windsurf and most other MCP hosts use the same JSON pattern:

    * `command`: `npx`
    * `args`: `["-y", "@mainwp/mcp"]`
    * `env`: `MAINWP_URL`, `MAINWP_USER`, and `MAINWP_APP_PASSWORD`

    Check your host's documentation for where its MCP configuration lives.
  </Tab>
</Tabs>

## Managing multiple Dashboards

Give each Dashboard its own folder with its own `settings.json`, then point each server entry at the right folder with `cwd`:

```json theme={null}
{
  "mcpServers": {
    "mainwp-production": {
      "command": "npx",
      "args": ["-y", "@mainwp/mcp"],
      "cwd": "/path/to/production-credentials"
    },
    "mainwp-staging": {
      "command": "npx",
      "args": ["-y", "@mainwp/mcp"],
      "cwd": "/path/to/staging-credentials"
    }
  }
}
```

The server reads `./settings.json` from its working directory first, so each entry picks up its own credentials. Details in the [Configuration Reference](/mcp-server/reference/configuration#configuration-file).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.