@automattic/mcp-wordpress-remote 0.1.13 → 0.1.14
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.
- package/README.md +6 -2
- package/dist/proxy.js +17 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
The mcp-wordpress-remote package acts as a bridge between local Model Context Protocol (MCP) clients and remote WordPress MCP servers. By leveraging npx, you can execute this package without a global installation, simplifying the setup process.
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js version 22 or higher
|
|
8
|
+
|
|
5
9
|
## WordPress MCP plugin
|
|
6
10
|
|
|
7
11
|
You have to install the [wordpress-mcp](https://github.com/Automattic/wordpress-mcp) plugin on your WordPress website, and enable MCP Functionality on Settings > MCP Settings.
|
|
@@ -43,7 +47,7 @@ Example configuration:
|
|
|
43
47
|
"mcpServers": {
|
|
44
48
|
"wordpress-mcp": {
|
|
45
49
|
"command": "npx",
|
|
46
|
-
"args": ["-y", "@automattic/mcp-wordpress-remote"],
|
|
50
|
+
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
|
|
47
51
|
"env": {
|
|
48
52
|
"WP_API_URL": "https://your-wordpress-site.com",
|
|
49
53
|
"WP_API_USERNAME": "your-username",
|
|
@@ -70,7 +74,7 @@ Example configuration:
|
|
|
70
74
|
"mcpServers": {
|
|
71
75
|
"wordpress-mcp": {
|
|
72
76
|
"command": "npx",
|
|
73
|
-
"args": ["-y", "@automattic/mcp-wordpress-remote"],
|
|
77
|
+
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
|
|
74
78
|
"env": {
|
|
75
79
|
"WP_API_URL": "https://your-wordpress-site.com",
|
|
76
80
|
"WP_API_USERNAME": "your-username",
|
package/dist/proxy.js
CHANGED
|
@@ -8,9 +8,8 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
8
8
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
9
9
|
import * as fs from "node:fs";
|
|
10
10
|
import * as path from "node:path";
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
if (process.env.LOG_FILE || process.env.LOG_DIR) {
|
|
11
|
+
var LOG_FILE = process.env.LOG_FILE || null;
|
|
12
|
+
if (LOG_FILE) {
|
|
14
13
|
const logDir = path.dirname(LOG_FILE);
|
|
15
14
|
if (!fs.existsSync(logDir)) {
|
|
16
15
|
fs.mkdirSync(logDir, { recursive: true });
|
|
@@ -21,7 +20,7 @@ function log(message, ...args) {
|
|
|
21
20
|
const formattedArgs = args.length > 0 ? args.map((arg) => typeof arg === "object" ? JSON.stringify(arg) : arg).join(" ") : "";
|
|
22
21
|
const logMessage = `${timestamp}: ${message}${formattedArgs ? " " + formattedArgs : ""}
|
|
23
22
|
`;
|
|
24
|
-
if (
|
|
23
|
+
if (LOG_FILE) {
|
|
25
24
|
fs.appendFileSync(LOG_FILE, logMessage);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -114,6 +113,20 @@ import {
|
|
|
114
113
|
CompleteRequestSchema,
|
|
115
114
|
ListRootsRequestSchema
|
|
116
115
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
116
|
+
var requiredNodeVersion = 22;
|
|
117
|
+
var currentNodeVersion = parseInt(process.version.slice(1).split(".")[0]);
|
|
118
|
+
if (currentNodeVersion < requiredNodeVersion) {
|
|
119
|
+
log(`Error: This application requires Node.js version ${requiredNodeVersion} or higher.`);
|
|
120
|
+
log(`Current version: ${process.version}`);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
if (typeof globalThis.fetch !== "function") {
|
|
124
|
+
log(
|
|
125
|
+
"Error: This application requires the fetch API, which is not available in your Node.js environment."
|
|
126
|
+
);
|
|
127
|
+
log("Please ensure you are using Node.js 22 or later, or install node-fetch.");
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
117
130
|
async function WordPressProxy() {
|
|
118
131
|
const init = await wpRequest({ method: "init" });
|
|
119
132
|
const server = new Server(
|