@heyseo/mcp-server 0.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 +284 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +258 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +22 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +267 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +38 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +247 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/tools/comparison.d.ts +159 -0
- package/dist/tools/comparison.d.ts.map +1 -0
- package/dist/tools/comparison.js +482 -0
- package/dist/tools/comparison.js.map +1 -0
- package/dist/tools/ga4.d.ts +182 -0
- package/dist/tools/ga4.d.ts.map +1 -0
- package/dist/tools/ga4.js +429 -0
- package/dist/tools/ga4.js.map +1 -0
- package/dist/tools/gsc.d.ts +194 -0
- package/dist/tools/gsc.d.ts.map +1 -0
- package/dist/tools/gsc.js +348 -0
- package/dist/tools/gsc.js.map +1 -0
- package/dist/tools/index.d.ts +392 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +59 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/pagespeed.d.ts +88 -0
- package/dist/tools/pagespeed.d.ts.map +1 -0
- package/dist/tools/pagespeed.js +285 -0
- package/dist/tools/pagespeed.js.map +1 -0
- package/dist/tools/tasks.d.ts +71 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +116 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/types.d.ts +151 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/api-client.d.ts +69 -0
- package/dist/utils/api-client.d.ts.map +1 -0
- package/dist/utils/api-client.js +202 -0
- package/dist/utils/api-client.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageSpeed Insights Tools
|
|
3
|
+
* Tools for analyzing page performance and Core Web Vitals
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// Schema for PageSpeed analysis tool
|
|
7
|
+
export const analyzePageSpeedSchema = z.object({
|
|
8
|
+
url: z.string().url().describe('The URL to analyze'),
|
|
9
|
+
strategy: z
|
|
10
|
+
.enum(['mobile', 'desktop'])
|
|
11
|
+
.optional()
|
|
12
|
+
.default('mobile')
|
|
13
|
+
.describe('Device strategy to use for analysis'),
|
|
14
|
+
});
|
|
15
|
+
// Schema for bulk PageSpeed analysis
|
|
16
|
+
export const bulkPageSpeedSchema = z.object({
|
|
17
|
+
urls: z
|
|
18
|
+
.array(z.string().url())
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(10)
|
|
21
|
+
.describe('URLs to analyze (max 10)'),
|
|
22
|
+
strategy: z
|
|
23
|
+
.enum(['mobile', 'desktop'])
|
|
24
|
+
.optional()
|
|
25
|
+
.default('mobile')
|
|
26
|
+
.describe('Device strategy to use for analysis'),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Get rating emoji for metric
|
|
30
|
+
*/
|
|
31
|
+
function getRatingEmoji(rating) {
|
|
32
|
+
switch (rating) {
|
|
33
|
+
case 'good':
|
|
34
|
+
return '✅';
|
|
35
|
+
case 'needs-improvement':
|
|
36
|
+
return '⚠️';
|
|
37
|
+
case 'poor':
|
|
38
|
+
return '❌';
|
|
39
|
+
default:
|
|
40
|
+
return '❓';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get score rating
|
|
45
|
+
*/
|
|
46
|
+
function getScoreRating(score) {
|
|
47
|
+
if (score >= 90)
|
|
48
|
+
return 'good';
|
|
49
|
+
if (score >= 50)
|
|
50
|
+
return 'needs-improvement';
|
|
51
|
+
return 'poor';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Format metric value for display
|
|
55
|
+
*/
|
|
56
|
+
function formatMetricValue(value, unit) {
|
|
57
|
+
if (unit === 'ms') {
|
|
58
|
+
if (value >= 1000) {
|
|
59
|
+
return `${(value / 1000).toFixed(2)}s`;
|
|
60
|
+
}
|
|
61
|
+
return `${Math.round(value)}ms`;
|
|
62
|
+
}
|
|
63
|
+
if (unit === 's') {
|
|
64
|
+
return `${value.toFixed(2)}s`;
|
|
65
|
+
}
|
|
66
|
+
if (unit === 'unitless') {
|
|
67
|
+
return value.toFixed(3);
|
|
68
|
+
}
|
|
69
|
+
return `${value}${unit}`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Execute PageSpeed analysis tool
|
|
73
|
+
*/
|
|
74
|
+
export async function executeAnalyzePageSpeed(client, input) {
|
|
75
|
+
try {
|
|
76
|
+
const result = await client.analyzePageSpeed(input.url, input.strategy);
|
|
77
|
+
// Format Core Web Vitals
|
|
78
|
+
const cwv = result.metrics;
|
|
79
|
+
const formattedCWV = {
|
|
80
|
+
lcp: {
|
|
81
|
+
value: formatMetricValue(cwv.lcp.value, cwv.lcp.unit),
|
|
82
|
+
rating: cwv.lcp.rating,
|
|
83
|
+
status: getRatingEmoji(cwv.lcp.rating),
|
|
84
|
+
description: 'Largest Contentful Paint - loading performance',
|
|
85
|
+
},
|
|
86
|
+
inp: {
|
|
87
|
+
value: formatMetricValue(cwv.inp.value, cwv.inp.unit),
|
|
88
|
+
rating: cwv.inp.rating,
|
|
89
|
+
status: getRatingEmoji(cwv.inp.rating),
|
|
90
|
+
description: 'Interaction to Next Paint - responsiveness',
|
|
91
|
+
},
|
|
92
|
+
cls: {
|
|
93
|
+
value: formatMetricValue(cwv.cls.value, cwv.cls.unit),
|
|
94
|
+
rating: cwv.cls.rating,
|
|
95
|
+
status: getRatingEmoji(cwv.cls.rating),
|
|
96
|
+
description: 'Cumulative Layout Shift - visual stability',
|
|
97
|
+
},
|
|
98
|
+
fcp: {
|
|
99
|
+
value: formatMetricValue(cwv.fcp.value, cwv.fcp.unit),
|
|
100
|
+
rating: cwv.fcp.rating,
|
|
101
|
+
status: getRatingEmoji(cwv.fcp.rating),
|
|
102
|
+
description: 'First Contentful Paint - perceived load speed',
|
|
103
|
+
},
|
|
104
|
+
ttfb: {
|
|
105
|
+
value: formatMetricValue(cwv.ttfb.value, cwv.ttfb.unit),
|
|
106
|
+
rating: cwv.ttfb.rating,
|
|
107
|
+
status: getRatingEmoji(cwv.ttfb.rating),
|
|
108
|
+
description: 'Time to First Byte - server response time',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
// Count ratings
|
|
112
|
+
const ratings = Object.values(formattedCWV).map((m) => m.rating);
|
|
113
|
+
const goodCount = ratings.filter((r) => r === 'good').length;
|
|
114
|
+
const needsImprovementCount = ratings.filter((r) => r === 'needs-improvement').length;
|
|
115
|
+
const poorCount = ratings.filter((r) => r === 'poor').length;
|
|
116
|
+
// Format opportunities
|
|
117
|
+
const topOpportunities = result.opportunities
|
|
118
|
+
.slice(0, 5)
|
|
119
|
+
.map((opp) => ({
|
|
120
|
+
title: opp.title,
|
|
121
|
+
savings: opp.savings > 0 ? `${(opp.savings / 1000).toFixed(1)}s potential savings` : 'N/A',
|
|
122
|
+
description: opp.description,
|
|
123
|
+
}));
|
|
124
|
+
return JSON.stringify({
|
|
125
|
+
success: true,
|
|
126
|
+
url: result.url,
|
|
127
|
+
strategy: result.strategy,
|
|
128
|
+
performanceScore: {
|
|
129
|
+
value: result.performanceScore,
|
|
130
|
+
rating: getScoreRating(result.performanceScore),
|
|
131
|
+
status: getRatingEmoji(getScoreRating(result.performanceScore)),
|
|
132
|
+
},
|
|
133
|
+
summary: {
|
|
134
|
+
good: goodCount,
|
|
135
|
+
needsImprovement: needsImprovementCount,
|
|
136
|
+
poor: poorCount,
|
|
137
|
+
passedCWV: goodCount >= 3, // Need 3 of 5 to "pass"
|
|
138
|
+
},
|
|
139
|
+
coreWebVitals: formattedCWV,
|
|
140
|
+
topOpportunities,
|
|
141
|
+
diagnosticsCount: result.diagnostics.length,
|
|
142
|
+
}, null, 2);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return JSON.stringify({
|
|
146
|
+
success: false,
|
|
147
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Execute bulk PageSpeed analysis
|
|
153
|
+
*/
|
|
154
|
+
export async function executeBulkPageSpeed(client, input) {
|
|
155
|
+
try {
|
|
156
|
+
const results = await Promise.all(input.urls.map(async (url) => {
|
|
157
|
+
try {
|
|
158
|
+
const result = await client.analyzePageSpeed(url, input.strategy);
|
|
159
|
+
return {
|
|
160
|
+
url,
|
|
161
|
+
success: true,
|
|
162
|
+
score: result.performanceScore,
|
|
163
|
+
scoreRating: getScoreRating(result.performanceScore),
|
|
164
|
+
lcp: {
|
|
165
|
+
value: formatMetricValue(result.metrics.lcp.value, result.metrics.lcp.unit),
|
|
166
|
+
rating: result.metrics.lcp.rating,
|
|
167
|
+
},
|
|
168
|
+
cls: {
|
|
169
|
+
value: formatMetricValue(result.metrics.cls.value, result.metrics.cls.unit),
|
|
170
|
+
rating: result.metrics.cls.rating,
|
|
171
|
+
},
|
|
172
|
+
inp: {
|
|
173
|
+
value: formatMetricValue(result.metrics.inp.value, result.metrics.inp.unit),
|
|
174
|
+
rating: result.metrics.inp.rating,
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
return {
|
|
180
|
+
url,
|
|
181
|
+
success: false,
|
|
182
|
+
error: err instanceof Error ? err.message : 'Analysis failed',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}));
|
|
186
|
+
// Calculate summary statistics
|
|
187
|
+
const successfulResults = results.filter((r) => r.success);
|
|
188
|
+
const avgScore = successfulResults.length > 0
|
|
189
|
+
? successfulResults.reduce((sum, r) => sum + (r.score || 0), 0) / successfulResults.length
|
|
190
|
+
: 0;
|
|
191
|
+
// Find best and worst performers
|
|
192
|
+
const sortedByScore = successfulResults
|
|
193
|
+
.filter((r) => typeof r.score === 'number')
|
|
194
|
+
.sort((a, b) => b.score - a.score);
|
|
195
|
+
return JSON.stringify({
|
|
196
|
+
success: true,
|
|
197
|
+
strategy: input.strategy,
|
|
198
|
+
summary: {
|
|
199
|
+
totalUrls: input.urls.length,
|
|
200
|
+
successful: successfulResults.length,
|
|
201
|
+
failed: results.length - successfulResults.length,
|
|
202
|
+
averageScore: Math.round(avgScore),
|
|
203
|
+
bestPerformer: sortedByScore[0]?.url || null,
|
|
204
|
+
worstPerformer: sortedByScore[sortedByScore.length - 1]?.url || null,
|
|
205
|
+
},
|
|
206
|
+
results,
|
|
207
|
+
}, null, 2);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
return JSON.stringify({
|
|
211
|
+
success: false,
|
|
212
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* PageSpeed tool definitions for MCP
|
|
218
|
+
*/
|
|
219
|
+
export const pagespeedTools = [
|
|
220
|
+
{
|
|
221
|
+
name: 'heyseo_pagespeed',
|
|
222
|
+
description: `Analyze a page's performance using Google PageSpeed Insights.
|
|
223
|
+
|
|
224
|
+
Returns:
|
|
225
|
+
- Performance Score (0-100)
|
|
226
|
+
- Core Web Vitals:
|
|
227
|
+
- LCP (Largest Contentful Paint) - loading performance
|
|
228
|
+
- INP (Interaction to Next Paint) - responsiveness
|
|
229
|
+
- CLS (Cumulative Layout Shift) - visual stability
|
|
230
|
+
- FCP (First Contentful Paint) - perceived speed
|
|
231
|
+
- TTFB (Time to First Byte) - server response
|
|
232
|
+
- Top optimization opportunities with potential time savings
|
|
233
|
+
- Diagnostic information
|
|
234
|
+
|
|
235
|
+
Each metric is rated as good, needs-improvement, or poor.`,
|
|
236
|
+
inputSchema: {
|
|
237
|
+
type: 'object',
|
|
238
|
+
properties: {
|
|
239
|
+
url: {
|
|
240
|
+
type: 'string',
|
|
241
|
+
format: 'uri',
|
|
242
|
+
description: 'The URL to analyze',
|
|
243
|
+
},
|
|
244
|
+
strategy: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
enum: ['mobile', 'desktop'],
|
|
247
|
+
default: 'mobile',
|
|
248
|
+
description: 'Device strategy (mobile recommended for SEO)',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
required: ['url'],
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'heyseo_pagespeed_bulk',
|
|
256
|
+
description: `Analyze multiple pages' performance at once.
|
|
257
|
+
|
|
258
|
+
Analyzes up to 10 URLs and returns a comparison summary including:
|
|
259
|
+
- Average performance score
|
|
260
|
+
- Best and worst performers
|
|
261
|
+
- Core Web Vitals for each page
|
|
262
|
+
|
|
263
|
+
Useful for comparing different pages or tracking multiple key pages.`,
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: 'object',
|
|
266
|
+
properties: {
|
|
267
|
+
urls: {
|
|
268
|
+
type: 'array',
|
|
269
|
+
items: { type: 'string', format: 'uri' },
|
|
270
|
+
minItems: 1,
|
|
271
|
+
maxItems: 10,
|
|
272
|
+
description: 'URLs to analyze (max 10)',
|
|
273
|
+
},
|
|
274
|
+
strategy: {
|
|
275
|
+
type: 'string',
|
|
276
|
+
enum: ['mobile', 'desktop'],
|
|
277
|
+
default: 'mobile',
|
|
278
|
+
description: 'Device strategy',
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
required: ['urls'],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
//# sourceMappingURL=pagespeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagespeed.js","sourceRoot":"","sources":["../../src/tools/pagespe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AW,EAAE,8CAA8C;iBAC5D;aACF;YACD,QAAQ,EAAE,CAAC,KAAK,CAAC;SAClB;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE;;;;;;;qEAOoD;QACjE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;oBACxC,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,0BAA0B;iBACxC;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;oBAC3B,OAAO,EAAE,QAAQ;oBACjB,WAAW,EAAE,iBAAiB;iBAC/B;aACF;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Management Tools
|
|
3
|
+
* Tools for creating and managing SEO tasks in HeySeo Kanban
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { HeySeoApiClient } from '../utils/api-client.js';
|
|
7
|
+
export declare const createTaskSchema: z.ZodObject<{
|
|
8
|
+
siteId: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>>;
|
|
12
|
+
category: z.ZodDefault<z.ZodOptional<z.ZodEnum<["technical", "content", "links", "ux"]>>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
title: string;
|
|
15
|
+
priority: "high" | "medium" | "low";
|
|
16
|
+
category: "technical" | "content" | "links" | "ux";
|
|
17
|
+
siteId: string;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
title: string;
|
|
21
|
+
siteId: string;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
priority?: "high" | "medium" | "low" | undefined;
|
|
24
|
+
category?: "technical" | "content" | "links" | "ux" | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export type CreateTaskInput = z.infer<typeof createTaskSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute create task tool
|
|
29
|
+
*/
|
|
30
|
+
export declare function executeCreateTask(client: HeySeoApiClient, input: CreateTaskInput): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Task tool definitions for MCP
|
|
33
|
+
*/
|
|
34
|
+
export declare const taskTools: {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: string;
|
|
39
|
+
properties: {
|
|
40
|
+
siteId: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
title: {
|
|
45
|
+
type: string;
|
|
46
|
+
minLength: number;
|
|
47
|
+
maxLength: number;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
description: {
|
|
51
|
+
type: string;
|
|
52
|
+
maxLength: number;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
priority: {
|
|
56
|
+
type: string;
|
|
57
|
+
enum: string[];
|
|
58
|
+
default: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
category: {
|
|
62
|
+
type: string;
|
|
63
|
+
enum: string[];
|
|
64
|
+
default: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
required: string[];
|
|
69
|
+
};
|
|
70
|
+
}[];
|
|
71
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAkB3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDrB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Management Tools
|
|
3
|
+
* Tools for creating and managing SEO tasks in HeySeo Kanban
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// Schema for create task tool
|
|
7
|
+
export const createTaskSchema = z.object({
|
|
8
|
+
siteId: z.string().describe('The ID of the site this task is for'),
|
|
9
|
+
title: z.string().min(1).max(200).describe('Task title'),
|
|
10
|
+
description: z
|
|
11
|
+
.string()
|
|
12
|
+
.max(2000)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Detailed task description with context and steps'),
|
|
15
|
+
priority: z
|
|
16
|
+
.enum(['low', 'medium', 'high'])
|
|
17
|
+
.optional()
|
|
18
|
+
.default('medium')
|
|
19
|
+
.describe('Task priority level'),
|
|
20
|
+
category: z
|
|
21
|
+
.enum(['technical', 'content', 'links', 'ux'])
|
|
22
|
+
.optional()
|
|
23
|
+
.default('technical')
|
|
24
|
+
.describe('Task category for organization'),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Execute create task tool
|
|
28
|
+
*/
|
|
29
|
+
export async function executeCreateTask(client, input) {
|
|
30
|
+
try {
|
|
31
|
+
const task = await client.createTask({
|
|
32
|
+
siteId: input.siteId,
|
|
33
|
+
title: input.title,
|
|
34
|
+
description: input.description || '',
|
|
35
|
+
priority: input.priority || 'medium',
|
|
36
|
+
category: input.category || 'technical',
|
|
37
|
+
status: 'todo',
|
|
38
|
+
});
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
success: true,
|
|
41
|
+
message: 'Task created successfully',
|
|
42
|
+
task: {
|
|
43
|
+
id: task.id,
|
|
44
|
+
title: task.title,
|
|
45
|
+
description: task.description,
|
|
46
|
+
priority: task.priority,
|
|
47
|
+
category: task.category,
|
|
48
|
+
status: task.status,
|
|
49
|
+
createdAt: task.createdAt,
|
|
50
|
+
},
|
|
51
|
+
}, null, 2);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return JSON.stringify({
|
|
55
|
+
success: false,
|
|
56
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Task tool definitions for MCP
|
|
62
|
+
*/
|
|
63
|
+
export const taskTools = [
|
|
64
|
+
{
|
|
65
|
+
name: 'heyseo_create_task',
|
|
66
|
+
description: `Create a new SEO task in the HeySeo Kanban board.
|
|
67
|
+
|
|
68
|
+
Use this to turn insights and recommendations into actionable tasks.
|
|
69
|
+
Tasks are organized by category and priority for easy tracking.
|
|
70
|
+
|
|
71
|
+
Categories:
|
|
72
|
+
- technical: Site speed, indexing, structured data, etc.
|
|
73
|
+
- content: Blog posts, page updates, keyword targeting
|
|
74
|
+
- links: Internal linking, backlink opportunities
|
|
75
|
+
- ux: User experience improvements affecting SEO
|
|
76
|
+
|
|
77
|
+
Example tasks:
|
|
78
|
+
- "Optimize hero image on /pricing page" (technical, high)
|
|
79
|
+
- "Add FAQ schema to product pages" (technical, medium)
|
|
80
|
+
- "Update meta description for blog posts" (content, low)`,
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
siteId: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'The ID of the site this task is for',
|
|
87
|
+
},
|
|
88
|
+
title: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
minLength: 1,
|
|
91
|
+
maxLength: 200,
|
|
92
|
+
description: 'Concise task title',
|
|
93
|
+
},
|
|
94
|
+
description: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
maxLength: 2000,
|
|
97
|
+
description: 'Detailed description with context, steps, and expected impact',
|
|
98
|
+
},
|
|
99
|
+
priority: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
enum: ['low', 'medium', 'high'],
|
|
102
|
+
default: 'medium',
|
|
103
|
+
description: 'Task priority',
|
|
104
|
+
},
|
|
105
|
+
category: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
enum: ['technical', 'content', 'links', 'ux'],
|
|
108
|
+
default: 'technical',
|
|
109
|
+
description: 'Task category',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ['siteId', 'title'],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,8BAA8B;AAC9B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAClE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;IACxD,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAA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
|
|
1
|
+
/**
|
|
2
|
+
* HeySeo MCP Server Types
|
|
3
|
+
*/
|
|
4
|
+
export interface HeySeoSite {
|
|
5
|
+
id: string;
|
|
6
|
+
url: string;
|
|
7
|
+
name: string;
|
|
8
|
+
gscConnected: boolean;
|
|
9
|
+
ga4Connected: boolean;
|
|
10
|
+
ga4PropertyId?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GSCMetrics {
|
|
13
|
+
clicks: number;
|
|
14
|
+
impressions: number;
|
|
15
|
+
ctr: number;
|
|
16
|
+
position: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GSCRow extends GSCMetrics {
|
|
19
|
+
keys: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface GSCQueryResult {
|
|
22
|
+
rows: GSCRow[];
|
|
23
|
+
responseAggregationType: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GSCQueryParams {
|
|
26
|
+
siteId: string;
|
|
27
|
+
startDate: string;
|
|
28
|
+
endDate: string;
|
|
29
|
+
dimensions?: GSCDimension[];
|
|
30
|
+
metrics?: GSCMetric[];
|
|
31
|
+
filters?: GSCFilter[];
|
|
32
|
+
rowLimit?: number;
|
|
33
|
+
startRow?: number;
|
|
34
|
+
}
|
|
35
|
+
export type GSCDimension = 'query' | 'page' | 'country' | 'device' | 'date';
|
|
36
|
+
export type GSCMetric = 'clicks' | 'impressions' | 'ctr' | 'position';
|
|
37
|
+
export interface GSCFilter {
|
|
38
|
+
dimension: GSCDimension;
|
|
39
|
+
operator: 'equals' | 'contains' | 'notContains' | 'includingRegex' | 'excludingRegex';
|
|
40
|
+
expression: string;
|
|
41
|
+
}
|
|
42
|
+
export interface GA4Metrics {
|
|
43
|
+
sessions: number;
|
|
44
|
+
activeUsers: number;
|
|
45
|
+
newUsers: number;
|
|
46
|
+
engagementRate: number;
|
|
47
|
+
bounceRate: number;
|
|
48
|
+
avgSessionDuration: number;
|
|
49
|
+
screenPageViews: number;
|
|
50
|
+
conversions: number;
|
|
51
|
+
}
|
|
52
|
+
export interface GA4Row {
|
|
53
|
+
dimensions: Record<string, string>;
|
|
54
|
+
metrics: Partial<GA4Metrics>;
|
|
55
|
+
}
|
|
56
|
+
export interface GA4QueryParams {
|
|
57
|
+
siteId: string;
|
|
58
|
+
startDate: string;
|
|
59
|
+
endDate: string;
|
|
60
|
+
dimensions?: GA4Dimension[];
|
|
61
|
+
metrics?: GA4Metric[];
|
|
62
|
+
limit?: number;
|
|
63
|
+
}
|
|
64
|
+
export type GA4Dimension = 'date' | 'landingPage' | 'pagePath' | 'sessionSource' | 'sessionMedium' | 'deviceCategory' | 'country' | 'city';
|
|
65
|
+
export type GA4Metric = 'sessions' | 'activeUsers' | 'newUsers' | 'engagementRate' | 'bounceRate' | 'averageSessionDuration' | 'screenPageViews' | 'conversions' | 'eventCount';
|
|
66
|
+
export interface PageSpeedResult {
|
|
67
|
+
url: string;
|
|
68
|
+
strategy: 'mobile' | 'desktop';
|
|
69
|
+
performanceScore: number;
|
|
70
|
+
metrics: CoreWebVitals;
|
|
71
|
+
opportunities: PageSpeedOpportunity[];
|
|
72
|
+
diagnostics: PageSpeedDiagnostic[];
|
|
73
|
+
}
|
|
74
|
+
export interface CoreWebVitals {
|
|
75
|
+
lcp: MetricValue;
|
|
76
|
+
fid: MetricValue;
|
|
77
|
+
inp: MetricValue;
|
|
78
|
+
cls: MetricValue;
|
|
79
|
+
fcp: MetricValue;
|
|
80
|
+
ttfb: MetricValue;
|
|
81
|
+
}
|
|
82
|
+
export interface MetricValue {
|
|
83
|
+
value: number;
|
|
84
|
+
unit: string;
|
|
85
|
+
rating: 'good' | 'needs-improvement' | 'poor';
|
|
86
|
+
}
|
|
87
|
+
export interface PageSpeedOpportunity {
|
|
88
|
+
id: string;
|
|
89
|
+
title: string;
|
|
90
|
+
description: string;
|
|
91
|
+
savings: number;
|
|
92
|
+
}
|
|
93
|
+
export interface PageSpeedDiagnostic {
|
|
94
|
+
id: string;
|
|
95
|
+
title: string;
|
|
96
|
+
description: string;
|
|
97
|
+
severity: 'info' | 'warning' | 'error';
|
|
98
|
+
}
|
|
99
|
+
export interface PeriodComparison {
|
|
100
|
+
period1: PeriodData;
|
|
101
|
+
period2: PeriodData;
|
|
102
|
+
changes: MetricChanges;
|
|
103
|
+
}
|
|
104
|
+
export interface PeriodData {
|
|
105
|
+
startDate: string;
|
|
106
|
+
endDate: string;
|
|
107
|
+
metrics: GSCMetrics & Partial<GA4Metrics>;
|
|
108
|
+
}
|
|
109
|
+
export interface MetricChanges {
|
|
110
|
+
clicks: ChangeValue;
|
|
111
|
+
impressions: ChangeValue;
|
|
112
|
+
ctr: ChangeValue;
|
|
113
|
+
position: ChangeValue;
|
|
114
|
+
sessions?: ChangeValue;
|
|
115
|
+
activeUsers?: ChangeValue;
|
|
116
|
+
}
|
|
117
|
+
export interface ChangeValue {
|
|
118
|
+
absolute: number;
|
|
119
|
+
percentage: number;
|
|
120
|
+
trend: 'up' | 'down' | 'stable';
|
|
121
|
+
}
|
|
122
|
+
export interface SEOOpportunity {
|
|
123
|
+
type: 'keyword' | 'page' | 'technical' | 'content';
|
|
124
|
+
priority: 'high' | 'medium' | 'low';
|
|
125
|
+
title: string;
|
|
126
|
+
description: string;
|
|
127
|
+
impact: string;
|
|
128
|
+
effort: 'low' | 'medium' | 'high';
|
|
129
|
+
data?: Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
export interface KanbanTask {
|
|
132
|
+
id: string;
|
|
133
|
+
title: string;
|
|
134
|
+
description: string;
|
|
135
|
+
status: 'todo' | 'in_progress' | 'done';
|
|
136
|
+
priority: 'low' | 'medium' | 'high';
|
|
137
|
+
category: 'technical' | 'content' | 'links' | 'ux';
|
|
138
|
+
siteId: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
}
|
|
142
|
+
export interface HeySeoConfig {
|
|
143
|
+
apiKey: string;
|
|
144
|
+
baseUrl: string;
|
|
145
|
+
}
|
|
146
|
+
export interface ApiResponse<T> {
|
|
147
|
+
success: boolean;
|
|
148
|
+
data?: T;
|
|
149
|
+
error?: string;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC5E,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,KAAK,GAAG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