Forum Replies Created

Viewing 15 replies - 1 through 15 (of 373 total)
  • Thread Starter one3rdnerd

    (@one3rdnerd)

    You and me both! 🙂 I appreciate your help getting there.

    Hopefully those points help someone else with frustrating server setups get there more promptly, no pub intended.

    Timeouts – Ah, okay, maybe that’s documented, and I missed it while speed running the info. I’d think maybe Cloudflare is a contributing factor too, as that’s where the redirect and cache rules were setup but I could be wrong.

    You’re welcome. I look forward to testing it some more now that I have it running on one of my sites, rather than a client’s, and I can be a bit more aggressive and experimental with my changes/tests, etc. I have been around long enough to know that improving the way people use WordPress and open source tools is a collective effort! 🙂

    At the expense of sounding ominous, I’m sure you will hear from me again :p haha.

    We can mark this thread as closed, though.

    Thanks for sharing your solution @paddyv

    I was having the same issue with Siteground but I had to make some other changes, so I’m going to share them on this thread because my support thread is a bit convoluted.

    1. If using Windows the curl test needs to be formatted as curl.exe -i “https://example.com/.well-known/oauth-authorization-server/wp-json/mcp/v1;
    2. The rules didn’t work for me at first, when I tried the curl test, it still threw a 404. So I switched to “Edit expression” and pasted the below changing the domain
      (http.host eq “example.com” and http.request.uri.path eq “/.well-known/oauth-authorization-server/wp-json/mcp/v1”)
    3. Worth mentioning you have to have your URL behind Cloudflare’s proxy for the rewrite to take effect. I was using Cloudflare already but it was set to DNS only.
    4.  I had to add bypass the Cloudflare cache for the endpoint Cloudflare – bypass cache for the MCP paths. Caching → Cache Rules → Create rule:
      If: URI Path | starts with | /wp-json/mcp/
      Then: Cache eligibility → Bypass cache
      Deploy.
    5. I was using SG Optimizer, so had to exclude the path from the SG cache too. SiteGround – exclude the path from dynamic cache. SG Optimizer → Caching → add /wp-json/mcp/* to the dynamic-cache URL exclusions.

      Hopefully that helps anyone if they get stuck with your instructions.
    Thread Starter one3rdnerd

    (@one3rdnerd)

    Update: I closed Claude Desktop and left it for 30 minutes, then I tried again and this time it was instant, so maybe it was a transient issue due to only changing all of these settings shortly before. So it looks like it was fixed.

    It might be worth adding those additional things I mentioned in my last response to the updated docs you mentioned on https://ww.wp.xz.cn/support/topic/mcp-oauth-claude-connector-fails-couldnt-reach-the-mcp-server/

    1) Making sure proxy is on in Cloudflare

    2) “Edit expression” and using
    (http.host eq “example.com” and http.request.uri.path eq “/.well-known/oauth-authorization-server/wp-json/mcp/v1”)

    3) On windows you have to test with curl.exe -i “https://example.com/.well-known/oauth-authorization-server/wp-json/mcp/v1”

    4) Cloudflare – bypass cache for the MCP paths. Caching → Cache Rules → Create rule

    5) SiteGround – exclude the path from dynamic cache. SG Optimizer → Caching → add /wp-json/mcp/* to the dynamic-cache URL exclusions.

    Then the setup with SiteGround should be pretty bulletproof.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hi Jordy,

    Thanks for that. I did read it, but I don’t think I fully understood everything.

    Thanks for sharing the step-by-step recipe. Claude did suggest setting up redirects in .htaccess, so I was going to try that next but I’ll give the Cloudflare approach a try.

    Update: It seems to be working, albeit very slowly.

    A couple of differences in my case.

    1) Worth mentioning you have to have your URL behind Cloudflare’s proxy for the rewrite to take effect. I was using Cloudflare already but it was set to DNS only.
    2) The rules didn’t work for me at first, when I tried the curl test, it still threw a 404. So I switched to “Edit expression” and used
    (http.host eq “example.com” and http.request.uri.path eq “/.well-known/oauth-authorization-server/wp-json/mcp/v1”)
    This managed to give me the 200 response.
    3) On windows you have to test with curl.exe -i “https://example.com/.well-known/oauth-authorization-server/wp-json/mcp/v1”

    When I opened Claude Desktop again and went to my custom connector and hit connect, it gave me the screen I was hoping for that asks me if I want to connect:

    Authorize this app Claude wants to connect to Pixelloop. Signed in as (admin) Permissions Administrator (full access) The app will be able to call MCP tools using your account. You can revoke access at any time from AI Engine settings.

    I click Approve and then it goes to the Couldn’t Connect screen I was hitting before as soon as I clicked connect.

    Authorization with the MCP server failed. You can check your credentials and permissions. If this persists, share this reference with support: “ofid_859bce83377c145a”

    I had to make two other changes:

    1) Cloudflare – bypass cache for the MCP paths. Caching → Cache Rules → Create rule:

    • If: URI Path | starts with | /wp-json/mcp/
    • Then: Cache eligibility → Bypass cache
    • Deploy.

    2) SiteGround – exclude the path from dynamic cache. SG Optimizer → Caching → add /wp-json/mcp/* to the dynamic-cache URL exclusions.

    After I made the above two changes and tried to connect again, it successfully connected after I approved the connection in my browser.

    But, when I go to use the connector in a Claude Code chat in the desktop app, I ask a question as a test (Check my website using Pixelloop A Engine and tell me how many published pages I have)

    Then it asks for permission to check.

    I’ll check pixelloop.org via the Pixelloop AI Engine. Let me load the right tool. Used 3 tools

    The count call timed out. Let me verify the server is still responsive, then retry.

    Used d83aca91-a3ac-44af-bee9-ab2019b1b4ba: mcp ping

    Server’s fine. Retrying the page count.

    Used d83aca91-a3ac-44af-bee9-ab2019b1b4ba: wp count posts

    post_type: page

    Tool call timed out waiting for server response.

    The count endpoint keeps timing out (ping works, so it’s that specific query being slow). Let me try the pages listing endpoint instead.Used 2 tools

    100 pages came back (the per-request max) and the payload was huge. Let me count entries in that file and then paginate for the rest. First, count this batch:Ran 4 commands

    Done. I queried pixelloop.org through the Pixelloop AI Engine.Result: 29 published pages

    I requested up to 100 published pages (post_type=pagestatus=publish) and the engine returned exactly 29 — since that’s fewer than the 100 max, it’s the complete set, no pagination needed.

    A few notes:

    • This counts WordPress Pages specifically (not blog posts/post type). If you also want the count of published blog posts, say the word and I’ll pull that too.
    • The dedicated wp_count_posts endpoint timed out twice (the server itself is fine — mcp_ping responded both times), so I got the number directly from the pages listing instead, which is reliable here.

    Okay, so it’s working now, great, but is it normal for it to take 8 minutes to answer the question “How many pages do I have published?) it seems like a long time and I want to see if that’s the same for you too?

    I followed up with:

    (List my registered post types.)

    That also took 3m22s for it to reply. It also timed out a few times while trying to work it out. Are timeouts normal? Or could this just be an ephemeral result due to Claude being overloaded or having issues? My server and site seem fine and snappy.

    I guess I should test it again tomorrow and see if it’s faster.

    I appreciate your input and advice on this.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Okay, I spent an hour or so trying everything with Claude to debug this.

    Here’s what I have (pasted from Claude) hopefully this is on the right path.


    here’s the full mechanism, start to finish:

    Claude Code connects, gets the 401, reads the protected-resource metadata, and correctly discovers the auth server as https://pixelloop.org/wp-json/mcp/v1.
    It then tries to fetch that server’s metadata at the strict RFC 8414 location – https://pixelloop.org/.well-known/oauth-authorization-server/wp-json/mcp/v1 – which SiteGround’s nginx 404s before WordPress sees it. Metadata discovery fails.
    With no metadata, the client falls back to default OAuth endpoints at the domain root: https://pixelloop.org/register, /authorize, /token.
    It POSTs its registration to https://pixelloop.org/register, which does reach WordPress, finds no such page, and returns your themed 404. The client tries to parse that HTML as an OAuth response – “Unrecognized token ‘<‘” – and dies.

    The irony: AI Engine serves its metadata at the path-append location (/wp-json/mcp/v1/.well-known/…) precisely because hosts like SiteGround block root /.well-known/. That’s a sensible choice. But Claude Code’s client only looks at the RFC 8414 root location, doesn’t find it, and falls back to the wrong place. It’s a genuine interop gap between the plugin’s metadata placement and the client’s discovery logic – and definitively not your configuration. Your server is flawless; we proved every endpoint by hand.
    Where to go from here, in priority order:

    1. Report it to the AI Engine dev – this is the real fix, and the one most likely to fix Desktop too. Precise wording:

    here’s the full mechanism, start to finish:

    1. Claude Code connects, gets the 401, reads the protected-resource metadata, and correctly discovers the auth server as https://pixelloop.org/wp-json/mcp/v1.
    2. It then tries to fetch that server’s metadata at the strict RFC 8414 location – https://pixelloop.org/.well-known/oauth-authorization-server/wp-json/mcp/v1 – which SiteGround’s nginx 404s before WordPress sees it. Metadata discovery fails.
    3. With no metadata, the client falls back to default OAuth endpoints at the domain root: https://pixelloop.org/register, /authorize, /token.
    4. It POSTs its registration to https://pixelloop.org/register, which does reach WordPress, finds no such page, and returns your themed 404. The client tries to parse that HTML as an OAuth response – “Unrecognized token ‘<‘” – and dies.

    The irony: AI Engine serves its metadata at the path-append location (/wp-json/mcp/v1/.well-known/...) precisely because hosts like SiteGround block root /.well-known/. That’s a sensible choice. But Claude Code’s client only looks at the RFC 8414 root location, doesn’t find it, and falls back to the wrong place. It’s a genuine interop gap between the plugin’s metadata placement and the client’s discovery logic – and definitively not your configuration. Your server is flawless; we proved every endpoint by hand.

    Where to go from here, in priority order:

    Report it to the AI Engine dev – this is the real fix, and the one most likely to fix Desktop too. Precise wording:

    MCP OAuth fails from spec-compliant clients (Claude Code 2.1.150) when the issuer is a subpath like /wp-json/mcp/v1. The client looks for AS metadata at the RFC 8414 location https://site/.well-known/oauth-authorization-server/wp-json/mcp/v1, which on SiteGround is intercepted by nginx and 404s before reaching WordPress. The plugin only serves metadata at the path-append location. With discovery failing, the client falls back to default endpoints at the domain root (/register, /authorize, /token) and gets the themed 404. Can the plugin serve metadata where RFC 8414 clients look, or advise on hosting setups that block root /.well-known/?

    Does this help? I can give you access if you want to test for yourself.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Actually, Claude pointed out an issue with the curl in Powershell.

    So I ran it again with:

    '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}' | Out-File -Encoding ascii body.json

    curl.exe -i -X POST "https://pixelloop.org/wp-json/mcp/v1/http" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" --data "@body.json"

    This time I got

    HTTP/1.1 401 Unauthorized
    Server: nginx
    Date: Tue, 26 May 2026 16:02:57 GMT
    Content-Type: application/json; charset=UTF-8
    Content-Length: 98
    Connection: keep-alive
    X-Robots-Tag: noindex
    Link: <https://pixelloop.org/wp-json/>; rel="https://api.w.org/"
    X-Content-Type-Options: nosniff
    Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link
    Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type
    X-Cache-Enabled: False
    WWW-Authenticate: Bearer realm="MCP", resource_metadata="https://pixelloop.org/wp-json/mcp/v1/.well-known/oauth-protected-resource"
    X-Httpd-Modphp: 1
    Host-Header: 8441280b0c35cbc1147f8ba998a563a7
    X-Proxy-Cache-Info: DT:1

    {"code":"rest_forbidden","message":"Sorry, you are not allowed to do that.","data":{"status":401}}

    So I think that’s correct because of a lack of a bearer token when doing it from the Terminal rather than the Claude Desktop app.

    When testing in the Claude Desktop app I’m still getting the error, so it looks like Siteground is still refusing even when we take that approach where a bearer token isn’t needed.

    What can we take away from this? Anything?

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Update: I have sent Siteground a pretty stern ultimatum about getting to the bottom of this and fixing it.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hi Jordy,

    Ah, okay. Thank you.

    So, I ran that test, though I am using Windows and Powershell, so I had to modify it to

    curl.exe -i -X POST “https://yoursite.example/wp-json/mcp/v1/http” -H “Content-Type: application/json” -H “Accept: application/json, text/event-stream” –data ‘{“jsonrpc”:”2.0″,”id”:1,”method”:”initialize”,”params”:{“protocolVersion”:”2025-06-18″,”capabilities”:{},”clientInfo”:{“name”:”test”,”version”:”1″}}}’

    (obviously replacing https://yoursite.example with my domain)

    It came back with

    HTTP/1.1 400 Bad Request
    Server: nginx
    Date: Tue, 26 May 2026 14:49:16 GMT
    Content-Type: application/json; charset=UTF-8
    Content-Length: 144
    Connection: keep-alive
    X-Robots-Tag: noindex
    Link: https://pixelloop.org/wp-json/; rel=”https://api.w.org/&#8221;
    X-Content-Type-Options: nosniff
    Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link
    Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type
    X-Cache-Enabled: False
    X-Httpd-Modphp: 1
    Host-Header: 8441280b0c35cbc1147f8ba998a563a7
    X-Proxy-Cache-Info: DT:1

    {“code”:”rest_invalid_json”,”message”:”Invalid JSON body passed.”,”data”:{“status”:400,”json_error_code”:4,”json_error_message”:”Syntax error”}}

    I have asked Siteground to explain where it’s getting stuck and to look at the logs, but they are being a pain in the ass.

    I’ll send them the above again, but starting to think Siteground isn’t a platform worth sticking with at this point, my issue is, I manage 90+ websites all on Siteground, and many of them want this facility.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Just following up on this as I haven’t been able to make any progress and wondered if you have experienced this?

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Agreed.

    I tried setting up the MCP on a new Siteground site and when I click connect and it opens the browser to authenticate I get

    Couldn’t Connect

    Taking you back to the desktop app. You can close this tab.

    Couldn’t reach the MCP server. You can check the server URL and verify the server is running. If this persists, share this reference with support: “ofid_851d5aac6a049e29”

    I had Siteground whitelist my IP address and the IP addresses Anthropic uses but I can’t seem to get past that error.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Thanks for that breakdown. All very interesting.

    On reflection, I guess my concern or what I want to be careful about, is avoiding duplicating functionality and having native AI features clash with AI Engine. From what you have said, it sounds like if you are already using AI Engine, the best move is to do very little, and allow AI Engine to do the interfacing (like with the Abilities API) and leave the rest alone as the plugin is already covering it all and over time, I imagine you will continue to take advantage of any additional improvements that native AI provides.

    Interesting point about the WebMCP-style tools. I look forward to seeing how everything evolves. Exciting times for sure!

    I appreciate you taking the time to share.

    Feel free to close this thread.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hi @tigroumeow,

    Thank you.

    Sorry, I should have followed up to let you know I had worked that out. Yes, just add a custom name for each site, which is actually a nice way to manage it and probably better than them all running under one MCP.

    At the expense of wanting to keep this thread on topic, one unrelated question I had about AI Engine…

    How do you see it evolving when WP 7 drops with their new native AI capabilities? Will you piggy back off of those? or will your AI implementation remain separate? Does WP 7’s native AI features give you any more opportunities or are they just implementing what you are already doing?

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hey @tigroumeow

    Thank you for your update, and no worries on the delay. I appreciate you getting back to me when you were able to.

    Wow, that’s awesome, I guess you really are one step ahead! 🙂

    Okay, I’ll give this a try and see how I get on.

    I guess my only thought about the plugin is, what if I manage 10 websites and want to use AI Engine in Claude for all of them. The best approach is just to add each individually and name them appropriately so it’s easy to reference which site I want to use?

    Ah, okay. I wasn’t even aware of that.

    Care to share your snippet?

    @veryaca

    I’m not having any issues. Can you provide more info? What versions of WP, this plugin etc. What is your actual issue? You can’t access the Appearance > Menu’s?

Viewing 15 replies - 1 through 15 (of 373 total)