How to connect Novamira via OAuth
Tutorials
Novamira connects a WordPress site to Claude Code over MCP, and the clean way to authenticate is OAuth. On an Nginx server the flow usually dies before it starts: Claude Code asks the site for its OAuth discovery documents at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server, WordPress has no idea those paths exist, and Nginx returns a 404. The connection fails quietly and you end up connecting manually.
The fix is to answer both discovery paths at the server level with static JSON. This recipe is what works for me: a RunCloud-managed VPS, Novamira Pro on the site, and the Claude Code desktop app.
One prerequisite before you start: you'll need Claude Code installed in your terminal. If you haven't set that up yet, here's the official install guide.
1. Add the Nginx config
In RunCloud, open the web application, go to Nginx Config, and add a custom config of type location.main-before. Paste this and save; RunCloud reloads Nginx for you.
location ^~ /.well-known/oauth-protected-resource {
default_type application/json;
return 200 '{"resource":"https://$host/wp-json/mcp/novamira-oauth","authorization_servers":["https://$host"],"bearer_methods_supported":["header"],"scopes_supported":["mcp"]}';
}
location ^~ /.well-known/oauth-authorization-server {
default_type application/json;
return 200 '{"issuer":"https://$host","authorization_endpoint":"https://$host/wp-admin/admin.php?page=novamira-oauth-authorize","token_endpoint":"https://$host/wp-json/novamira/v1/oauth/token","registration_endpoint":"https://$host/wp-json/novamira/v1/oauth/register","revocation_endpoint":"https://$host/wp-json/novamira/v1/oauth/revoke","introspection_endpoint":"https://$host/wp-json/novamira/v1/oauth/introspect","response_types_supported":["code"],"grant_types_supported":["authorization_code","refresh_token"],"code_challenge_methods_supported":["S256"],"token_endpoint_auth_methods_supported":["none"],"scopes_supported":["mcp"]}';
}
The config uses $host, so the same block works for every site on the server with no per-site editing. On a server without RunCloud, put the same two blocks inside the site's server {} block, then nginx -t and reload.
2. Check the two endpoints
Before touching WordPress, confirm the server answers:
curl https://yourwebsite.com/.well-known/oauth-authorization-server
You should get the JSON back, not a 404 or an HTML page. Same for oauth-protected-resource.
3. Enable the REST API
Novamira rides on /wp-json/. If you disable the REST API by default (ASE or another security plugin), re-enable it for this site, or the token endpoints above will never respond.
4. Point Claude Code at the site
- Install and activate Novamira (I am on Pro; not sure the Free tier carries this), then open its Configuration page.
- Select Claude Code as the client and copy the setup command it gives you. It looks like this, with your own domain in place of the placeholder:
claude mcp add --transport http --scope user 'novamira-yourwebsite-com' 'https://yourwebsite.com/wp-json/mcp/novamira-oauth' - You should now have the MCP server installed. To initiate the authentication, first ask Claude Code to give you the command to
cdinto the working directory. - Open your Terminal (Ctrl+X > Terminal), then paste the command from step 3. You should now be in your working directory folder in Terminal. Type
claudeto launch Claude Code in the terminal, then/mcp, then select the newly installed MCP server and hit Authenticate. - This should open a browser tab with a button from Novamira to authenticate the request – hit it (make sure that browser is logged in to wp-admin), then go back to the Claude Code terminal and wait a few seconds for it to register. Then you can close the terminal.
- Lastly, go back to Claude Code Desktop and ask Claude to test the connection to verify everything works.
That is the whole fix. Claude Desktop might work with the same server config, but this exact recipe is only tested with Claude Code.