Connect VS Code to your WordPress site
VS Code reads MCP servers from mcp.json. Once the server is added, VS Code reports that it needs a sign-in; approving it opens a browser window for WordPress. Nothing in the snippet is secret, so it is safe to commit to a project.
What you need
- WPSays Free on WordPress 6.9 or later with PHP 8.0 or later.
- VS Code 1.101 or later.
Add your site to VS Code
- In WordPress admin, open the WPSays MCP server dashboard and make sure AI Abilities is on. Under Connect a client, choose OAuth, then VS Code. The screen fills in your own site address and a server name for you.
- Add the config below to
.vscode/mcp.jsonin a workspace, or run MCP: Open User Configuration from the command palette for every workspace. - Restart VS Code. When it reports the server needs a sign-in, approve it and sign in to WordPress.
{
"servers": {
"your-site": {
"type": "http",
"url": "https://your-site.com/wp-json/mcp/flavors-engine-oauth"
}
}
}Check the connection with a safe read
Ask your client for something you can check in WordPress, such as: What is my site title? The client should call Get Site Settings and return the same value you see under Settings → General. A read like this changes nothing on the site. Get Site Settings reference
If it does not connect
- 401 or a sign-in loop. Sign in again from the client, and check that it uses the exact URL from Connect a client, including the full path.
- 403 or a firewall page. A security plugin, host firewall or Cloudflare rule is blocking
/wp-json/. WPSays Free has a Diagnostics screen with a Run Connection Doctor button that tests the route and, if needed, switches the Connect screen to the?rest_route=form of the address. - Tools are missing. The connection only lists the abilities its scope allows, and kits for other plugins load only when that plugin is active. Check the access you approved at sign-in, or the scope of the access token.
All client guides · What the AI can change and how to undo it