@reaudit/mcp-server 1.0.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.
Files changed (119) hide show
  1. package/LICENSE +33 -0
  2. package/README.md +399 -0
  3. package/dist/auth/oauth-client.d.ts +43 -0
  4. package/dist/auth/oauth-client.d.ts.map +1 -0
  5. package/dist/auth/oauth-client.js +340 -0
  6. package/dist/auth/oauth-client.js.map +1 -0
  7. package/dist/auth/token-store.d.ts +41 -0
  8. package/dist/auth/token-store.d.ts.map +1 -0
  9. package/dist/auth/token-store.js +176 -0
  10. package/dist/auth/token-store.js.map +1 -0
  11. package/dist/index.d.ts +11 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +480 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/lib/api-client.d.ts +970 -0
  16. package/dist/lib/api-client.d.ts.map +1 -0
  17. package/dist/lib/api-client.js +441 -0
  18. package/dist/lib/api-client.js.map +1 -0
  19. package/dist/lib/confirmation.d.ts +92 -0
  20. package/dist/lib/confirmation.d.ts.map +1 -0
  21. package/dist/lib/confirmation.js +224 -0
  22. package/dist/lib/confirmation.js.map +1 -0
  23. package/dist/lib/error-handler.d.ts +57 -0
  24. package/dist/lib/error-handler.d.ts.map +1 -0
  25. package/dist/lib/error-handler.js +235 -0
  26. package/dist/lib/error-handler.js.map +1 -0
  27. package/dist/lib/offline-mode.d.ts +107 -0
  28. package/dist/lib/offline-mode.d.ts.map +1 -0
  29. package/dist/lib/offline-mode.js +356 -0
  30. package/dist/lib/offline-mode.js.map +1 -0
  31. package/dist/lib/progress-tracker.d.ts +87 -0
  32. package/dist/lib/progress-tracker.d.ts.map +1 -0
  33. package/dist/lib/progress-tracker.js +238 -0
  34. package/dist/lib/progress-tracker.js.map +1 -0
  35. package/dist/prompts/index.d.ts +24 -0
  36. package/dist/prompts/index.d.ts.map +1 -0
  37. package/dist/prompts/index.js +305 -0
  38. package/dist/prompts/index.js.map +1 -0
  39. package/dist/resources/index.d.ts +44 -0
  40. package/dist/resources/index.d.ts.map +1 -0
  41. package/dist/resources/index.js +125 -0
  42. package/dist/resources/index.js.map +1 -0
  43. package/dist/tools/account.d.ts +25 -0
  44. package/dist/tools/account.d.ts.map +1 -0
  45. package/dist/tools/account.js +69 -0
  46. package/dist/tools/account.js.map +1 -0
  47. package/dist/tools/action-grids.d.ts +414 -0
  48. package/dist/tools/action-grids.d.ts.map +1 -0
  49. package/dist/tools/action-grids.js +271 -0
  50. package/dist/tools/action-grids.js.map +1 -0
  51. package/dist/tools/analytics-query.d.ts +126 -0
  52. package/dist/tools/analytics-query.d.ts.map +1 -0
  53. package/dist/tools/analytics-query.js +106 -0
  54. package/dist/tools/analytics-query.js.map +1 -0
  55. package/dist/tools/analytics.d.ts +57 -0
  56. package/dist/tools/analytics.d.ts.map +1 -0
  57. package/dist/tools/analytics.js +122 -0
  58. package/dist/tools/analytics.js.map +1 -0
  59. package/dist/tools/audits.d.ts +123 -0
  60. package/dist/tools/audits.d.ts.map +1 -0
  61. package/dist/tools/audits.js +226 -0
  62. package/dist/tools/audits.js.map +1 -0
  63. package/dist/tools/calendar.d.ts +57 -0
  64. package/dist/tools/calendar.d.ts.map +1 -0
  65. package/dist/tools/calendar.js +109 -0
  66. package/dist/tools/calendar.js.map +1 -0
  67. package/dist/tools/content-generation.d.ts +211 -0
  68. package/dist/tools/content-generation.d.ts.map +1 -0
  69. package/dist/tools/content-generation.js +363 -0
  70. package/dist/tools/content-generation.js.map +1 -0
  71. package/dist/tools/content.d.ts +92 -0
  72. package/dist/tools/content.d.ts.map +1 -0
  73. package/dist/tools/content.js +130 -0
  74. package/dist/tools/content.js.map +1 -0
  75. package/dist/tools/indexing.d.ts +132 -0
  76. package/dist/tools/indexing.d.ts.map +1 -0
  77. package/dist/tools/indexing.js +190 -0
  78. package/dist/tools/indexing.js.map +1 -0
  79. package/dist/tools/optimization.d.ts +70 -0
  80. package/dist/tools/optimization.d.ts.map +1 -0
  81. package/dist/tools/optimization.js +106 -0
  82. package/dist/tools/optimization.js.map +1 -0
  83. package/dist/tools/projects.d.ts +67 -0
  84. package/dist/tools/projects.d.ts.map +1 -0
  85. package/dist/tools/projects.js +113 -0
  86. package/dist/tools/projects.js.map +1 -0
  87. package/dist/tools/prompts.d.ts +306 -0
  88. package/dist/tools/prompts.d.ts.map +1 -0
  89. package/dist/tools/prompts.js +378 -0
  90. package/dist/tools/prompts.js.map +1 -0
  91. package/dist/tools/publishing.d.ts +135 -0
  92. package/dist/tools/publishing.d.ts.map +1 -0
  93. package/dist/tools/publishing.js +209 -0
  94. package/dist/tools/publishing.js.map +1 -0
  95. package/dist/tools/reports.d.ts +252 -0
  96. package/dist/tools/reports.d.ts.map +1 -0
  97. package/dist/tools/reports.js +183 -0
  98. package/dist/tools/reports.js.map +1 -0
  99. package/dist/tools/social.d.ts +224 -0
  100. package/dist/tools/social.d.ts.map +1 -0
  101. package/dist/tools/social.js +291 -0
  102. package/dist/tools/social.js.map +1 -0
  103. package/dist/tools/sources.d.ts +221 -0
  104. package/dist/tools/sources.d.ts.map +1 -0
  105. package/dist/tools/sources.js +308 -0
  106. package/dist/tools/sources.js.map +1 -0
  107. package/dist/tools/strategy.d.ts +345 -0
  108. package/dist/tools/strategy.d.ts.map +1 -0
  109. package/dist/tools/strategy.js +392 -0
  110. package/dist/tools/strategy.js.map +1 -0
  111. package/dist/tools/usage.d.ts +101 -0
  112. package/dist/tools/usage.d.ts.map +1 -0
  113. package/dist/tools/usage.js +184 -0
  114. package/dist/tools/usage.js.map +1 -0
  115. package/dist/tools/visibility.d.ts +95 -0
  116. package/dist/tools/visibility.d.ts.map +1 -0
  117. package/dist/tools/visibility.js +163 -0
  118. package/dist/tools/visibility.js.map +1 -0
  119. package/package.json +54 -0
