@automattic/mcp-wordpress-remote 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/proxy.js +4 -1
  2. package/package.json +1 -1
package/dist/proxy.js CHANGED
@@ -1945,8 +1945,11 @@ function constructApiUrl(baseUrl, defaultEndpoint) {
1945
1945
  try {
1946
1946
  const urlObj = new URL(cleanUrl);
1947
1947
  const hasCustomPath = urlObj.pathname && urlObj.pathname !== "/" && urlObj.pathname.length > 0;
1948
+ const isWordPressComPublicApi = urlObj.hostname === "public-api.wordpress.com";
1948
1949
  if (hasCustomPath) {
1949
1950
  return cleanUrl;
1951
+ } else if (isWordPressComPublicApi) {
1952
+ return new URL(defaultEndpoint, cleanUrl).toString();
1950
1953
  } else {
1951
1954
  return new URL(`/?rest_route=${defaultEndpoint}`, cleanUrl).toString();
1952
1955
  }
@@ -2041,7 +2044,7 @@ async function getOAuthTokens() {
2041
2044
  }
2042
2045
  async function wpRequest(params = { method: "init" }) {
2043
2046
  validateEnvironment();
2044
- const endpoint = "/wp/v2/wpmcp";
2047
+ const endpoint = "/wpcom/v2/mcp/v1";
2045
2048
  const method = "POST";
2046
2049
  logger.api(`Request method: ${params.method || "init"}`);
2047
2050
  logger.debug(`Request args: ${JSON.stringify(params.args || {})}`, "API");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/mcp-wordpress-remote",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "MCP WordPress Remote proxy server",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"