@automattic/mcp-wordpress-remote 0.3.1 → 0.3.4
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 -0
- package/dist/lib.d.ts +26 -4
- package/dist/lib.js +17224 -5253
- package/dist/proxy.js +36867 -16868
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -266,6 +266,12 @@ For WooCommerce-specific tools and reports:
|
|
|
266
266
|
| `WP_MCP_CONFIG_DIR` | Config directory override | `~/.mcp-auth` | - |
|
|
267
267
|
| `LOG_FILE` | Log file path | - | - |
|
|
268
268
|
| `LOG_LEVEL` | Log level (0-3) | `2` | - |
|
|
269
|
+
| `LOG_TO_STDERR` | Mirror all log levels to stderr (errors always are) | `false` | - |
|
|
270
|
+
| `WP_API_TIMEOUT_MS` | Request timeout for tool calls (ms) | `120000` | - |
|
|
271
|
+
| `WP_API_INIT_TIMEOUT_MS` | Timeout for the initialize handshake (ms) | `25000` | - |
|
|
272
|
+
| **TLS / Certificates** | | | |
|
|
273
|
+
| `NODE_EXTRA_CA_CERTS` | Path to an extra CA file to trust (mkcert/corporate CA) | - | - |
|
|
274
|
+
| `NODE_USE_SYSTEM_CA` | Trust the OS certificate store (Node 22.15+) | - | - |
|
|
269
275
|
| **Legacy Authentication** | | | |
|
|
270
276
|
| `JWT_TOKEN` | JWT token for authentication | - | - |
|
|
271
277
|
| `WP_API_USERNAME` | WordPress username (legacy) | - | - |
|
package/dist/lib.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ interface WordPressResponse {
|
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
declare const MCP_WORDPRESS_REMOTE_VERSION = "0.3.
|
|
18
|
+
declare const MCP_WORDPRESS_REMOTE_VERSION = "0.3.4";
|
|
19
19
|
/**
|
|
20
20
|
* Centralized configuration for MCP WordPress Remote
|
|
21
21
|
* All default values are defined here and can be overridden via environment variables
|
|
@@ -36,6 +36,8 @@ declare const CONFIG: {
|
|
|
36
36
|
readonly OAUTH_SCOPES: string;
|
|
37
37
|
readonly OAUTH_TIMEOUT: 30000;
|
|
38
38
|
readonly LOCK_TIMEOUT: 300000;
|
|
39
|
+
readonly WP_API_TIMEOUT: number;
|
|
40
|
+
readonly WP_API_INIT_TIMEOUT: number;
|
|
39
41
|
readonly WP_MCP_CONFIG_DIR: string;
|
|
40
42
|
readonly LOG_FILE: string | null;
|
|
41
43
|
readonly WP_API_USERNAME: string | undefined;
|
|
@@ -75,6 +77,10 @@ declare const getConfig: () => {
|
|
|
75
77
|
oauthTimeout: 30000;
|
|
76
78
|
/** Lock operation timeout in milliseconds */
|
|
77
79
|
lockTimeout: 300000;
|
|
80
|
+
/** WordPress request timeout in milliseconds (tool calls and non-init requests) */
|
|
81
|
+
wpApiTimeout: number;
|
|
82
|
+
/** WordPress initialize handshake timeout in milliseconds */
|
|
83
|
+
wpApiInitTimeout: number;
|
|
78
84
|
/** Configuration directory path */
|
|
79
85
|
configDir: string;
|
|
80
86
|
/** Log file path (null if not set) */
|
|
@@ -217,7 +223,9 @@ declare class APIError extends Error {
|
|
|
217
223
|
readonly statusCode: number;
|
|
218
224
|
readonly endpoint: string;
|
|
219
225
|
readonly response?: any;
|
|
220
|
-
|
|
226
|
+
/** Underlying network/TLS error code (e.g. "UNABLE_TO_VERIFY_LEAF_SIGNATURE"), when the failure was below the HTTP layer. */
|
|
227
|
+
readonly code?: string;
|
|
228
|
+
constructor(message: string, statusCode: number, endpoint: string, response?: any, code?: string);
|
|
221
229
|
}
|
|
222
230
|
/**
|
|
223
231
|
* Error type guards
|
|
@@ -282,16 +290,30 @@ declare function getFetchInfo(): {
|
|
|
282
290
|
*
|
|
283
291
|
* Supports:
|
|
284
292
|
* - macOS: Automatic PAC file detection from system proxy settings
|
|
285
|
-
* - macOS: System SOCKS proxy detection (
|
|
293
|
+
* - macOS: System SOCKS proxy detection (manual "tunnel all traffic" config)
|
|
286
294
|
* - All platforms: Environment variables (SOCKS_PROXY, HTTPS_PROXY, etc.)
|
|
287
295
|
*/
|
|
288
296
|
|
|
289
297
|
type ProxyAgent = SocksProxyAgent | HttpsProxyAgent<string>;
|
|
298
|
+
interface MacOsProxyInfo {
|
|
299
|
+
pacUrl: string | null;
|
|
300
|
+
socks: {
|
|
301
|
+
host: string;
|
|
302
|
+
port: string;
|
|
303
|
+
} | null;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Detector for macOS system proxy settings. Injectable so the precedence
|
|
307
|
+
* logic in doInitializeProxy() can be tested without shelling out to scutil.
|
|
308
|
+
*/
|
|
309
|
+
type MacOsProxyDetector = () => MacOsProxyInfo | null;
|
|
290
310
|
/**
|
|
291
311
|
* Initialize proxy configuration (call once at startup)
|
|
292
312
|
* Guards against concurrent initialization calls
|
|
313
|
+
*
|
|
314
|
+
* @param detectMacOs - Optional override for macOS proxy detection (testing seam)
|
|
293
315
|
*/
|
|
294
|
-
declare function initializeProxy(): Promise<void>;
|
|
316
|
+
declare function initializeProxy(detectMacOs?: MacOsProxyDetector): Promise<void>;
|
|
295
317
|
/**
|
|
296
318
|
* Get appropriate agent for a URL based on proxy configuration
|
|
297
319
|
*/
|