@@ -0,0 +1,363 @@
1
+ "use strict";
2
+ /**
3
+ * Content Generation Tools
4
+ *
5
+ * MCP tools for AI content generation.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.contentGenerationTools = exports.getContentDetailsSchema = exports.getContentHistorySchema = exports.generateContentSchema = void 0;
9
+ exports.generateContent = generateContent;
10
+ exports.getContentHistory = getContentHistory;
11
+ exports.getContentDetails = getContentDetails;
12
+ const zod_1 = require("zod");
13
+ // Tool schemas
14
+ exports.generateContentSchema = zod_1.z.object({
15
+ keyword: zod_1.z.string().describe('The main keyword or keyphrase for the content'),
16
+ topic: zod_1.z.string().describe('The topic or title for the content'),
17
+ contentType: zod_1.z.string().optional().describe('Type of content: blog, faq, comparison, tutorial, case-study, linkedin-post, twitter-post, newsletter, youtube-script, etc.'),
18
+ contentLength: zod_1.z.enum(['short', 'medium', 'long', 'comprehensive']).optional().describe('Content length: short (~650 words), medium (~1000 words), long (~1500 words), comprehensive (~2100 words)'),
19
+ tone: zod_1.z.string().optional().describe('Tone of voice: professional, casual, analytical, educational, engaging, instructive, clear'),
20
+ customTone: zod_1.z.string().optional().describe('Custom tone description if standard tones are not suitable'),
21
+ useProjectTone: zod_1.z.boolean().optional().describe('Use the project\'s configured tone of voice (requires projectId)'),
22
+ additionalContext: zod_1.z.string().optional().describe('Additional context or instructions for the content'),
23
+ projectId: zod_1.z.string().optional().describe('Project ID to use project settings, knowledge base, and internal links'),
24
+ language: zod_1.z.string().optional().describe('Output language code (e.g., en, es, fr, de)'),
25
+ useSemanticVariants: zod_1.z.boolean().optional().describe('Use semantic keyword variants for better SEO (default: true)'),
26
+ useWebSearch: zod_1.z.boolean().optional().describe('Use Perplexity AI web search for real-time research and citations (costs extra credits)'),
27
+ });
28
+ exports.getContentHistorySchema = zod_1.z.object({
29
+ projectId: zod_1.z.string().optional().describe('Filter by project ID'),
30
+ contentType: zod_1.z.string().optional().describe('Filter by content type'),
31
+ limit: zod_1.z.number().optional().describe('Maximum number of items to return (default: 50)'),
32
+ });
33
+ exports.getContentDetailsSchema = zod_1.z.object({
34
+ contentId: zod_1.z.string().describe('The ID of the content to retrieve'),
35
+ includeSchema: zod_1.z.boolean().optional().describe('Include full JSON-LD schema markup (default: false, saves tokens)'),
36
+ });
37
+ /**
38
+ * Generate content tool handler
39
+ */
40
+ async function generateContent(client, args) {
41
+ const result = await client.generateContent({
42
+ keyword: args.keyword,
43
+ topic: args.topic,
44
+ contentType: args.contentType,
45
+ contentLength: args.contentLength,
46
+ tone: args.tone,
47
+ customTone: args.customTone,
48
+ useProjectTone: args.useProjectTone,
49
+ additionalContext: args.additionalContext,
50
+ projectId: args.projectId,
51
+ language: args.language,
52
+ useSemanticVariants: args.useSemanticVariants,
53
+ useWebSearch: args.useWebSearch,
54
+ });
55
+ const content = result.content;
56
+ let response = `## Content Generated Successfully!\n\n`;
57
+ response += `### ${content.title}\n\n`;
58
+ response += `- **ID:** ${content.id}\n`;
59
+ response += `- **Type:** ${content.contentType}\n`;
60
+ response += `- **Keyword:** ${content.keyword}\n`;
61
+ response += `- **Word Count:** ${content.wordCount}\n`;
62
+ response += `- **Language:** ${content.language || 'en'}\n`;
63
+ if (content.seoScore || content.readabilityScore) {
64
+ response += `\n### SEO Metrics\n`;
65
+ if (content.seoScore)
66
+ response += `- **SEO Score:** ${content.seoScore}/100\n`;
67
+ if (content.readabilityScore)
68
+ response += `- **Readability Score:** ${content.readabilityScore}/100\n`;
69
+ if (content.keywordDensity)
70
+ response += `- **Keyword Density:** ${content.keywordDensity}%\n`;
71
+ }
72
+ response += `\n### Meta Information\n`;
73
+ response += `- **Meta Title:** ${content.metaTitle || content.title}\n`;
74
+ response += `- **Meta Description:** ${content.metaDescription}\n`;
75
+ response += `- **Excerpt:** ${content.excerpt}\n`;
76
+ if (content.headings) {
77
+ response += `\n### Content Structure\n`;
78
+ if (content.headings.h2?.length)
79
+ response += `- **H2 Headings:** ${content.headings.h2.join(', ')}\n`;
80
+ if (content.headings.h3?.length)
81
+ response += `- **H3 Headings:** ${content.headings.h3.join(', ')}\n`;
82
+ }
83
+ if (content.suggestedTags && content.suggestedTags.length > 0) {
84
+ response += `\n### Suggested Tags\n`;
85
+ response += content.suggestedTags.join(', ') + '\n';
86
+ }
87
+ if (content.faq && content.faq.length > 0) {
88
+ response += `\n### FAQ Section (${content.faq.length} questions)\n`;
89
+ for (const item of content.faq.slice(0, 3)) {
90
+ response += `- **Q:** ${item.question}\n`;
91
+ }
92
+ if (content.faq.length > 3) {
93
+ response += `- *...and ${content.faq.length - 3} more questions*\n`;
94
+ }
95
+ }
96
+ if (content.internalLinks && content.internalLinks.length > 0) {
97
+ response += `\n### Internal Links\n`;
98
+ response += `${content.internalLinks.length} internal links included in content:\n`;
99
+ for (const link of content.internalLinks) {
100
+ response += `- [${link.text}](${link.url})\n`;
101
+ }
102
+ }
103
+ else if (content.internalLinkSuggestionsUsed) {
104
+ response += `\n### Internal Links\n`;
105
+ response += `${content.internalLinkSuggestionsUsed} internal link suggestions were provided to the AI\n`;
106
+ }
107
+ if (content.hasSchemaMarkup) {
108
+ response += `\n### Schema Markup\n`;
109
+ response += `✅ JSON-LD schema markup generated (Article + FAQPage)\n`;
110
+ }
111
+ if (content.knowledgeBaseContext && content.knowledgeBaseContext.length > 0) {
112
+ response += `\n### Knowledge Base\n`;
113
+ response += `✅ Content enhanced using ${content.knowledgeBaseContext.length} sources from project knowledge base\n`;
114
+ }
115
+ if (content.semanticVariantsUsed) {
116
+ response += `\n### Semantic Variants\n`;
117
+ response += `✅ ${content.semanticVariantsUsed} semantic keyword variants used for better SEO\n`;
118
+ }
119
+ if (content.webSearchUsed) {
120
+ response += `\n### Real-Time Web Research\n`;
121
+ response += `✅ Perplexity AI research included (${content.webSearchUsed.citationsCount} citations)\n`;
122
+ }
123
+ response += `\n---\n`;
124
+ response += `Use \`get_content_details\` with ID \`${content.id}\` to retrieve the full content including HTML, schema markup, and markdown.`;
125
+ return response;
126
+ }
127
+ /**
128
+ * Get content history tool handler
129
+ */
130
+ async function getContentHistory(client, args) {
131
+ const result = await client.getContentHistory({
132
+ projectId: args.projectId,
133
+ contentType: args.contentType,
134
+ limit: args.limit,
135
+ });
136
+ if (result.history.length === 0) {
137
+ return 'No content generation history found. Use `generate_content` to create new content.';
138
+ }
139
+ let response = `## Content History (${result.pagination.total} total)\n\n`;
140
+ for (const content of result.history) {
141
+ response += `### ${content.title}\n`;
142
+ response += `- **ID:** ${content.id}\n`;
143
+ response += `- **Type:** ${content.contentType}\n`;
144
+ response += `- **Keyword:** ${content.keyword}\n`;
145
+ response += `- **Word Count:** ${content.wordCount}\n`;
146
+ response += `- **Generated:** ${new Date(content.generatedAt).toLocaleDateString()}\n`;
147
+ response += '\n';
148
+ }
149
+ if (result.pagination.hasMore) {
150
+ response += `\n*Showing ${result.history.length} of ${result.pagination.total} items. Use \`skip\` parameter to see more.*`;
151
+ }
152
+ return response;
153
+ }
154
+ /**
155
+ * Get content details tool handler
156
+ */
157
+ async function getContentDetails(client, args) {
158
+ const result = await client.getContentDetails(args.contentId);
159
+ const content = result.content;
160
+ const includeSchema = args.includeSchema ?? false;
161
+ let response = `## ${content.title}\n\n`;
162
+ response += `### Metadata\n`;
163
+ response += `- **ID:** ${content.id}\n`;
164
+ response += `- **Slug:** ${content.slug}\n`;
165
+ response += `- **Type:** ${content.contentType}\n`;
166
+ response += `- **Keyword:** ${content.keyword}\n`;
167
+ response += `- **Topic:** ${content.topic}\n`;
168
+ response += `- **Word Count:** ${content.wordCount}\n`;
169
+ response += `- **Language:** ${content.language}\n`;
170
+ response += `- **Provider:** ${content.provider}\n`;
171
+ response += `- **Generated:** ${new Date(content.generatedAt).toLocaleDateString()}\n\n`;
172
+ if (content.seoScore || content.readabilityScore) {
173
+ response += `### Scores\n`;
174
+ if (content.seoScore)
175
+ response += `- **SEO Score:** ${content.seoScore}/100\n`;
176
+ if (content.readabilityScore)
177
+ response += `- **Readability Score:** ${content.readabilityScore}/100\n`;
178
+ if (content.keywordDensity)
179
+ response += `- **Keyword Density:** ${content.keywordDensity}%\n`;
180
+ if (content.sentiment)
181
+ response += `- **Sentiment:** ${content.sentiment}\n`;
182
+ response += '\n';
183
+ }
184
+ response += `### SEO\n`;
185
+ response += `- **Meta Title:** ${content.metaTitle || content.title}\n`;
186
+ response += `- **Meta Description:** ${content.metaDescription}\n`;
187
+ response += `- **Focus Keyphrase:** ${content.focusKeyphrase || content.keyword}\n\n`;
188
+ if (content.suggestedTags && content.suggestedTags.length > 0) {
189
+ response += `### Tags\n`;
190
+ response += content.suggestedTags.join(', ') + '\n\n';
191
+ }
192
+ if (content.headings) {
193
+ response += `### Headings Structure\n`;
194
+ if (content.headings.h1?.length)
195
+ response += `- **H1:** ${content.headings.h1.join(', ')}\n`;
196
+ if (content.headings.h2?.length)
197
+ response += `- **H2:** ${content.headings.h2.join(', ')}\n`;
198
+ if (content.headings.h3?.length)
199
+ response += `- **H3:** ${content.headings.h3.join(', ')}\n`;
200
+ response += '\n';
201
+ }
202
+ if (content.internalLinks && content.internalLinks.length > 0) {
203
+ response += `### Internal Links\n`;
204
+ for (const link of content.internalLinks) {
205
+ response += `- [${link.text}](${link.url})\n`;
206
+ }
207
+ response += '\n';
208
+ }
209
+ if (content.imagePrompts && content.imagePrompts.length > 0) {
210
+ response += `### Image Prompts\n`;
211
+ for (let i = 0; i < content.imagePrompts.length; i++) {
212
+ response += `${i + 1}. ${content.imagePrompts[i]}\n`;
213
+ }
214
+ response += '\n';
215
+ }
216
+ if (content.faq && content.faq.length > 0) {
217
+ response += `### FAQ Section\n`;
218
+ for (const item of content.faq) {
219
+ response += `**Q: ${item.question}**\n`;
220
+ response += `A: ${item.answer}\n\n`;
221
+ }
222
+ }
223
+ // Schema markup - only include if explicitly requested (saves ~40% tokens)
224
+ if (content.schemaMarkup) {
225
+ if (includeSchema) {
226
+ response += `### Schema Markup (JSON-LD)\n`;
227
+ response += '```json\n';
228
+ try {
229
+ const schema = typeof content.schemaMarkup === 'string'
230
+ ? JSON.parse(content.schemaMarkup)
231
+ : content.schemaMarkup;
232
+ response += JSON.stringify(schema, null, 2);
233
+ }
234
+ catch {
235
+ response += content.schemaMarkup;
236
+ }
237
+ response += '\n```\n\n';
238
+ }
239
+ else {
240
+ response += `### Schema Markup\n`;
241
+ response += `✅ JSON-LD schema available (use \`includeSchema: true\` to view)\n\n`;
242
+ }
243
+ }
244
+ response += `### Content\n\n`;
245
+ // Prefer markdown content if available
246
+ if (content.markdownContent) {
247
+ response += content.markdownContent;
248
+ }
249
+ else if (content.content) {
250
+ // Strip HTML tags for display
251
+ const plainText = content.content
252
+ .replace(/<[^>]+>/g, ' ')
253
+ .replace(/\s+/g, ' ')
254
+ .trim();
255
+ response += plainText;
256
+ }
257
+ return response;
258
+ }
259
+ /**
260
+ * Tool definitions for MCP
261
+ */
262
+ exports.contentGenerationTools = [
263
+ {
264
+ name: 'generate_content',
265
+ description: 'Generate AI-powered content including blog posts, social media posts, newsletters, video scripts, and more. Uses project knowledge base for context when projectId is provided.',
266
+ inputSchema: {
267
+ type: 'object',
268
+ properties: {
269
+ keyword: {
270
+ type: 'string',
271
+ description: 'The main keyword or keyphrase for the content',
272
+ },
273
+ topic: {
274
+ type: 'string',
275
+ description: 'The topic or title for the content',
276
+ },
277
+ contentType: {
278
+ type: 'string',
279
+ description: 'Type of content: blog, faq, comparison, tutorial, case-study, linkedin-post, twitter-post, twitter-thread, newsletter, email-sequence, youtube-script, podcast-outline, video-script',
280
+ },
281
+ contentLength: {
282
+ type: 'string',
283
+ enum: ['short', 'medium', 'long', 'comprehensive'],
284
+ description: 'Content length: short (~650 words), medium (~1000 words), long (~1500 words), comprehensive (~2100 words)',
285
+ },
286
+ tone: {
287
+ type: 'string',
288
+ description: 'Tone of voice: professional, casual, analytical, educational, engaging, instructive, clear',
289
+ },
290
+ customTone: {
291
+ type: 'string',
292
+ description: 'Custom tone description if standard tones are not suitable',
293
+ },
294
+ useProjectTone: {
295
+ type: 'boolean',
296
+ description: 'Use the project\'s configured tone of voice (requires projectId)',
297
+ },
298
+ additionalContext: {
299
+ type: 'string',
300
+ description: 'Additional context or instructions for the content',
301
+ },
302
+ projectId: {
303
+ type: 'string',
304
+ description: 'Project ID to use project settings, knowledge base, and internal links for better context',
305
+ },
306
+ language: {
307
+ type: 'string',
308
+ description: 'Output language code (e.g., en, es, fr, de, el)',
309
+ },
310
+ useSemanticVariants: {
311
+ type: 'boolean',
312
+ description: 'Use semantic keyword variants for better SEO coverage (default: true)',
313
+ },
314
+ useWebSearch: {
315
+ type: 'boolean',
316
+ description: 'Use Perplexity AI for real-time web research and citations (costs extra credits)',
317
+ },
318
+ },
319
+ required: ['keyword', 'topic'],
320
+ },
321
+ },
322
+ {
323
+ name: 'get_content_history',
324
+ description: 'Get your content generation history. Filter by project or content type.',
325
+ inputSchema: {
326
+ type: 'object',
327
+ properties: {
328
+ projectId: {
329
+ type: 'string',
330
+ description: 'Filter by project ID',
331
+ },
332
+ contentType: {
333
+ type: 'string',
334
+ description: 'Filter by content type',
335
+ },
336
+ limit: {
337
+ type: 'number',
338
+ description: 'Maximum number of items to return (default: 50)',
339
+ },
340
+ },
341
+ required: [],
342
+ },
343
+ },
344
+ {
345
+ name: 'get_content_details',
346
+ description: 'Get full details of a generated content piece including the complete content and SEO data. Schema markup is available on request.',
347
+ inputSchema: {
348
+ type: 'object',
349
+ properties: {
350
+ contentId: {
351
+ type: 'string',
352
+ description: 'The ID of the content to retrieve',
353
+ },
354
+ includeSchema: {
355
+ type: 'boolean',
356
+ description: 'Include full JSON-LD schema markup (default: false, saves ~40% tokens)',
357
+ },
358
+ },
359
+ required: ['contentId'],
360
+ },
361
+ },
362
+ ];
363
+ //# sourceMappingURL=content-generation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-generation.js","sourceRoot":"","sources":["../../src/tools/content-generation.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAmCH,0CAiGC;AAKD,8CA+BC;AAKD,8CA2GC;AAtRD,6BAAwB;AAGxB,eAAe;AACF,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IAC7E,KAAK,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ACd,WAAW,EAAE,oDAAoD;iBAClE;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2FAA2F;iBACzG;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iDAAiD;iBAC/D;gBACD,mBAAmB,EAAE;oBACnB,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,uEAAuE;iBACrF;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,kFAAkF;iBAChG;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;SAC/B;KACF;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,yEAAyE;QACtF,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,sBAAsB;iBACpC;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wBAAwB;iBACtC;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iDAAiD;iBAC/D;aACF;YACD,QAAQ,EAAE,EAAc;SACzB;KACF;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,mIAAmI;QAChJ,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mCAAmC;iBACjD;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,wEAAwE;iBACtF;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Content Tools
3
+ *
4
+ * MCP tools for knowledge base and content management.
5
+ */
6
+ import { z } from 'zod';
7
+ import { ReauditAPIClient } from '../lib/api-client.js';
8
+ export declare const searchKnowledgeBaseSchema: z.ZodObject<{
9
+ projectId: z.ZodString;
10
+ query: z.ZodString;
11
+ topK: z.ZodOptional<z.ZodNumber>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ projectId: string;
14
+ query: string;
15
+ topK?: number | undefined;
16
+ }, {
17
+ projectId: string;
18
+ query: string;
19
+ topK?: number | undefined;
20
+ }>;
21
+ export declare const getContentSuggestionsSchema: z.ZodObject<{
22
+ projectId: z.ZodString;
23
+ status: z.ZodOptional<z.ZodString>;
24
+ limit: z.ZodOptional<z.ZodNumber>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ projectId: string;
27
+ status?: string | undefined;
28
+ limit?: number | undefined;
29
+ }, {
30
+ projectId: string;
31
+ status?: string | undefined;
32
+ limit?: number | undefined;
33
+ }>;
34
+ /**
35
+ * Search knowledge base tool handler
36
+ */
37
+ export declare function searchKnowledgeBase(client: ReauditAPIClient, args: z.infer<typeof searchKnowledgeBaseSchema>): Promise<string>;
38
+ /**
39
+ * Get content suggestions tool handler
40
+ */
41
+ export declare function getContentSuggestions(client: ReauditAPIClient, args: z.infer<typeof getContentSuggestionsSchema>): Promise<string>;
42
+ /**
43
+ * Tool definitions for MCP
44
+ */
45
+ export declare const contentTools: ({
46
+ name: string;
47
+ description: string;
48
+ inputSchema: {
49
+ type: "object";
50
+ properties: {
51
+ projectId: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ query: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ topK: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ status?: undefined;
64
+ limit?: undefined;
65
+ };
66
+ required: string[];
67
+ };
68
+ } | {
69
+ name: string;
70
+ description: string;
71
+ inputSchema: {
72
+ type: "object";
73
+ properties: {
74
+ projectId: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ status: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ limit: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ query?: undefined;
87
+ topK?: undefined;
88
+ };
89
+ required: string[];
90
+ };
91
+ })[];
92
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/tools/content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAItC,CAAC;AAEH;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,GAC9C,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6CxB,CAAC"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ /**
3
+ * Content Tools
4
+ *
5
+ * MCP tools for knowledge base and content management.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.contentTools = exports.getContentSuggestionsSchema = exports.searchKnowledgeBaseSchema = void 0;
9
+ exports.searchKnowledgeBase = searchKnowledgeBase;
10
+ exports.getContentSuggestions = getContentSuggestions;
11
+ const zod_1 = require("zod");
12
+ // Tool schemas
13
+ exports.searchKnowledgeBaseSchema = zod_1.z.object({
14
+ projectId: zod_1.z.string().describe('The ID of the project'),
15
+ query: zod_1.z.string().describe('The search query to find relevant content'),
16
+ topK: zod_1.z.number().optional().describe('Number of results to return (default: 3, max: 10)'),
17
+ });
18
+ exports.getContentSuggestionsSchema = zod_1.z.object({
19
+ projectId: zod_1.z.string().describe('The ID of the project'),
20
+ status: zod_1.z.string().optional().describe('Filter by status'),
21
+ limit: zod_1.z.number().optional().describe('Maximum number of suggestions to return (default: 10, max: 50)'),
22
+ });
23
+ /**
24
+ * Search knowledge base tool handler
25
+ */
26
+ async function searchKnowledgeBase(client, args) {
27
+ // Default to 3 results to save tokens (was 5)
28
+ const topK = args.topK ?? 3;
29
+ const result = await client.searchKnowledgeBase(args.projectId, args.query, topK);
30
+ if (result.message && result.results.length === 0) {
31
+ return result.message;
32
+ }
33
+ let response = `## Knowledge Base Search Results\n`;
34
+ response += `**Query:** ${result.query}\n`;
35
+ response += `**Knowledge Base:** ${result.stats.totalPages} pages, ${result.stats.totalChunks} chunks\n\n`;
36
+ if (result.results.length === 0) {
37
+ response += 'No relevant content found for your query.\n';
38
+ return response;
39
+ }
40
+ response += `### Results (${result.results.length})\n\n`;
41
+ for (const item of result.results) {
42
+ response += `#### Result #${item.rank}\n`;
43
+ if (item.title) {
44
+ response += `**Title:** ${item.title}\n`;
45
+ }
46
+ if (item.source) {
47
+ response += `**Source:** ${item.source}\n`;
48
+ }
49
+ response += `\n${item.content}\n\n`;
50
+ response += '---\n\n';
51
+ }
52
+ return response;
53
+ }
54
+ /**
55
+ * Get content suggestions tool handler
56
+ */
57
+ async function getContentSuggestions(client, args) {
58
+ const result = await client.getContentSuggestions(args.projectId, {
59
+ status: args.status,
60
+ limit: args.limit,
61
+ });
62
+ if (result.suggestions.length === 0) {
63
+ return 'No content suggestions available. Run an SEO audit to generate content recommendations.';
64
+ }
65
+ let response = `## Content Suggestions (${result.count})\n\n`;
66
+ for (const sug of result.suggestions) {
67
+ const priorityStars = '⭐'.repeat(Math.min(sug.priority, 5));
68
+ response += `### ${sug.title}\n`;
69
+ response += `**Type:** ${sug.type} | **Priority:** ${priorityStars} | **Status:** ${sug.status}\n`;
70
+ response += `${sug.description}\n`;
71
+ if (sug.targetKeywords.length > 0) {
72
+ response += `**Target Keywords:** ${sug.targetKeywords.join(', ')}\n`;
73
+ }
74
+ if (sug.estimatedImpact) {
75
+ response += `**Estimated Impact:** ${sug.estimatedImpact}\n`;
76
+ }
77
+ response += '\n';
78
+ }
79
+ return response;
80
+ }
81
+ /**
82
+ * Tool definitions for MCP
83
+ */
84
+ exports.contentTools = [
85
+ {
86
+ name: 'search_knowledge_base',
87
+ description: 'Search your project knowledge base for relevant content. The knowledge base contains scraped content from your website that can be used for context.',
88
+ inputSchema: {
89
+ type: 'object',
90
+ properties: {
91
+ projectId: {
92
+ type: 'string',
93
+ description: 'The ID of the project',
94
+ },
95
+ query: {
96
+ type: 'string',
97
+ description: 'The search query to find relevant content',
98
+ },
99
+ topK: {
100
+ type: 'number',
101
+ description: 'Number of results to return (default: 3, max: 10)',
102
+ },
103
+ },
104
+ required: ['projectId', 'query'],
105
+ },
106
+ },
107
+ {
108
+ name: 'get_content_suggestions',
109
+ description: 'Get AI-generated content suggestions for your project based on SEO analysis and competitor research.',
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: {
113
+ projectId: {
114
+ type: 'string',
115
+ description: 'The ID of the project',
116
+ },
117
+ status: {
118
+ type: 'string',
119
+ description: 'Filter by status',
120
+ },
121
+ limit: {
122
+ type: 'number',
123
+ description: 'Maximum number of suggestions to return (default: 10, max: 50)',
124
+ },
125
+ },
126
+ required: ['projectId'],
127
+ },
128
+ },
129
+ ];
130
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/tools/content.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAqBH,kDAoCC;AAKD,sDAkCC;AA9FD,6BAAwB;AAGxB,eAAe;AACF,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE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