-
Notifications
You must be signed in to change notification settings - Fork 20
Incorrect API Endpoint for Self-Hosted WordPress (404 - No route found) #26
Copy link
Copy link
Open
Description
Summary:
I'm having trouble connecting to several sites, public and local, that use the wordpress-mcp plugin. Previously these were working. I tracked down the issue as being that mcp-wordpress-remote is selecting the wrong API endpoint for my self-hosted sites, resulting in a 404 error. I looks like this would be the correct endpoint if I had a wpcom hosted site.
Environment:
Local WordPress site running at: http://localhost:8860/
Logs of requested route /?rest_route=/wpcom/v2/mcp/v1
2025-08-14T00:59:12.796Z [INFO] [PROXY] Starting WordPress MCP Proxy with enhanced authentication
2025-08-14T00:59:12.797Z [INFO] [PROXY] Initializing connection to WordPress API...
2025-08-14T00:59:12.797Z [INFO] [API] Request method: initialize
2025-08-14T00:59:12.797Z [DEBUG] [API] Request args: {}
2025-08-14T00:59:12.797Z [INFO] [AUTH] Using JWT token authentication
2025-08-14T00:59:12.797Z [DEBUG] [AUTH] Token length: 239
2025-08-14T00:59:12.797Z [DEBUG] [API] Environment: development
2025-08-14T00:59:12.797Z [DEBUG] [API] Base API URL: http://localhost:8860
2025-08-14T00:59:12.797Z [DEBUG] [API] Final requesting URL: http://localhost:8860/?rest_route=/wpcom/v2/mcp/v1
2025-08-14T00:59:12.797Z [INFO] [API] Sending request to WordPress API...
2025-08-14T00:59:12.797Z [DEBUG] [API] Request URL: http://localhost:8860/?rest_route=/wpcom/v2/mcp/v1
2025-08-14T00:59:12.797Z [DEBUG] [API] Request method: POST
2025-08-14T00:59:12.869Z [DEBUG] [API] Response status: 404
2025-08-14T00:59:12.869Z [ERROR] [API] API error response: {"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}
As a workaround, I created a proxy using the Redirection plugin to serve the correct endpoint from the incorrect endpoint.
proxy /?rest_route=/wpcom/v2/mcp/v1
to return /?rest_route=/wp/v2/wpmcp/
2025-08-14T01:51:00.502Z [INFO] [PROXY] Starting WordPress MCP Proxy with enhanced authentication
2025-08-14T01:51:00.503Z [INFO] [PROXY] Initializing connection to WordPress API...
2025-08-14T01:51:00.504Z [INFO] [API] Request method: initialize
2025-08-14T01:51:00.504Z [DEBUG] [API] Request args: {}
2025-08-14T01:51:00.504Z [INFO] [AUTH] Using JWT token authentication
2025-08-14T01:51:00.504Z [DEBUG] [AUTH] Token length: 239
2025-08-14T01:51:00.504Z [DEBUG] [API] Environment: development
2025-08-14T01:51:00.504Z [DEBUG] [API] Base API URL: http://localhost:8860
2025-08-14T01:51:00.504Z [DEBUG] [API] Final requesting URL: http://localhost:8860/?rest_route=/wpcom/v2/mcp/v1
2025-08-14T01:51:00.504Z [INFO] [API] Sending request to WordPress API...
2025-08-14T01:51:00.504Z [DEBUG] [API] Request URL: http://localhost:8860/?rest_route=/wpcom/v2/mcp/v1
2025-08-14T01:51:00.504Z [DEBUG] [API] Request method: POST
2025-08-14T01:51:00.585Z [DEBUG] [API] Response status: 200
2025-08-14T01:51:00.585Z [INFO] [API] Response received successfully
2025-08-14T01:51:00.586Z [INFO] [PROXY] MCP server connected to transport successfully
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels