mcp-wordpress 3.0.0 → 3.1.0
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 +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/system.d.ts +22 -0
- package/dist/tools/system.d.ts.map +1 -0
- package/dist/tools/system.js +21 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/tools/version.d.ts +12 -0
- package/dist/tools/version.d.ts.map +1 -0
- package/dist/tools/version.js +135 -0
- package/dist/tools/version.js.map +1 -0
- package/docs/DXT_UPDATE_GUIDE.md +220 -0
- package/package.json +1 -1
- package/src/tools/index.ts +1 -0
- package/src/tools/system.ts +23 -0
- package/src/tools/version.ts +162 -0
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ Response: "✅ Authentication successful! Connected to: Your Site Name"
|
|
|
102
102
|
2. **Install**: Claude Desktop → Extensions → Install → Select DXT file
|
|
103
103
|
3. **Configure**: Enter your WordPress site URL and credentials
|
|
104
104
|
|
|
105
|
-
✅ **Zero command line required** ✅ **
|
|
105
|
+
✅ **Zero command line required** ✅ **Easy updates** ✅ **Built-in security**
|
|
106
106
|
|
|
107
107
|
**[📖 Complete DXT Setup Guide →](docs/integrations/claude-desktop.md)**
|
|
108
108
|
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as PerformanceTools } from "./performance.js";
|
|
|
7
7
|
export { default as PostTools } from "./posts.js";
|
|
8
8
|
export { default as SEOTools } from "./seo/index.js";
|
|
9
9
|
export { default as SiteTools } from "./site.js";
|
|
10
|
+
export { default as SystemTools } from "./system.js";
|
|
10
11
|
export { default as TaxonomyTools } from "./taxonomies.js";
|
|
11
12
|
export { default as UserTools } from "./users.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { default as PerformanceTools } from "./performance.js";
|
|
|
7
7
|
export { default as PostTools } from "./posts.js";
|
|
8
8
|
export { default as SEOTools } from "./seo/index.js";
|
|
9
9
|
export { default as SiteTools } from "./site.js";
|
|
10
|
+
export { default as SystemTools } from "./system.js";
|
|
10
11
|
export { default as TaxonomyTools } from "./taxonomies.js";
|
|
11
12
|
export { default as UserTools } from "./users.js";
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System Tools
|
|
3
|
+
*
|
|
4
|
+
* Provides system-level utilities like version checking
|
|
5
|
+
*/
|
|
6
|
+
import { WordPressClient } from "../client/api.js";
|
|
7
|
+
export default class SystemTools {
|
|
8
|
+
getTools(): {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | undefined;
|
|
11
|
+
inputSchema: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
type: "object";
|
|
14
|
+
properties?: {
|
|
15
|
+
[x: string]: object;
|
|
16
|
+
} | undefined;
|
|
17
|
+
required?: string[] | undefined;
|
|
18
|
+
};
|
|
19
|
+
handler: (_client: WordPressClient, args: Record<string, unknown>) => Promise<string>;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ;;;;;;;;;;;2BAMuB,eAAe,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;CAM9E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System Tools
|
|
3
|
+
*
|
|
4
|
+
* Provides system-level utilities like version checking
|
|
5
|
+
*/
|
|
6
|
+
import { CHECK_VERSION_TOOL, handleCheckVersion } from "./version.js";
|
|
7
|
+
export default class SystemTools {
|
|
8
|
+
getTools() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
name: CHECK_VERSION_TOOL.name,
|
|
12
|
+
description: CHECK_VERSION_TOOL.description,
|
|
13
|
+
inputSchema: CHECK_VERSION_TOOL.inputSchema,
|
|
14
|
+
handler: async (_client, args) => {
|
|
15
|
+
return await handleCheckVersion(args);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ;QACN,OAAO;YACL;gBACE,IAAI,EAAE,kBAAkB,CAAC,IAAI;gBAC7B,WAAW,EAAE,kBAAkB,CAAC,WAAW;gBAC3C,WAAW,EAAE,kBAAkB,CAAC,WAAW;gBAC3C,OAAO,EAAE,KAAK,EAAE,OAAwB,EAAE,IAA6B,EAAE,EAAE;oBACzE,OAAO,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACxC,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Check Tool
|
|
3
|
+
*
|
|
4
|
+
* Checks if a newer version of mcp-wordpress is available on GitHub
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
export declare const CHECK_VERSION_TOOL: Tool;
|
|
8
|
+
/**
|
|
9
|
+
* Handler for wp_check_version tool
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleCheckVersion(args: unknown): Promise<string>;
|
|
12
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAS1D,eAAO,MAAM,kBAAkB,EAAE,IAahC,CAAC;AAmEF;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA+DvE"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Check Tool
|
|
3
|
+
*
|
|
4
|
+
* Checks if a newer version of mcp-wordpress is available on GitHub
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { readFileSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
const CheckVersionArgsSchema = z.object({
|
|
10
|
+
current_version: z.string().optional().describe("Override current version for testing"),
|
|
11
|
+
});
|
|
12
|
+
export const CHECK_VERSION_TOOL = {
|
|
13
|
+
name: "wp_check_version",
|
|
14
|
+
description: "Check if a newer version of mcp-wordpress is available. Returns current version, latest version, and download URL if update is available.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
current_version: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Override current version for testing (optional)",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get the current version from package.json
|
|
27
|
+
*/
|
|
28
|
+
function getCurrentVersion() {
|
|
29
|
+
try {
|
|
30
|
+
const packageJsonPath = join(__dirname, "..", "..", "package.json");
|
|
31
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
32
|
+
return packageJson.version;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return "unknown";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Compare semantic versions
|
|
40
|
+
* Returns: 1 if v1 > v2, -1 if v1 < v2, 0 if equal
|
|
41
|
+
*/
|
|
42
|
+
function compareVersions(v1, v2) {
|
|
43
|
+
const clean1 = v1.replace(/^v/, "");
|
|
44
|
+
const clean2 = v2.replace(/^v/, "");
|
|
45
|
+
const parts1 = clean1.split(".").map(Number);
|
|
46
|
+
const parts2 = clean2.split(".").map(Number);
|
|
47
|
+
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
48
|
+
const part1 = parts1[i] || 0;
|
|
49
|
+
const part2 = parts2[i] || 0;
|
|
50
|
+
if (part1 > part2)
|
|
51
|
+
return 1;
|
|
52
|
+
if (part1 < part2)
|
|
53
|
+
return -1;
|
|
54
|
+
}
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Fetch latest release from GitHub
|
|
59
|
+
*/
|
|
60
|
+
async function getLatestRelease() {
|
|
61
|
+
try {
|
|
62
|
+
const response = await fetch("https://api.github.com/repos/docdyhr/mcp-wordpress/releases/latest", {
|
|
63
|
+
headers: {
|
|
64
|
+
Accept: "application/vnd.github.v3+json",
|
|
65
|
+
"User-Agent": "mcp-wordpress-server",
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return (await response.json());
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Handler for wp_check_version tool
|
|
79
|
+
*/
|
|
80
|
+
export async function handleCheckVersion(args) {
|
|
81
|
+
try {
|
|
82
|
+
const parsed = CheckVersionArgsSchema.parse(args);
|
|
83
|
+
// Get current version
|
|
84
|
+
const currentVersion = parsed.current_version || getCurrentVersion();
|
|
85
|
+
if (currentVersion === "unknown") {
|
|
86
|
+
return "❌ Unable to determine current version. Package.json not found.";
|
|
87
|
+
}
|
|
88
|
+
// Fetch latest release from GitHub
|
|
89
|
+
const latestRelease = await getLatestRelease();
|
|
90
|
+
if (!latestRelease) {
|
|
91
|
+
return `ℹ️ Unable to check for updates (GitHub API unavailable).\n\nCurrent version: ${currentVersion}\n\nManually check: https://github.com/docdyhr/mcp-wordpress/releases`;
|
|
92
|
+
}
|
|
93
|
+
const latestVersion = latestRelease.tag_name.replace(/^v/, "");
|
|
94
|
+
const comparison = compareVersions(currentVersion, latestVersion);
|
|
95
|
+
if (comparison === 0) {
|
|
96
|
+
return `✅ **You're up to date!**\n\nCurrent version: v${currentVersion}\nLatest version: v${latestVersion}\n\nNo update needed.`;
|
|
97
|
+
}
|
|
98
|
+
if (comparison > 0) {
|
|
99
|
+
return `🔬 **You're running a pre-release version**\n\nCurrent version: v${currentVersion}\nLatest stable: v${latestVersion}\n\nYou're ahead of the latest stable release.`;
|
|
100
|
+
}
|
|
101
|
+
// Update available
|
|
102
|
+
const dxtUrl = `https://github.com/docdyhr/mcp-wordpress/releases/download/v${latestVersion}/mcp-wordpress.dxt`;
|
|
103
|
+
let releaseNotes = "";
|
|
104
|
+
if (latestRelease.body) {
|
|
105
|
+
// Extract first 500 characters of release notes
|
|
106
|
+
const notes = latestRelease.body.substring(0, 500);
|
|
107
|
+
releaseNotes = `\n\n**What's New:**\n${notes}${latestRelease.body.length > 500 ? "..." : ""}`;
|
|
108
|
+
}
|
|
109
|
+
return `🎉 **Update Available!**
|
|
110
|
+
|
|
111
|
+
**Current version:** v${currentVersion}
|
|
112
|
+
**Latest version:** v${latestVersion}
|
|
113
|
+
**Released:** ${new Date(latestRelease.published_at).toLocaleDateString()}
|
|
114
|
+
|
|
115
|
+
**Download Links:**
|
|
116
|
+
- DXT Package: ${dxtUrl}
|
|
117
|
+
- Release Page: ${latestRelease.html_url}
|
|
118
|
+
|
|
119
|
+
**Update Instructions:**
|
|
120
|
+
1. Backup your configuration (if using multi-site)
|
|
121
|
+
2. Uninstall current version from Claude Desktop
|
|
122
|
+
3. Download the new DXT package
|
|
123
|
+
4. Install in Claude Desktop → Extensions
|
|
124
|
+
5. Restore your configuration
|
|
125
|
+
|
|
126
|
+
**Documentation:** https://github.com/docdyhr/mcp-wordpress/blob/main/docs/DXT_UPDATE_GUIDE.md${releaseNotes}`;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (error instanceof z.ZodError) {
|
|
130
|
+
return `❌ Invalid arguments: ${error.issues.map((e) => e.message).join(", ")}`;
|
|
131
|
+
}
|
|
132
|
+
return `❌ Error checking version: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# DXT Package Update Guide
|
|
2
|
+
|
|
3
|
+
**Important**: Claude Desktop does **NOT** automatically update DXT packages. You must manually update to get the latest features and fixes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Why Manual Updates?](#why-manual-updates)
|
|
10
|
+
- [How to Check Your Version](#how-to-check-your-version)
|
|
11
|
+
- [Update Process](#update-process)
|
|
12
|
+
- [Update Notification Tool](#update-notification-tool)
|
|
13
|
+
- [What's New in v3.0.0](#whats-new-in-v300)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why Manual Updates?
|
|
18
|
+
|
|
19
|
+
DXT packages in Claude Desktop require manual updates because:
|
|
20
|
+
|
|
21
|
+
1. **No Auto-Update Mechanism**: Claude Desktop doesn't currently support automatic DXT updates
|
|
22
|
+
2. **User Control**: You decide when to update (important for stability)
|
|
23
|
+
3. **Configuration Preservation**: Manual updates let you backup configs first
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## How to Check Your Version
|
|
28
|
+
|
|
29
|
+
### Method 1: Check in Claude Desktop
|
|
30
|
+
|
|
31
|
+
Ask Claude:
|
|
32
|
+
```
|
|
33
|
+
What version of mcp-wordpress are you running?
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Claude will respond with the current version number.
|
|
37
|
+
|
|
38
|
+
### Method 2: Check Manifest File
|
|
39
|
+
|
|
40
|
+
The DXT package is installed at:
|
|
41
|
+
```
|
|
42
|
+
~/Library/Application Support/Claude/Claude Extensions/local.dxt.thomas-dyhr.mcp-wordpress/manifest.json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Open this file and look for the `version` field.
|
|
46
|
+
|
|
47
|
+
### Method 3: Check Logs
|
|
48
|
+
|
|
49
|
+
View the server logs:
|
|
50
|
+
```bash
|
|
51
|
+
tail -50 ~/Library/Logs/Claude/mcp-server-WordPress\ MCP\ Server.log
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The version is shown when the server starts.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Update Process
|
|
59
|
+
|
|
60
|
+
### Step 1: Backup Your Configuration
|
|
61
|
+
|
|
62
|
+
If you're using multi-site configuration:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Find your DXT installation directory
|
|
66
|
+
cd ~/Library/Application\ Support/Claude/Claude\ Extensions/local.dxt.thomas-dyhr.mcp-wordpress/
|
|
67
|
+
|
|
68
|
+
# Backup your config file (if it exists)
|
|
69
|
+
cp mcp-wordpress.config.json ~/mcp-wordpress.config.json.backup
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 2: Download Latest Version
|
|
73
|
+
|
|
74
|
+
Visit the releases page:
|
|
75
|
+
https://github.com/docdyhr/mcp-wordpress/releases/latest
|
|
76
|
+
|
|
77
|
+
Download: `mcp-wordpress.dxt`
|
|
78
|
+
|
|
79
|
+
### Step 3: Uninstall Old Version
|
|
80
|
+
|
|
81
|
+
1. Open **Claude Desktop**
|
|
82
|
+
2. Go to **Settings** → **Extensions**
|
|
83
|
+
3. Find **WordPress MCP Server**
|
|
84
|
+
4. Click **Uninstall** or **Remove**
|
|
85
|
+
|
|
86
|
+
### Step 4: Install New Version
|
|
87
|
+
|
|
88
|
+
1. In Claude Desktop, go to **Settings** → **Extensions**
|
|
89
|
+
2. Click **Install Extension** or **Add Extension**
|
|
90
|
+
3. Select the downloaded `mcp-wordpress.dxt` file
|
|
91
|
+
4. Follow the configuration wizard
|
|
92
|
+
|
|
93
|
+
**Single-Site**: Enter your WordPress credentials in the UI
|
|
94
|
+
|
|
95
|
+
**Multi-Site**: Skip the wizard, then copy your backed-up config:
|
|
96
|
+
```bash
|
|
97
|
+
cp ~/mcp-wordpress.config.json.backup ~/Library/Application\ Support/Claude/Claude\ Extensions/local.dxt.thomas-dyhr.mcp-wordpress/mcp-wordpress.config.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Step 5: Restart Claude Desktop
|
|
101
|
+
|
|
102
|
+
Completely quit and relaunch Claude Desktop to load the new version.
|
|
103
|
+
|
|
104
|
+
### Step 6: Verify Update
|
|
105
|
+
|
|
106
|
+
Ask Claude:
|
|
107
|
+
```
|
|
108
|
+
What version of mcp-wordpress are you running?
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
It should report the new version number.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Update Notification Tool
|
|
116
|
+
|
|
117
|
+
The MCP WordPress server includes a version check tool that compares your installed version with the latest GitHub release.
|
|
118
|
+
|
|
119
|
+
### Using the Version Check Tool
|
|
120
|
+
|
|
121
|
+
Ask Claude:
|
|
122
|
+
```
|
|
123
|
+
Check if there's a new version of mcp-wordpress available
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Or use the tool directly:
|
|
127
|
+
```
|
|
128
|
+
wp_check_version
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Response Example**:
|
|
132
|
+
```
|
|
133
|
+
✅ You're up to date! (v3.0.0)
|
|
134
|
+
|
|
135
|
+
or
|
|
136
|
+
|
|
137
|
+
⚠️ Update available!
|
|
138
|
+
Current version: v2.12.0
|
|
139
|
+
Latest version: v3.0.0
|
|
140
|
+
Download: https://github.com/docdyhr/mcp-wordpress/releases/tag/v3.0.0
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## What's New in v3.0.0
|
|
146
|
+
|
|
147
|
+
### 🚀 Features
|
|
148
|
+
- Circuit breaker pattern for improved resilience
|
|
149
|
+
- Deprecation documentation for API lifecycle management
|
|
150
|
+
|
|
151
|
+
### 🐛 Security & Bug Fixes
|
|
152
|
+
- Resolved CodeQL security warnings
|
|
153
|
+
- Fixed js-yaml vulnerability
|
|
154
|
+
- Updated MCP SDK and body-parser dependencies
|
|
155
|
+
- Fixed flaky tests in env-loading, logger, and timing
|
|
156
|
+
|
|
157
|
+
### ♻️ Refactoring
|
|
158
|
+
- Migrated to path aliases (improved maintainability)
|
|
159
|
+
- Modularized api.ts and performance.ts
|
|
160
|
+
- Extracted SecurityCIPipeline into modular components
|
|
161
|
+
|
|
162
|
+
### 📚 Documentation
|
|
163
|
+
- Added sprint implementation documentation
|
|
164
|
+
- Removed Smithery references
|
|
165
|
+
- Updated README with v2.12.0+ features
|
|
166
|
+
|
|
167
|
+
**Full Changelog**: https://github.com/docdyhr/mcp-wordpress/blob/main/CHANGELOG.md
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Troubleshooting
|
|
172
|
+
|
|
173
|
+
### "Extension not found after update"
|
|
174
|
+
|
|
175
|
+
1. Make sure you completely quit Claude Desktop (not just close window)
|
|
176
|
+
2. On macOS, use Cmd+Q to fully quit
|
|
177
|
+
3. Relaunch Claude Desktop
|
|
178
|
+
|
|
179
|
+
### "Configuration lost after update"
|
|
180
|
+
|
|
181
|
+
If you forgot to backup your config:
|
|
182
|
+
|
|
183
|
+
1. Check if the old installation directory still exists:
|
|
184
|
+
```bash
|
|
185
|
+
ls ~/Library/Application\ Support/Claude/Claude\ Extensions/
|
|
186
|
+
```
|
|
187
|
+
2. Look for directories with older version numbers
|
|
188
|
+
3. Copy the config file from there
|
|
189
|
+
|
|
190
|
+
### "Server won't start after update"
|
|
191
|
+
|
|
192
|
+
1. Check the logs:
|
|
193
|
+
```bash
|
|
194
|
+
tail -100 ~/Library/Logs/Claude/mcp-server-WordPress\ MCP\ Server.log
|
|
195
|
+
```
|
|
196
|
+
2. Look for error messages
|
|
197
|
+
3. If you see authentication errors, reconfigure your credentials
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Best Practices
|
|
202
|
+
|
|
203
|
+
1. **Check for Updates Monthly**: Visit the releases page regularly
|
|
204
|
+
2. **Read Release Notes**: Understand what's changed before updating
|
|
205
|
+
3. **Backup Configs**: Always backup before uninstalling
|
|
206
|
+
4. **Test After Update**: Verify your sites still work after updating
|
|
207
|
+
5. **Report Issues**: If something breaks, open a GitHub issue
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Need Help?
|
|
212
|
+
|
|
213
|
+
- 📖 **Documentation**: https://github.com/docdyhr/mcp-wordpress
|
|
214
|
+
- 🐛 **Issues**: https://github.com/docdyhr/mcp-wordpress/issues
|
|
215
|
+
- 💬 **Discussions**: https://github.com/docdyhr/mcp-wordpress/discussions
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
**Last Updated**: 2026-01-08
|
|
220
|
+
**Current Version**: 3.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-wordpress",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Comprehensive Model Context Protocol server for WordPress management with composition-based architecture, 59 tools, SEO toolkit, performance monitoring, intelligent caching, and production-ready authentication",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
package/src/tools/index.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { default as PerformanceTools } from "./performance.js";
|
|
|
7
7
|
export { default as PostTools } from "./posts.js";
|
|
8
8
|
export { default as SEOTools } from "./seo/index.js";
|
|
9
9
|
export { default as SiteTools } from "./site.js";
|
|
10
|
+
export { default as SystemTools } from "./system.js";
|
|
10
11
|
export { default as TaxonomyTools } from "./taxonomies.js";
|
|
11
12
|
export { default as UserTools } from "./users.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System Tools
|
|
3
|
+
*
|
|
4
|
+
* Provides system-level utilities like version checking
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { WordPressClient } from "@/client/api.js";
|
|
8
|
+
import { CHECK_VERSION_TOOL, handleCheckVersion } from "./version.js";
|
|
9
|
+
|
|
10
|
+
export default class SystemTools {
|
|
11
|
+
getTools() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
name: CHECK_VERSION_TOOL.name,
|
|
15
|
+
description: CHECK_VERSION_TOOL.description,
|
|
16
|
+
inputSchema: CHECK_VERSION_TOOL.inputSchema,
|
|
17
|
+
handler: async (_client: WordPressClient, args: Record<string, unknown>) => {
|
|
18
|
+
return await handleCheckVersion(args);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Check Tool
|
|
3
|
+
*
|
|
4
|
+
* Checks if a newer version of mcp-wordpress is available on GitHub
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
import { join } from "path";
|
|
11
|
+
|
|
12
|
+
const CheckVersionArgsSchema = z.object({
|
|
13
|
+
current_version: z.string().optional().describe("Override current version for testing"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const CHECK_VERSION_TOOL: Tool = {
|
|
17
|
+
name: "wp_check_version",
|
|
18
|
+
description:
|
|
19
|
+
"Check if a newer version of mcp-wordpress is available. Returns current version, latest version, and download URL if update is available.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
current_version: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Override current version for testing (optional)",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
interface GitHubRelease {
|
|
32
|
+
tag_name: string;
|
|
33
|
+
name: string;
|
|
34
|
+
html_url: string;
|
|
35
|
+
published_at: string;
|
|
36
|
+
body: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the current version from package.json
|
|
41
|
+
*/
|
|
42
|
+
function getCurrentVersion(): string {
|
|
43
|
+
try {
|
|
44
|
+
const packageJsonPath = join(__dirname, "..", "..", "package.json");
|
|
45
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
46
|
+
return packageJson.version;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return "unknown";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Compare semantic versions
|
|
54
|
+
* Returns: 1 if v1 > v2, -1 if v1 < v2, 0 if equal
|
|
55
|
+
*/
|
|
56
|
+
function compareVersions(v1: string, v2: string): number {
|
|
57
|
+
const clean1 = v1.replace(/^v/, "");
|
|
58
|
+
const clean2 = v2.replace(/^v/, "");
|
|
59
|
+
|
|
60
|
+
const parts1 = clean1.split(".").map(Number);
|
|
61
|
+
const parts2 = clean2.split(".").map(Number);
|
|
62
|
+
|
|
63
|
+
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
64
|
+
const part1 = parts1[i] || 0;
|
|
65
|
+
const part2 = parts2[i] || 0;
|
|
66
|
+
|
|
67
|
+
if (part1 > part2) return 1;
|
|
68
|
+
if (part1 < part2) return -1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Fetch latest release from GitHub
|
|
76
|
+
*/
|
|
77
|
+
async function getLatestRelease(): Promise<GitHubRelease | null> {
|
|
78
|
+
try {
|
|
79
|
+
const response = await fetch("https://api.github.com/repos/docdyhr/mcp-wordpress/releases/latest", {
|
|
80
|
+
headers: {
|
|
81
|
+
Accept: "application/vnd.github.v3+json",
|
|
82
|
+
"User-Agent": "mcp-wordpress-server",
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return (await response.json()) as GitHubRelease;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Handler for wp_check_version tool
|
|
98
|
+
*/
|
|
99
|
+
export async function handleCheckVersion(args: unknown): Promise<string> {
|
|
100
|
+
try {
|
|
101
|
+
const parsed = CheckVersionArgsSchema.parse(args);
|
|
102
|
+
|
|
103
|
+
// Get current version
|
|
104
|
+
const currentVersion = parsed.current_version || getCurrentVersion();
|
|
105
|
+
|
|
106
|
+
if (currentVersion === "unknown") {
|
|
107
|
+
return "❌ Unable to determine current version. Package.json not found.";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Fetch latest release from GitHub
|
|
111
|
+
const latestRelease = await getLatestRelease();
|
|
112
|
+
|
|
113
|
+
if (!latestRelease) {
|
|
114
|
+
return `ℹ️ Unable to check for updates (GitHub API unavailable).\n\nCurrent version: ${currentVersion}\n\nManually check: https://github.com/docdyhr/mcp-wordpress/releases`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const latestVersion = latestRelease.tag_name.replace(/^v/, "");
|
|
118
|
+
const comparison = compareVersions(currentVersion, latestVersion);
|
|
119
|
+
|
|
120
|
+
if (comparison === 0) {
|
|
121
|
+
return `✅ **You're up to date!**\n\nCurrent version: v${currentVersion}\nLatest version: v${latestVersion}\n\nNo update needed.`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (comparison > 0) {
|
|
125
|
+
return `🔬 **You're running a pre-release version**\n\nCurrent version: v${currentVersion}\nLatest stable: v${latestVersion}\n\nYou're ahead of the latest stable release.`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Update available
|
|
129
|
+
const dxtUrl = `https://github.com/docdyhr/mcp-wordpress/releases/download/v${latestVersion}/mcp-wordpress.dxt`;
|
|
130
|
+
|
|
131
|
+
let releaseNotes = "";
|
|
132
|
+
if (latestRelease.body) {
|
|
133
|
+
// Extract first 500 characters of release notes
|
|
134
|
+
const notes = latestRelease.body.substring(0, 500);
|
|
135
|
+
releaseNotes = `\n\n**What's New:**\n${notes}${latestRelease.body.length > 500 ? "..." : ""}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return `🎉 **Update Available!**
|
|
139
|
+
|
|
140
|
+
**Current version:** v${currentVersion}
|
|
141
|
+
**Latest version:** v${latestVersion}
|
|
142
|
+
**Released:** ${new Date(latestRelease.published_at).toLocaleDateString()}
|
|
143
|
+
|
|
144
|
+
**Download Links:**
|
|
145
|
+
- DXT Package: ${dxtUrl}
|
|
146
|
+
- Release Page: ${latestRelease.html_url}
|
|
147
|
+
|
|
148
|
+
**Update Instructions:**
|
|
149
|
+
1. Backup your configuration (if using multi-site)
|
|
150
|
+
2. Uninstall current version from Claude Desktop
|
|
151
|
+
3. Download the new DXT package
|
|
152
|
+
4. Install in Claude Desktop → Extensions
|
|
153
|
+
5. Restore your configuration
|
|
154
|
+
|
|
155
|
+
**Documentation:** https://github.com/docdyhr/mcp-wordpress/blob/main/docs/DXT_UPDATE_GUIDE.md${releaseNotes}`;
|
|
156
|
+
} catch (error) {
|
|
157
|
+
if (error instanceof z.ZodError) {
|
|
158
|
+
return `❌ Invalid arguments: ${error.issues.map((e) => e.message).join(", ")}`;
|
|
159
|
+
}
|
|
160
|
+
return `❌ Error checking version: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
161
|
+
}
|
|
162
|
+
}
|