Connecting AI Apps
Connect Claude, Codex, Cursor and other AI apps to your site with Cornerstone MCP, so they can read, build and edit Cornerstone pages.
The Cornerstone MCP plugin runs a Model Context Protocol (MCP) server inside WordPress. It lets an AI app like Claude, Codex, Cursor or GitHub Copilot work in Cornerstone for you. The plugin also adds My Keys, which is covered in the Cornerstone MCP Overview and AI Providers.
Once connected, an AI app can read, build and edit your pages, posts, headers, footers, layouts and components, and change your global colors, fonts and variables. It does this with its own model, so it uses nothing from your Themeco account, with two exceptions:
- Converting a URL or HTML with Instant Builds uses one Instant Build, or none on Unlimited.
- With Studio AI Tools on, the app can have Studio build and edit pages, chat, and make images and speech. These use your credits the same way Studio does.
The server tells the app to say so before it spends anything. See Credits and Billing.
Requirements
- Pro 11.0 or Cornerstone 11.0 or newer, with the Cornerstone MCP plugin installed and active. The plugin needs PHP 8.1 or newer.
- A WordPress administrator account.
- Application Passwords on the site. WordPress offers them over HTTPS or on a local site.
- An AI app that supports MCP over Streamable HTTP. The server takes POST requests only. An app that only speaks SSE needs a bridge such as
mcp-remote, which is what the Claude Desktop setup uses. - Claude Desktop also needs Node.js.
Setting Up
Opening the MCP Settings
Open any page in the builder. Click the sparkle icon at the top of the side panel to open the CSAI panel, click the gear, then click MCP. MCP only shows for administrators while the Cornerstone MCP plugin is active.
The MCP Server switch turns the server on or off for the whole site. While it's off, no AI app can connect.
Creating a Connection
Click Create Connection. Cornerstone creates a WordPress Application Password named Cornerstone MCP for your account, and builds a ready-to-paste setup for each app. Each administrator has their own connection, and an app acts with that user's permissions. The connection's password works only at the MCP endpoint, and the endpoint takes only a password Cornerstone made for a connection.
The setup is shown only once, with the warning "Copy it now. It won't be shown again." It holds your new password, and Cornerstone doesn't keep a copy to show you later.
Pick your app from the select, then click the copy button next to it. The line under the setup says where it goes:
| App | What to do with the setup |
|---|---|
| Claude Code (Terminal) | Run the command in a terminal. |
| Claude (Desktop) | Add it to claude_desktop_config.json, then restart Claude. See Claude Desktop. |
| Codex (OpenAI) | Add it to ~/.codex/config.toml, which the Codex CLI and IDE extension share. Run codex mcp list to check it. |
| GitHub Copilot CLI | Run the command in a terminal. It saves the server to ~/.copilot/mcp-config.json. |
| Cursor | Add it to ~/.cursor/mcp.json, or .cursor/mcp.json in a project. See Cursor. |
| Other Apps | For apps that connect over HTTP. Key names vary by app. |
For example, the Claude Code setup looks like this, with your own site address and credential:
claude mcp add --transport http cornerstone 'https://yoursite.com/wp-json/cornerstone-ai/v1/mcp' --header 'Authorization: Basic <your credential>'Every setup names the server cornerstone. If your app already has a server with that name, remove or rename one of them first.
Treat the setup like a password. Anyone who has it can edit your site as you. Don't commit it to a shared repository or paste it into a chat.
The address apps connect to is shown as the Endpoint, https://yoursite.com/wp-json/cornerstone-ai/v1/mcp. You rarely need it on its own, because every setup includes it.
The Connection Status
The status starts as Not connected. Once you create a connection it reads Ready, and after an app uses it, Connected, with the date it was last used.
If you lost the setup, make a new one and paste it into each app you use. The button reads New Setup before any app has used the connection, and Replace Connection after. Replace Connection asks you to click it again, because apps using the old setup stop working until you paste the new one. Either way, the old password is revoked.
Manage passwords opens the Application Passwords section of your WordPress profile, where you can also revoke the connection.
Studio AI Tools
The Studio AI Tools switch lets connected apps use Studio itself. With it on, your app can have Studio build and edit pages, chat, and make images and speech, using your credits. With it off, the app does all the work with its own model and uses no credits. Instant Builds work either way.
A developer can also set this switch from the site's code. It then can't be changed in Settings. See Developers.
Checking the Connection
Open your AI app and ask "What Cornerstone tools do you have?" or "Brief me on this site." The app should list the Cornerstone tools, or read your site and sum it up. Back in the builder, the status changes to Connected.
If it doesn't connect, see Troubleshooting.
Working With Your AI App
Ask in plain language. You don't need to name tools, because the server tells the app how to work on a Cornerstone site. For example:
- "Review the homepage and list any problems by severity."
- "Build a draft About page with a hero, a three-column team section and a contact call to action. Use our global colors."
- "Change every 'Book a Demo' button to 'Start Free Trial' across the site. Show me the preview first."
- "Add a dark navy to the global colors and use it for the footer background."
- "Undo the last change to the About page."
Keep in mind:
- Changes are live as soon as they're saved, just like pressing Save in the builder.
- Pages and posts get a new revision with every change, so the app can put them back. Headers, footers, layouts and components keep no revisions, so ask for an undo right away, while the app still has the changes.
- If someone has the same document open in the builder and saves after the app, their save overwrites the app's changes.
- The app works within your Cornerstone user permissions. Posts are off by default, even for administrators. Turn on posts for your role in the Role Manager before asking the app to edit posts.
Claude Desktop
These steps connect the Claude desktop app to your site. You copy a block of text from Cornerstone and paste it into one file in Claude. If you use Claude Code in a terminal instead, pick Claude Code (Terminal) in the setup and run the command.
You need everything in Requirements, plus the Claude desktop app for Mac or Windows, signed in.
Step 1: Install Node.js
Claude Desktop connects to your site through a small helper called mcp-remote, which runs on Node.js. You only do this once.
- Go to the Node.js download page. It offers the LTS version by default, which is the one you want.
- Under Or get a prebuilt Node.js, pick your system and click its installer, such as macOS Installer (.pkg).
- Run the installer with its default options.
- Restart your computer, or sign out and back in, so Claude can find Node.js.
To check it worked, open Terminal on Mac or Command Prompt on Windows and run npx -v. A version number means you're ready. You don't need to install mcp-remote yourself, because it's downloaded the first time Claude connects.
Step 2: Copy the Claude Setup
Open the MCP settings, make sure MCP Server is on, and click Create Connection. If you already have a connection, click New Setup or Replace Connection instead.
Pick Claude (Desktop) in the select and click the copy button. Paste it somewhere safe for now, such as a blank note, because it won't be shown again.
Step 3: Open Claude's Config File
In the Claude desktop app, go to Settings > Developer and click Edit Config. Claude shows you a file called claude_desktop_config.json.
Open it in a plain text editor, such as TextEdit on Mac or Notepad on Windows. A word processor can change the quote marks and break the file.
Step 4: Paste the Setup
If the file is empty or only has {}, replace everything with the setup you copied. It looks like this, with your own site address and credential:
{
"mcpServers": {
"cornerstone": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://yoursite.com/wp-json/cornerstone-ai/v1/mcp",
"--header",
"Authorization:${CS_AUTH}"
],
"env": {
"CS_AUTH": "Basic <your credential>"
}
}
}
}On a site without HTTPS, such as a local site, the setup also has "--allow-http" in args. Leave it in.
If the file has other settings but no mcpServers, add the "mcpServers": { ... } part inside the file's outer braces, with a comma after the setting before it.
If the file already has mcpServers, don't add a second one. Copy only the "cornerstone": { ... } block and add it next to your other servers, with a comma between them:
{
"mcpServers": {
"my-other-server": {
"command": "npx",
"args": ["-y", "some-other-server"]
},
"cornerstone": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://yoursite.com/wp-json/cornerstone-ai/v1/mcp", "--header", "Authorization:${CS_AUTH}"],
"env": {
"CS_AUTH": "Basic <your credential>"
}
}
}
}If there's already a server called cornerstone, for example from an older connection, replace it.
Before you save, check that every { and [ has a matching } and ], that there's a comma between servers but none after the last one, and that the quotes are plain straight quotes.
Step 5: Restart Claude
Claude only reads the config file when it starts, so quit Claude completely and open it again. Closing the window isn't always enough. On Mac, choose Claude > Quit Claude or press Cmd+Q. On Windows, quit Claude from its icon in the system tray.
Step 6: Check the Connection
Start a new chat and ask "What Cornerstone tools do you have?", then "Brief me on this site." Claude should list tools such as get_layout and update_layout, then sum up your site. Claude may ask before it uses a tool the first time. Allow it.
Back in the builder, the status changes to Connected.
Cursor
These steps connect Cursor to your site, so its agent can read, build and edit your Cornerstone pages, layouts, components and globals while you work on your code. Cursor connects straight to your site, so you don't need Node.js.
You need everything in Requirements, plus Cursor installed.
Step 1: Copy the Cursor Setup
Open the MCP settings, make sure MCP Server is on, and click Create Connection, or New Setup or Replace Connection if you already have one. Pick Cursor in the select and click the copy button. It won't be shown again.
Step 2: Choose Where the Config Goes
Cursor reads MCP servers from two places:
~/.cursor/mcp.jsonmakes Cornerstone available in every project you open. This suits most people..cursor/mcp.jsoninside a project makes it available in that project only, such as the theme or plugin repo for this site. This helps when you work on several sites.
~ is your home folder, /Users/yourname on Mac or C:\Users\yourname on Windows. If the .cursor folder or mcp.json doesn't exist yet, create it.
Step 3: Paste the Setup
The setup looks like this, with your own site address and credential:
{
"mcpServers": {
"cornerstone": {
"url": "https://yoursite.com/wp-json/cornerstone-ai/v1/mcp",
"headers": {
"Authorization": "Basic <your credential>"
}
}
}
}If mcp.json is new or empty, paste the whole setup and save. If it already has mcpServers, copy only the "cornerstone": { ... } block into it, with a comma between it and the server before it. If there's already a server named cornerstone, replace it or rename one of them.
Cursor's own guide, Model Context Protocol (MCP), covers mcp.json in more detail.
Step 4: Keep the Credential Out of Git
The Authorization value is a password. If you used a project config, add this line to the project's .gitignore:
.cursor/mcp.jsonIf the file was already committed, run git rm --cached .cursor/mcp.json and commit. Treat a credential that has been pushed to a shared repository as leaked: click Replace Connection to revoke it, then paste the new setup.
Step 5: Check the Connection
- Save
mcp.json. If Cursor doesn't pick up the change, reload or restart Cursor. - Open Customize in Cursor's sidebar.
cornerstoneshould be listed with its tools under Available Tools. If it's switched off, switch it on. - In the agent chat, ask "What Cornerstone tools do you have?", then "Brief me on this site."
If the server doesn't show up, open Cursor's Output panel (Cmd+Shift+U on Mac) and pick MCP Logs to see why.
Cursor may ask before it runs each tool. Back in the builder, the status changes to Connected.
WP-CLI
The plugin adds wp csai mcp commands. Run them with --user set to an administrator, because the tools check permissions.
wp csai mcp test --user=<admin> # checks the settings, tools, resources and one read-only call
wp csai mcp tools --user=<admin> # lists the tools with their arguments
wp csai mcp resources --user=<admin> # lists the resources
wp csai mcp call get_account --user=<admin>
wp csai mcp call get_layout --user=<admin> --args='{"post_id":42}'Developers
The Studio AI Tools switch can be set from code, with the CORNERSTONE_AI_MCP_ENABLE_STUDIO constant in wp-config.php or the cs_ai_mcp_studio_enabled filter. While either is set, the switch can't be changed in Settings. The CSAI Developer Guide covers these, and the hooks that add tools and resources to the server.
Troubleshooting
The MCP Section Is Missing
MCP only shows in Settings for administrators while the Cornerstone MCP plugin is active. Install and activate the plugin, and sign in as an administrator.
The App Can't Connect at All
Check that the MCP Server switch is on. While it's off, every AI app gets the error "MCP is turned off on this site. An administrator can turn it on in Studio's Settings > MCP."
"You must be logged in to access the MCP endpoint."
The site didn't accept the credential.
- The connection may have been replaced or revoked. New Setup and Replace Connection both revoke the old password, so paste the new setup into every app again.
- The setup may have been pasted wrong. Paste the whole setup again, exactly as copied.
- If the credential is right and every call still comes back logged out, your host, a proxy or a firewall may be removing the
Authorizationheader before it reaches WordPress. Ask your host to pass it through to PHP, and check that your security plugin allows/wp-json/cornerstone-ai/v1/mcp.
The connection must also belong to an administrator. Sign in as one and create the connection from their account.
"The MCP endpoint takes only the Application Password Studio creates for it."
The app is using an Application Password you made yourself in your WordPress profile. Those are refused. Click Create Connection in the MCP settings and paste that setup into the app instead.
"Application Passwords are off on this site."
Connections are built on WordPress Application Passwords, which WordPress offers over HTTPS or on a local site. Move the site to HTTPS. If it already uses HTTPS, a security plugin or host setting may have turned them off, so look for an Application Passwords option there.
If Create Connection fails with "Could not create the connection." and a reason, the reason comes from WordPress and says what's wrong.
Claude Desktop Shows No Cornerstone Tools
- Check
claude_desktop_config.jsonfor a missing comma or brace, save it, then quit and reopen Claude. Claude's Settings > Developer can show whether the server started. - If
npxcan't be found, Node.js isn't installed, or Claude started before it was. Install Node.js, restart your computer, then open Claude.
Cursor Doesn't List cornerstone
Check mcp.json for a missing comma or brace, and that it's in the right place: ~/.cursor/mcp.json, or .cursor/mcp.json inside the project you have open. Then reload the server in Cursor's MCP settings, or restart Cursor.
See something inaccurate? Let us know