@noleemits/vision-builder-control-mcp 4.5.7 → 4.5.11
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/index.js +58 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* WordPress plugin: Noleemits Vision Builder Control (nvbc/v1 REST endpoints)
|
|
32
32
|
*
|
|
33
|
-
* Version: 4.
|
|
33
|
+
* Version: 4.5.11
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
@@ -94,8 +94,8 @@ process.on('SIGINT', () => {
|
|
|
94
94
|
// CONFIG
|
|
95
95
|
// ================================================================
|
|
96
96
|
|
|
97
|
-
const VERSION = '4.5.
|
|
98
|
-
const MIN_PLUGIN_VERSION = '4.5.
|
|
97
|
+
const VERSION = '4.5.11';
|
|
98
|
+
const MIN_PLUGIN_VERSION = '4.5.11'; // Minimum WP plugin version required by this MCP server
|
|
99
99
|
|
|
100
100
|
// ================================================================
|
|
101
101
|
// PARAMETER HELPERS
|
|
@@ -1807,11 +1807,27 @@ function getToolDefinitions() {
|
|
|
1807
1807
|
},
|
|
1808
1808
|
{
|
|
1809
1809
|
name: 'check_links',
|
|
1810
|
-
description: 'Check all URLs on Elementor pages for broken links (404, 500, timeout).
|
|
1810
|
+
description: 'Check all URLs on Elementor pages for broken links (404, 500, timeout). Results are cached per-URL for 24 hours — subsequent calls are instant for already-checked URLs. Use force_refresh=true to re-fetch everything.',
|
|
1811
1811
|
inputSchema: {
|
|
1812
1812
|
type: 'object',
|
|
1813
1813
|
properties: {
|
|
1814
|
-
page_id:
|
|
1814
|
+
page_id: { type: 'number', description: 'Optional: check only this page.' },
|
|
1815
|
+
force_refresh: { type: 'boolean', description: 'If true, bypass cache and re-fetch all URLs. Default: false.' }
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
name: 'clear_link_cache',
|
|
1821
|
+
description: 'Clear the persistent link status cache. Use when you know URLs have changed and want the next check_links call to re-fetch everything from scratch.',
|
|
1822
|
+
inputSchema: { type: 'object', properties: {} }
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
name: 'warm_link_cache',
|
|
1826
|
+
description: 'Pre-warm the link status cache by fetching the site\'s XML sitemap, extracting all URLs, and HEAD-checking each one. Handles staging environments automatically — sitemap URLs with a different domain are normalized to the current site URL. Run this once to make subsequent check_links calls instant. Supports sitemap index files (fetches all child sitemaps).',
|
|
1827
|
+
inputSchema: {
|
|
1828
|
+
type: 'object',
|
|
1829
|
+
properties: {
|
|
1830
|
+
force_refresh: { type: 'boolean', description: 'Re-check even URLs already in cache. Default: false (skips fresh entries).' }
|
|
1815
1831
|
}
|
|
1816
1832
|
}
|
|
1817
1833
|
},
|
|
@@ -3017,13 +3033,19 @@ async function handleToolCall(name, args) {
|
|
|
3017
3033
|
|
|
3018
3034
|
case 'check_links': {
|
|
3019
3035
|
const params = new URLSearchParams();
|
|
3020
|
-
if (args.page_id)
|
|
3036
|
+
if (args.page_id) params.set('page_id', args.page_id);
|
|
3037
|
+
if (args.force_refresh) params.set('force_refresh', '1');
|
|
3021
3038
|
const qs = params.toString() ? `?${params.toString()}` : '';
|
|
3022
3039
|
const r = await apiCall(`/check-links${qs}`);
|
|
3023
3040
|
if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
|
|
3024
3041
|
|
|
3042
|
+
const cacheNote = r.from_cache > 0
|
|
3043
|
+
? `${r.from_cache} from cache (${r.cache_ttl_hours}h TTL), ${r.freshly_fetched} freshly fetched`
|
|
3044
|
+
: `${r.freshly_fetched} freshly fetched (cache empty)`;
|
|
3045
|
+
|
|
3025
3046
|
let msg = `=== BROKEN LINK CHECK ===\n`;
|
|
3026
|
-
msg += `
|
|
3047
|
+
msg += `Pages scanned: ${r.pages_scanned} | URLs checked: ${r.urls_checked} | Broken: ${r.broken_count}\n`;
|
|
3048
|
+
msg += `Cache: ${cacheNote}\n`;
|
|
3027
3049
|
|
|
3028
3050
|
if (r.broken_count === 0) {
|
|
3029
3051
|
msg += '\nAll links are working!';
|
|
@@ -3040,6 +3062,35 @@ async function handleToolCall(name, args) {
|
|
|
3040
3062
|
return ok(msg);
|
|
3041
3063
|
}
|
|
3042
3064
|
|
|
3065
|
+
case 'clear_link_cache': {
|
|
3066
|
+
const r = await apiCall('/link-cache', 'DELETE');
|
|
3067
|
+
if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
|
|
3068
|
+
return ok(r.message);
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
case 'warm_link_cache': {
|
|
3072
|
+
const body = {};
|
|
3073
|
+
if (args.force_refresh) body.force_refresh = true;
|
|
3074
|
+
const r = await apiCall('/warm-link-cache', 'POST', body);
|
|
3075
|
+
if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
|
|
3076
|
+
if (!r.success) return ok(`Could not warm cache: ${r.message}`);
|
|
3077
|
+
|
|
3078
|
+
let msg = `=== LINK CACHE WARMED ===\n`;
|
|
3079
|
+
msg += `Sitemap: ${r.sitemap_url}\n`;
|
|
3080
|
+
msg += `URLs in sitemap: ${r.urls_in_sitemap}\n`;
|
|
3081
|
+
msg += `Freshly checked: ${r.warmed}\n`;
|
|
3082
|
+
msg += `Skipped (already cached): ${r.skipped_cached}\n`;
|
|
3083
|
+
msg += `Cache TTL: ${r.cache_ttl_hours}h\n`;
|
|
3084
|
+
if (r.broken_found > 0) {
|
|
3085
|
+
msg += `\n⚠️ ${r.broken_found} broken/unreachable URLs found:\n`;
|
|
3086
|
+
r.broken_urls.forEach(u => { msg += ` ${u}\n`; });
|
|
3087
|
+
} else {
|
|
3088
|
+
msg += `\nAll URLs returned 2xx/3xx — no broken links detected.`;
|
|
3089
|
+
}
|
|
3090
|
+
msg += `\nNext check_links call will use this cache and return instantly.`;
|
|
3091
|
+
return ok(msg);
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3043
3094
|
// ── Posts CRUD ──
|
|
3044
3095
|
|
|
3045
3096
|
case 'list_posts': {
|
package/package.json
CHANGED