@bulkpublishing/mcp-server 1.0.5 → 1.1.1
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/dist/ai/engine.d.ts +14 -0
- package/dist/ai/engine.d.ts.map +1 -1
- package/dist/ai/engine.js +98 -10
- package/dist/ai/engine.js.map +1 -1
- package/dist/index.js +52 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/generation.d.ts +2 -2
- package/dist/tools/generation.d.ts.map +1 -1
- package/dist/tools/generation.js +190 -14
- package/dist/tools/generation.js.map +1 -1
- package/dist/tools/indexing.d.ts +4 -1
- package/dist/tools/indexing.d.ts.map +1 -1
- package/dist/tools/indexing.js +4 -31
- package/dist/tools/indexing.js.map +1 -1
- package/dist/tools/linking.d.ts +38 -0
- package/dist/tools/linking.d.ts.map +1 -0
- package/dist/tools/linking.js +427 -0
- package/dist/tools/linking.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BPAI MCP Server — Linking Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tool handlers for:
|
|
5
|
+
* - fetch_sitemap: Fetch and parse XML sitemaps to discover linkable URLs
|
|
6
|
+
* - update_linking_settings: Configure internal/cross-linking for a project
|
|
7
|
+
*
|
|
8
|
+
* These tools close the gap where MCP users previously could not populate
|
|
9
|
+
* sitemapUrls or configure linking settings without the web dashboard.
|
|
10
|
+
*
|
|
11
|
+
* Settings are persisted to the database via the mcp-update-settings edge
|
|
12
|
+
* function, so changes survive server restarts and are visible in the web UI.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { getUserContext, getProjectSettings } from '../auth/context.js';
|
|
16
|
+
// ============================================
|
|
17
|
+
// CONSTANTS
|
|
18
|
+
// ============================================
|
|
19
|
+
const SETTINGS_ENDPOINT = process.env.BPAI_SETTINGS_URL || 'https://bulkpublishing.ai/api/mcp-update-settings';
|
|
20
|
+
// ============================================
|
|
21
|
+
// SITEMAP FETCHER (server-side, no CORS needed)
|
|
22
|
+
// ============================================
|
|
23
|
+
/**
|
|
24
|
+
* Recursively fetch all URLs from a sitemap, including nested sitemap indexes.
|
|
25
|
+
* Mirrors the logic in netlify/edge-functions/fetch-sitemap.ts but runs
|
|
26
|
+
* directly in the MCP server process (Node.js) so no edge function call needed.
|
|
27
|
+
*/
|
|
28
|
+
export async function fetchAllSitemapUrls(sitemapUrl, visited = new Set()) {
|
|
29
|
+
if (visited.has(sitemapUrl))
|
|
30
|
+
return [];
|
|
31
|
+
visited.add(sitemapUrl);
|
|
32
|
+
// Cap recursion at 10 layers
|
|
33
|
+
if (visited.size > 10)
|
|
34
|
+
return [];
|
|
35
|
+
try {
|
|
36
|
+
const response = await fetch(sitemapUrl, {
|
|
37
|
+
headers: {
|
|
38
|
+
'User-Agent': 'BulkPublishing-MCP/1.0 (+https://bulkpublishing.ai)',
|
|
39
|
+
'Accept': 'application/xml, text/xml, */*',
|
|
40
|
+
},
|
|
41
|
+
signal: AbortSignal.timeout(15000), // 15s timeout per request
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
console.error(`[Sitemap] Failed to fetch ${sitemapUrl}: ${response.status}`);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
const xml = await response.text();
|
|
48
|
+
// Check if this is a sitemap index (contains <sitemap> tags)
|
|
49
|
+
const isSitemapIndex = xml.includes('<sitemap>') || xml.includes('<sitemapindex');
|
|
50
|
+
if (isSitemapIndex) {
|
|
51
|
+
const nestedSitemapUrls = extractLocUrls(xml).filter(url => url.endsWith('.xml') || url.includes('sitemap'));
|
|
52
|
+
const allUrls = [];
|
|
53
|
+
for (const nestedUrl of nestedSitemapUrls.slice(0, 10)) {
|
|
54
|
+
const nestedUrls = await fetchAllSitemapUrls(nestedUrl, visited);
|
|
55
|
+
allUrls.push(...nestedUrls);
|
|
56
|
+
}
|
|
57
|
+
return allUrls;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// Regular sitemap: extract page URLs, exclude .xml files
|
|
61
|
+
return extractLocUrls(xml).filter(url => !url.endsWith('.xml'));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error(`[Sitemap] Error fetching ${sitemapUrl}:`, error.message);
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Extract all <loc> URLs from XML content.
|
|
71
|
+
*/
|
|
72
|
+
function extractLocUrls(xml) {
|
|
73
|
+
const urls = [];
|
|
74
|
+
const locRegex = /<loc>\s*([^<]+)\s*<\/loc>/gi;
|
|
75
|
+
let match;
|
|
76
|
+
while ((match = locRegex.exec(xml)) !== null) {
|
|
77
|
+
const url = match[1].trim();
|
|
78
|
+
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
79
|
+
urls.push(url);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return urls;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Filter URLs to exclude common non-content pages.
|
|
86
|
+
*/
|
|
87
|
+
function filterContentUrls(urls) {
|
|
88
|
+
const excludePatterns = [
|
|
89
|
+
'/wp-admin/', '/wp-login', '/wp-content/',
|
|
90
|
+
'/login/', '/logout/', '/register/', '/signup/',
|
|
91
|
+
'/cart/', '/checkout/', '/account/', '/my-account/',
|
|
92
|
+
'/tag/', '/author/', '/category/', '/page/',
|
|
93
|
+
'/feed/', '/rss/', '/xmlrpc', '/wp-json/',
|
|
94
|
+
'/cdn-cgi/', '/.well-known/',
|
|
95
|
+
];
|
|
96
|
+
const excludeExtensions = [
|
|
97
|
+
'.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg',
|
|
98
|
+
'.pdf', '.zip', '.css', '.js', '.woff', '.woff2',
|
|
99
|
+
];
|
|
100
|
+
return urls.filter(url => {
|
|
101
|
+
const lower = url.toLowerCase();
|
|
102
|
+
if (excludePatterns.some(p => lower.includes(p)))
|
|
103
|
+
return false;
|
|
104
|
+
if (excludeExtensions.some(ext => lower.endsWith(ext)))
|
|
105
|
+
return false;
|
|
106
|
+
return true;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// ============================================
|
|
110
|
+
// PERMALINK PATTERN DETECTION
|
|
111
|
+
// ============================================
|
|
112
|
+
/**
|
|
113
|
+
* Analyze a pool of sitemap URLs to detect the most common permalink pattern.
|
|
114
|
+
* Returns the detected base path prefix used for content pages.
|
|
115
|
+
*
|
|
116
|
+
* Examples:
|
|
117
|
+
* URLs like /blog/my-post, /blog/another → detects "/blog"
|
|
118
|
+
* URLs like /2026/01/my-post → detects "/" (date-based, uses root)
|
|
119
|
+
* URLs like /resources/guides/my-post → detects "/resources/guides"
|
|
120
|
+
* URLs like /my-post, /another-post → detects "/" (flat/root structure)
|
|
121
|
+
*/
|
|
122
|
+
export function detectPermalinkPattern(urls) {
|
|
123
|
+
if (!urls || urls.length === 0) {
|
|
124
|
+
return { basePath: '/', pattern: 'flat', confidence: 0, example: '' };
|
|
125
|
+
}
|
|
126
|
+
// Parse all URLs into their path components
|
|
127
|
+
const pathInfos = [];
|
|
128
|
+
for (const url of urls) {
|
|
129
|
+
try {
|
|
130
|
+
const parsed = new URL(url);
|
|
131
|
+
const parts = parsed.pathname.split('/').filter(Boolean);
|
|
132
|
+
pathInfos.push({ full: parsed.pathname, parts, depth: parts.length });
|
|
133
|
+
}
|
|
134
|
+
catch { /* skip invalid URLs */ }
|
|
135
|
+
}
|
|
136
|
+
if (pathInfos.length === 0) {
|
|
137
|
+
return { basePath: '/', pattern: 'flat', confidence: 0, example: '' };
|
|
138
|
+
}
|
|
139
|
+
// Check for date-based patterns (e.g., /2026/01/slug)
|
|
140
|
+
const datePattern = /^\d{4}$/;
|
|
141
|
+
const dateBasedCount = pathInfos.filter(p => p.parts.length >= 3 && datePattern.test(p.parts[0])).length;
|
|
142
|
+
if (dateBasedCount > pathInfos.length * 0.5) {
|
|
143
|
+
return {
|
|
144
|
+
basePath: '/',
|
|
145
|
+
pattern: 'date-based',
|
|
146
|
+
confidence: Math.round((dateBasedCount / pathInfos.length) * 100),
|
|
147
|
+
example: pathInfos.find(p => p.parts.length >= 3 && datePattern.test(p.parts[0]))?.full || '',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
// Count first-level directory frequency
|
|
151
|
+
const dirCounts = new Map();
|
|
152
|
+
for (const p of pathInfos) {
|
|
153
|
+
if (p.parts.length >= 2) {
|
|
154
|
+
const dir = `/${p.parts[0]}`;
|
|
155
|
+
dirCounts.set(dir, (dirCounts.get(dir) || 0) + 1);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Find the most common subdirectory
|
|
159
|
+
let topDir = '';
|
|
160
|
+
let topCount = 0;
|
|
161
|
+
for (const [dir, count] of dirCounts) {
|
|
162
|
+
if (count > topCount) {
|
|
163
|
+
topDir = dir;
|
|
164
|
+
topCount = count;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// Check for nested subdirectories (e.g., /resources/guides/slug)
|
|
168
|
+
if (topDir && topCount > pathInfos.length * 0.3) {
|
|
169
|
+
// Check if there's a consistent second level under this dir
|
|
170
|
+
const nestedCounts = new Map();
|
|
171
|
+
for (const p of pathInfos) {
|
|
172
|
+
if (p.parts.length >= 3 && `/${p.parts[0]}` === topDir) {
|
|
173
|
+
const nestedDir = `/${p.parts[0]}/${p.parts[1]}`;
|
|
174
|
+
nestedCounts.set(nestedDir, (nestedCounts.get(nestedDir) || 0) + 1);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
let topNested = '';
|
|
178
|
+
let topNestedCount = 0;
|
|
179
|
+
for (const [dir, count] of nestedCounts) {
|
|
180
|
+
if (count > topNestedCount) {
|
|
181
|
+
topNested = dir;
|
|
182
|
+
topNestedCount = count;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// If a nested path holds >50% of the top dir's content, use it
|
|
186
|
+
if (topNested && topNestedCount > topCount * 0.5) {
|
|
187
|
+
return {
|
|
188
|
+
basePath: topNested,
|
|
189
|
+
pattern: 'nested',
|
|
190
|
+
confidence: Math.round((topNestedCount / pathInfos.length) * 100),
|
|
191
|
+
example: pathInfos.find(p => p.full.startsWith(topNested + '/'))?.full || '',
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
// Otherwise use the single subdirectory
|
|
195
|
+
return {
|
|
196
|
+
basePath: topDir,
|
|
197
|
+
pattern: 'subdirectory',
|
|
198
|
+
confidence: Math.round((topCount / pathInfos.length) * 100),
|
|
199
|
+
example: pathInfos.find(p => p.parts.length >= 2 && `/${p.parts[0]}` === topDir)?.full || '',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
// Flat structure (most URLs are root-level, like /my-post)
|
|
203
|
+
const rootCount = pathInfos.filter(p => p.parts.length === 1).length;
|
|
204
|
+
return {
|
|
205
|
+
basePath: '/',
|
|
206
|
+
pattern: 'flat',
|
|
207
|
+
confidence: Math.round((rootCount / pathInfos.length) * 100),
|
|
208
|
+
example: pathInfos.find(p => p.parts.length === 1)?.full || pathInfos[0]?.full || '',
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
// ============================================
|
|
212
|
+
// DATABASE PERSISTENCE
|
|
213
|
+
// ============================================
|
|
214
|
+
/**
|
|
215
|
+
* Persist project settings back to the database via the edge function.
|
|
216
|
+
* Uses the same BPAI_API_KEY that the MCP server authenticated with.
|
|
217
|
+
*/
|
|
218
|
+
async function persistProjectSettings(projectId, updates) {
|
|
219
|
+
const apiKey = process.env.BPAI_API_KEY;
|
|
220
|
+
if (!apiKey) {
|
|
221
|
+
return { success: false, error: 'No API key available for persistence' };
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const response = await fetch(SETTINGS_ENDPOINT, {
|
|
225
|
+
method: 'POST',
|
|
226
|
+
headers: {
|
|
227
|
+
'Content-Type': 'application/json',
|
|
228
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
229
|
+
},
|
|
230
|
+
body: JSON.stringify({
|
|
231
|
+
project_id: projectId,
|
|
232
|
+
...updates,
|
|
233
|
+
}),
|
|
234
|
+
signal: AbortSignal.timeout(10000),
|
|
235
|
+
});
|
|
236
|
+
if (!response.ok) {
|
|
237
|
+
const body = await response.json().catch(() => ({}));
|
|
238
|
+
return { success: false, error: body.error || `HTTP ${response.status}` };
|
|
239
|
+
}
|
|
240
|
+
return { success: true };
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
console.error('[Linking] Persistence failed:', err.message);
|
|
244
|
+
return { success: false, error: err.message };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// ============================================
|
|
248
|
+
// REGISTER TOOLS
|
|
249
|
+
// ============================================
|
|
250
|
+
export function registerLinkingTools(server) {
|
|
251
|
+
// ============================================
|
|
252
|
+
// fetch_sitemap
|
|
253
|
+
// ============================================
|
|
254
|
+
server.tool('fetch_sitemap', 'Fetch and parse an XML sitemap to discover all linkable URLs on a site. Supports sitemap indexes (recursively resolves nested sitemaps). Returns the URL list and optionally saves it to the project\'s internal linking settings for use in article generation. When save_to_project is true, settings are persisted to the database and visible in the web dashboard.', {
|
|
255
|
+
sitemap_url: z.string().describe('Full URL to the XML sitemap (e.g., https://example.com/sitemap.xml)'),
|
|
256
|
+
save_to_project: z.boolean().optional().default(false).describe('If true, saves the discovered URLs to the active project\'s internal linking settings (persisted to database)'),
|
|
257
|
+
project_id: z.string().optional().describe('Project ID to save URLs to (defaults to active project)'),
|
|
258
|
+
filter_content: z.boolean().optional().default(true).describe('Filter out non-content pages (admin, login, media files, etc.)'),
|
|
259
|
+
}, async (args) => {
|
|
260
|
+
const ctx = getUserContext();
|
|
261
|
+
if (!ctx.authenticated) {
|
|
262
|
+
return { content: [{ type: 'text', text: JSON.stringify({ error: 'Not authenticated. Check your BPAI_API_KEY.' }, null, 2) }] };
|
|
263
|
+
}
|
|
264
|
+
// Validate URL
|
|
265
|
+
try {
|
|
266
|
+
const parsed = new URL(args.sitemap_url);
|
|
267
|
+
if (!['http:', 'https:'].includes(parsed.protocol)) {
|
|
268
|
+
throw new Error('Invalid protocol');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch {
|
|
272
|
+
return {
|
|
273
|
+
content: [{
|
|
274
|
+
type: 'text', text: JSON.stringify({
|
|
275
|
+
error: 'Invalid sitemap URL. Must be a full HTTP/HTTPS URL (e.g., https://example.com/sitemap.xml)',
|
|
276
|
+
}, null, 2)
|
|
277
|
+
}],
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
// Fetch sitemap
|
|
281
|
+
const rawUrls = await fetchAllSitemapUrls(args.sitemap_url);
|
|
282
|
+
const uniqueUrls = [...new Set(rawUrls)];
|
|
283
|
+
const finalUrls = args.filter_content ? filterContentUrls(uniqueUrls) : uniqueUrls;
|
|
284
|
+
// Detect permalink pattern for smart cross-linking
|
|
285
|
+
const permalinkPattern = detectPermalinkPattern(finalUrls);
|
|
286
|
+
// Save to project if requested
|
|
287
|
+
let savedToProject = false;
|
|
288
|
+
let persistedToDb = false;
|
|
289
|
+
if (args.save_to_project) {
|
|
290
|
+
const project = getProjectSettings(args.project_id);
|
|
291
|
+
if (project) {
|
|
292
|
+
// Update in-memory context
|
|
293
|
+
if (!project.settings) {
|
|
294
|
+
project.settings = {};
|
|
295
|
+
}
|
|
296
|
+
const newInternalLinking = {
|
|
297
|
+
...(project.settings.internal_linking || {}),
|
|
298
|
+
enabled: true,
|
|
299
|
+
sitemapUrls: finalUrls,
|
|
300
|
+
sourceUrl: args.sitemap_url,
|
|
301
|
+
maxLinksPerPost: project.settings.internal_linking?.maxLinksPerPost || 5,
|
|
302
|
+
};
|
|
303
|
+
project.settings.internal_linking = newInternalLinking;
|
|
304
|
+
savedToProject = true;
|
|
305
|
+
// Auto-detect and set cross-linking base URL if not already configured
|
|
306
|
+
if (!project.settings.cross_linking?.baseUrl && permalinkPattern.basePath) {
|
|
307
|
+
try {
|
|
308
|
+
const origin = new URL(finalUrls[0]).origin;
|
|
309
|
+
const basePath = permalinkPattern.basePath === '/'
|
|
310
|
+
? ''
|
|
311
|
+
: permalinkPattern.basePath;
|
|
312
|
+
const newCrossLinking = {
|
|
313
|
+
...(project.settings.cross_linking || {}),
|
|
314
|
+
enabled: project.settings.cross_linking?.enabled ?? false,
|
|
315
|
+
baseUrl: `${origin}${basePath}`,
|
|
316
|
+
maxLinksPerPost: project.settings.cross_linking?.maxLinksPerPost || 3,
|
|
317
|
+
};
|
|
318
|
+
project.settings.cross_linking = newCrossLinking;
|
|
319
|
+
}
|
|
320
|
+
catch { /* ignore URL parse errors */ }
|
|
321
|
+
}
|
|
322
|
+
// Persist to database
|
|
323
|
+
const result = await persistProjectSettings(project.id, {
|
|
324
|
+
internal_linking: project.settings.internal_linking,
|
|
325
|
+
cross_linking: project.settings.cross_linking,
|
|
326
|
+
});
|
|
327
|
+
persistedToDb = result.success;
|
|
328
|
+
if (!result.success) {
|
|
329
|
+
console.error(`[Linking] DB persistence failed: ${result.error}`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
content: [{
|
|
335
|
+
type: 'text', text: JSON.stringify({
|
|
336
|
+
status: 'success',
|
|
337
|
+
sitemap_url: args.sitemap_url,
|
|
338
|
+
total_discovered: rawUrls.length,
|
|
339
|
+
unique_urls: uniqueUrls.length,
|
|
340
|
+
after_filtering: finalUrls.length,
|
|
341
|
+
permalink_pattern: permalinkPattern,
|
|
342
|
+
saved_to_project: savedToProject,
|
|
343
|
+
persisted_to_database: persistedToDb,
|
|
344
|
+
sample_urls: finalUrls.slice(0, 20),
|
|
345
|
+
note: finalUrls.length > 20 ? `Showing first 20 of ${finalUrls.length} URLs. All ${finalUrls.length} URLs are stored for link injection.` : undefined,
|
|
346
|
+
}, null, 2)
|
|
347
|
+
}],
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
// ============================================
|
|
351
|
+
// update_linking_settings
|
|
352
|
+
// ============================================
|
|
353
|
+
server.tool('update_linking_settings', 'Configure internal linking and cross-linking settings for a project. Changes are persisted to the database and visible in the web dashboard. Enables MCP users to set up linking without needing the web dashboard.', {
|
|
354
|
+
project_id: z.string().optional().describe('Project ID (defaults to active project)'),
|
|
355
|
+
internal_linking_enabled: z.boolean().optional().describe('Enable/disable internal linking'),
|
|
356
|
+
max_internal_links: z.number().optional().describe('Max internal links per article (1-10)'),
|
|
357
|
+
included_paths: z.array(z.string()).optional().describe('Subdirectory paths to include (e.g., ["/blog/", "/resources/"]). Empty = include all.'),
|
|
358
|
+
cross_linking_enabled: z.boolean().optional().describe('Enable/disable cross-linking between batch articles'),
|
|
359
|
+
cross_linking_base_url: z.string().optional().describe('Base URL for cross-linking slug assembly (e.g., https://example.com/blog)'),
|
|
360
|
+
max_cross_links: z.number().optional().describe('Max cross-links per article (1-10)'),
|
|
361
|
+
}, async (args) => {
|
|
362
|
+
const ctx = getUserContext();
|
|
363
|
+
if (!ctx.authenticated) {
|
|
364
|
+
return { content: [{ type: 'text', text: JSON.stringify({ error: 'Not authenticated.' }, null, 2) }] };
|
|
365
|
+
}
|
|
366
|
+
const project = getProjectSettings(args.project_id);
|
|
367
|
+
if (!project) {
|
|
368
|
+
return {
|
|
369
|
+
content: [{
|
|
370
|
+
type: 'text', text: JSON.stringify({
|
|
371
|
+
error: 'Project not found.',
|
|
372
|
+
available: ctx.projects.map(p => ({ id: p.id, name: p.name })),
|
|
373
|
+
}, null, 2)
|
|
374
|
+
}],
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
if (!project.settings) {
|
|
378
|
+
project.settings = {};
|
|
379
|
+
}
|
|
380
|
+
// Update internal linking settings (in-memory)
|
|
381
|
+
if (args.internal_linking_enabled !== undefined || args.max_internal_links || args.included_paths) {
|
|
382
|
+
const existing = project.settings.internal_linking || {
|
|
383
|
+
enabled: false,
|
|
384
|
+
sitemapUrls: [],
|
|
385
|
+
maxLinksPerPost: 5,
|
|
386
|
+
};
|
|
387
|
+
project.settings.internal_linking = {
|
|
388
|
+
...existing,
|
|
389
|
+
enabled: args.internal_linking_enabled ?? existing.enabled,
|
|
390
|
+
maxLinksPerPost: args.max_internal_links ?? existing.maxLinksPerPost,
|
|
391
|
+
includedPaths: args.included_paths ?? existing.includedPaths,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
// Update cross-linking settings (in-memory)
|
|
395
|
+
if (args.cross_linking_enabled !== undefined || args.cross_linking_base_url || args.max_cross_links) {
|
|
396
|
+
const existing = project.settings.cross_linking || {
|
|
397
|
+
enabled: false,
|
|
398
|
+
baseUrl: '',
|
|
399
|
+
maxLinksPerPost: 3,
|
|
400
|
+
};
|
|
401
|
+
project.settings.cross_linking = {
|
|
402
|
+
...existing,
|
|
403
|
+
enabled: args.cross_linking_enabled ?? existing.enabled,
|
|
404
|
+
baseUrl: args.cross_linking_base_url ?? existing.baseUrl,
|
|
405
|
+
maxLinksPerPost: args.max_cross_links ?? existing.maxLinksPerPost,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
// Persist to database
|
|
409
|
+
const persistResult = await persistProjectSettings(project.id, {
|
|
410
|
+
internal_linking: project.settings.internal_linking,
|
|
411
|
+
cross_linking: project.settings.cross_linking,
|
|
412
|
+
});
|
|
413
|
+
return {
|
|
414
|
+
content: [{
|
|
415
|
+
type: 'text', text: JSON.stringify({
|
|
416
|
+
status: 'updated',
|
|
417
|
+
persisted_to_database: persistResult.success,
|
|
418
|
+
persistence_error: persistResult.error || undefined,
|
|
419
|
+
project: { id: project.id, name: project.name },
|
|
420
|
+
internal_linking: project.settings.internal_linking || { enabled: false },
|
|
421
|
+
cross_linking: project.settings.cross_linking || { enabled: false },
|
|
422
|
+
}, null, 2)
|
|
423
|
+
}],
|
|
424
|
+
};
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
//# sourceMappingURL=linking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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EAAE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;wBACzE,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,aAAa,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;qBACtE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACd,CAAC;SACL,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bulkpublishing/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Bulk Publishing AI MCP Server - Content generation, WordPress publishing, and SEO indexing tools for MCP-compatible clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|