Vibe coding with WordPress starts here: connect Claude Code, Codex, Cursor, claude.ai or ChatGPT to the MCP server of Leitvia Studio. Pick the way that fits your AI tool and follow the numbered steps.
For site owners, agencies and developers · Leitvia Studio · Administrator · Checked with Leitvia Studio 1.3.65
| Your AI tool | Way | You need |
|---|---|---|
| claude.ai, Claude Desktop, ChatGPT | A: sign in with OAuth | HTTPS on the site |
| Claude Code, Codex, Cursor and other coding tools | B: an AI agent user with a password | A terminal in your project folder |
Way A: claude.ai or ChatGPT with OAuth
- In WordPress open Leitvia Studio › Agents. In the row Direct connection for AI apps choose Copy address.
- Add the address as a connector. In claude.ai and Claude Desktop: Customize › Connectors › Add custom connector. In ChatGPT: add a custom MCP connector with OAuth; its menus change often, so follow the help of OpenAI.
- The AI app opens the page Connect agent of your site. Sign in there as an administrator.
- Under Work as choose Myself to work with your own account, or an AI agent user. Myself reads and, with Leitvia Pro, decides on change packages in the chat, but never writes. An AI agent user may also change the site if you tick Write.
- Choose Connect. The connection now shows under Leitvia Studio › Agents, section Connections.


Transcript of the video
- Under Leitvia Studio, Agents, the status names the MCP server for AI apps and its address.
- Connections lists every AI client connected over OAuth and the agent user it works as.
- An AI client opens the page Connect agent. A self-registered client is marked not verified.
- Under Work as, choose the agent user the AI client works as.
- Reading is always included. Tick Write only if the AI agent may change the site.
- Connect sends the client back with a code, which it exchanges for its tokens.
- The new connection appears under Connections with its rights, read and write.
- Close connection asks once more, then stops the tokens of that client at once.
Way B: Claude Code or Codex with an AI agent user
- In WordPress open Leitvia Studio › Agents. Under New agent enter a name, such as Claude Code, and choose Create agent.
- The box Application password for Claude Code shows the user name, the password and a ready Command for Claude Code. Choose Copy command. The box is shown only once.
- Open a terminal in your project folder, paste the command and press Enter. Claude Code keeps the password in its settings for this folder on your computer.
- Start
claudeand type/mcp. The serverleitviashows as connected. - Ask the AI agent: Call leitvia/get-contract and tell me the name of the site. The answer names your site, so you know the connection points to the right one.

Codex reads the password from a variable of your terminal. Take the part after Basic from the copied command, then:
export LEITVIA_AUTH_HEADER="Basic <the part after Basic>"
Add the server to ~/.codex/config.toml, or to .codex/config.toml of a trusted project. The file holds only the name of the variable, never the password:
[mcp_servers.leitvia]
url = "https://example.org/wp-json/leitvia-studio/v1/mcp"
env_http_headers = { "Authorization" = "LEITVIA_AUTH_HEADER" }
Transcript of the video
- Under Leitvia Studio, Agents, name the new agent after the tool that uses it.
- Create agent makes a user with the role Leitvia Agent and an application password.
- Copy the password now; it is shown once. Revoke access removes it at any time.
Other AI tools: Cursor, VS Code, Gemini CLI
These tools take the password as a Base64 value of user name:password. Make it once in the terminal, with the user name and password from the box of step 2:
export LEITVIA_AUTH="$(printf '%s' 'agent-claude-code:xxxx xxxx xxxx xxxx xxxx xxxx' | base64 | tr -d '\n')"
Cursor, in .cursor/mcp.json of the project or ~/.cursor/mcp.json:
{
"mcpServers": {
"leitvia": {
"url": "https://example.org/wp-json/leitvia-studio/v1/mcp",
"headers": { "Authorization": "Basic ${env:LEITVIA_AUTH}" }
}
}
}
VS Code signs in with OAuth instead, so it needs no password. Put this into .vscode/mcp.json; VS Code asks you to sign in when the server starts:
{
"servers": {
"leitvia": { "type": "http", "url": "https://example.org/wp-json/leitvia-studio/v1/mcp" }
}
}
The README of Leitvia Skills has the same for Gemini CLI, and a .mcp.json for Claude Code that keeps the password in the environment. Claude Code also works with OAuth: add the server without --header, then sign in with /mcp.
End a connection
- Revoke access deletes the password of an AI agent user at once.
- New password replaces it, for example after a laptop was lost.
- Close connection under Connections ends an OAuth connection of an AI app.


If the connection fails
- 401 although the password is right: the server drops the Authorization header before WordPress sees it. On Apache add
CGIPassAuth Onto.htaccessabove the rules of WordPress, or ask your host. - The AI app offers no sign-in: the site needs HTTPS, the switch Connect over OAuth under Connections must be on, and the address must be the whole path ending in
/mcp. - OAuth discovery: Blocked on the screen Agents: the web server answers 403 at
/.well-known/before WordPress runs. Choose Copy directives and add them to the nginx configuration of the site, wherever your host takes extra nginx directives, or send them to your host. - The AI tool hangs or gets everything at the end: a proxy holds the stream back. nginx follows the header
X-Accel-Buffering: no, which the server sends. On Apache with PHP-FPM turn onflushpacketsand turn off compression for the address. - 403 insufficient_scope: the connection may only read. Connect again and tick Write, or give the task to an AI agent user.
- Claude Code fails under the protocol 2026-07-28: start it once with
MCP_PROTOCOL_NEGOTIATION=legacy claudeto use 2025-11-25.
For developers
- Server: Leitvia Studio runs its own MCP server
leitviaat/wp-json/leitvia-studio/v1/mcp, over streamable HTTP, with no other plugin. On a site of a multisite network in a subdirectory the path starts at the site, such ashttps://example.org/club/wp-json/leitvia-studio/v1/mcp. - Protocol revisions: 2026-07-28 without a session, and 2025-11-25 after
initialize, which also serves clients that ask for 2025-06-18 or 2025-03-26. Another revision gets the error-32022with the list of supported ones. - Tools: one per ability, named with a hyphen, such as
leitvia-get-contractforleitvia/get-contract. - Prompts: every skill and workflow of Leitvia Skills, such as
leitvia-page, in Claude Code/mcp__leitvia__leitvia-page. - Resources: the design contract, the tokens, the patterns, the open change packages and the outline of a page, readable without a tool call.
- Elicitation: under 2026-07-28, a client with form elicitation asks the person before a tool that deletes, removes, rejects or rolls back. A yes is no approval; changes that need one still wait in the Inbox.
- Tasks:
leitvia-apply-recipe,leitvia-audit-siteandleitvia-exportrun in the background for a client with the tasks extension. If a task stays at working, WP-Cron does not reach the site: run the system cron or activate Action Scheduler, which comes with WooCommerce. - Dynamic client registration: on by default (Allow dynamic client registration), for older clients that register themselves. Such a client is marked as not verified on the page Connect agent.
- REST: without an MCP client every ability runs over the Abilities API of WordPress, such as
curl -u "agent-claude-code:xxxx xxxx xxxx xxxx xxxx xxxx" https://example.org/wp-json/wp-abilities/v1/abilities/leitvia/get-site-health/run. The default server of the plugin MCP Adapter offers the same abilities with the same checks.
Data protection
The AI agent reads what its abilities return, such as page content and settings. Where your AI tool sends that depends on the tool; check its terms before you connect a site with personal data. Leitvia sends nothing to an AI service by itself. The only exception is the ability leitvia/plan-page, which uses the AI connector of WordPress that the site owner set up.