@heyseo/mcp-server 0.2.0 → 0.3.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 +234 -60
- package/dist/index.js +872 -293
- package/dist/index.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +93 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +135 -4
- package/dist/resources/index.js.map +1 -1
- package/dist/tools/chat.d.ts +44 -0
- package/dist/tools/chat.d.ts.map +1 -0
- package/dist/tools/chat.js +37 -0
- package/dist/tools/chat.js.map +1 -0
- package/dist/tools/comparison.d.ts +1 -1
- package/dist/tools/conversations.d.ts +95 -0
- package/dist/tools/conversations.d.ts.map +1 -0
- package/dist/tools/conversations.js +110 -0
- package/dist/tools/conversations.js.map +1 -0
- package/dist/tools/dataforseo.d.ts +49 -0
- package/dist/tools/dataforseo.d.ts.map +1 -0
- package/dist/tools/dataforseo.js +37 -0
- package/dist/tools/dataforseo.js.map +1 -0
- package/dist/tools/index.d.ts +1126 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +146 -6
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/indexing.d.ts +228 -0
- package/dist/tools/indexing.d.ts.map +1 -0
- package/dist/tools/indexing.js +262 -0
- package/dist/tools/indexing.js.map +1 -0
- package/dist/tools/insights.d.ts +61 -0
- package/dist/tools/insights.d.ts.map +1 -0
- package/dist/tools/insights.js +85 -0
- package/dist/tools/insights.js.map +1 -0
- package/dist/tools/knowledge.d.ts +98 -0
- package/dist/tools/knowledge.d.ts.map +1 -0
- package/dist/tools/knowledge.js +69 -0
- package/dist/tools/knowledge.js.map +1 -0
- package/dist/tools/memory.d.ts +602 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +395 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/notifications.d.ts +75 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +62 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/onpage.d.ts +71 -0
- package/dist/tools/onpage.d.ts.map +1 -0
- package/dist/tools/onpage.js +75 -0
- package/dist/tools/onpage.js.map +1 -0
- package/dist/tools/pagespeed.d.ts +39 -0
- package/dist/tools/pagespeed.d.ts.map +1 -1
- package/dist/tools/pagespeed.js +29 -0
- package/dist/tools/pagespeed.js.map +1 -1
- package/dist/tools/reports.d.ts +248 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +234 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/serp.d.ts +138 -0
- package/dist/tools/serp.d.ts.map +1 -0
- package/dist/tools/serp.js +105 -0
- package/dist/tools/serp.js.map +1 -0
- package/dist/tools/site.d.ts +47 -0
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +88 -1
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/sitemaps.d.ts +72 -0
- package/dist/tools/sitemaps.d.ts.map +1 -0
- package/dist/tools/sitemaps.js +100 -0
- package/dist/tools/sitemaps.js.map +1 -0
- package/dist/tools/tasks.d.ts +70 -16
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +46 -0
- package/dist/tools/tasks.js.map +1 -1
- package/dist/types.d.ts +138 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/api-client.d.ts +103 -1
- package/dist/utils/api-client.d.ts.map +1 -1
- package/dist/utils/api-client.js +400 -1
- package/dist/utils/api-client.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -6,307 +6,886 @@
|
|
|
6
6
|
* @author HeySeo
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import * as Sentry from '@sentry/node';
|
|
10
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
11
|
-
import {
|
|
12
|
+
import { z } from 'zod';
|
|
12
13
|
import { createApiClient } from './utils/api-client.js';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
14
|
+
import {
|
|
15
|
+
// Execute functions
|
|
16
|
+
executeListSites, executeSelectSite, executeGetCurrentSite, executeUpdateSite, executeDeleteSite, executeSyncAnalytics, executeQueryGSC, executeTopKeywords, executeTopPages, executeRankingHistory, executeQueryGA4, executeLandingPages, executeTrafficSources, executeAnalyzePageSpeed, executeBulkPageSpeed, executePagespeedHistory, executeComparePeriod, executeWeekOverWeek, executeFindOpportunities, executeCreateTask, executeListTasks, executeGetTask, executeUpdateTask, executeDeleteTask, executeBulkCreateTasks, executeBulkUpdateTasks, executeMoveTask, executeListReports, executeGetReport, executeGenerateReport, executeDeleteReport, executeReportSettings, executeUpdateReportSettings, executeSendTestReport, executeIndexingStatus, executeIndexingPages, executeSubmitForIndexing, executeIndexingCheck, executeIndexingHistory, executeIndexingSettings, executeUpdateIndexingSettings, executeIndexingSubmissions, executeRemoveIndexingPage, executeGetMemory, executeUpdateStrategy, executeRecordAction, executeAddLearning, executeDeleteGoal, executeMemorySnapshots, executeGenerateSnapshot, executeQueueAction, executeUpdateQueuedAction, executeGetInsights, executeGenerateInsights, executeOnpageAudit, executeOnpageHistory, executeSerpSearch, executeSerpHistory, executeSerpBatch, executeListSitemaps, executeSubmitSitemap, executeDeleteSitemap, executeGetKnowledge, executeUpdateKnowledge, executeNotificationSettings, executeUpdateNotificationSettings, executeKeywordVolume, executeChat, executeListConversations, executeGetConversation, executeCreateConversation, executeDeleteConversation,
|
|
17
|
+
// Schemas
|
|
18
|
+
selectSiteSchema, updateSiteSchema, deleteSiteSchema, syncAnalyticsSchema, queryGSCSchema, topKeywordsSchema, topPagesSchema, rankingHistorySchema, queryGA4Schema, landingPagesSchema, trafficSourcesSchema, analyzePageSpeedSchema, bulkPageSpeedSchema, pagespeedHistorySchema, comparePeriodSchema, weekOverWeekSchema, findOpportunitiesSchema, createTaskSchema, listTasksSchema, getTaskSchema, updateTaskSchema, deleteTaskSchema, bulkCreateTasksSchema, bulkUpdateTasksSchema, moveTaskSchema, listReportsSchema, getReportSchema, generateReportSchema, deleteReportSchema, reportSettingsSchema, updateReportSettingsSchema, sendTestReportSchema, indexingStatusSchema, indexingPagesSchema, submitForIndexingSchema, indexingCheckSchema, indexingHistorySchema, indexingSettingsSchema, updateIndexingSettingsSchema, indexingSubmissionsSchema, removeIndexingPageSchema, getMemorySchema, updateStrategySchema, recordActionSchema, addLearningSchema, deleteGoalSchema, memorySnapshotsSchema, generateSnapshotSchema, queueActionSchema, updateQueuedActionSchema, getInsightsSchema, generateInsightsSchema, onpageAuditSchema, onpageHistorySchema, serpSearchSchema, serpHistorySchema, serpBatchSchema, listSitemapsSchema, submitSitemapSchema, deleteSitemapSchema, getKnowledgeSchema, updateKnowledgeSchema, updateNotificationSettingsSchema, keywordVolumeSchema, chatSchema, listConversationsSchema, getConversationSchema, createConversationSchema, deleteConversationSchema, } from './tools/index.js';
|
|
19
|
+
import { listResources } from './resources/index.js';
|
|
20
|
+
import { generatePromptMessages } from './prompts/index.js';
|
|
21
|
+
Sentry.init({
|
|
22
|
+
dsn: 'https://d1b846299dd6f55a95683e3257a25c24@o4510868751384576.ingest.us.sentry.io/4510868753547264',
|
|
23
|
+
tracesSampleRate: 1.0,
|
|
24
|
+
sendDefaultPii: true,
|
|
25
|
+
});
|
|
17
26
|
const SERVER_NAME = 'heyseo-mcp';
|
|
18
27
|
const SERVER_VERSION = '0.1.0';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
client = null;
|
|
25
|
-
selectedSiteId = null;
|
|
26
|
-
constructor() {
|
|
27
|
-
this.server = new Server({
|
|
28
|
-
name: SERVER_NAME,
|
|
29
|
-
version: SERVER_VERSION,
|
|
30
|
-
}, {
|
|
31
|
-
capabilities: {
|
|
32
|
-
tools: {},
|
|
33
|
-
resources: {},
|
|
34
|
-
prompts: {},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
this.setupHandlers();
|
|
38
|
-
this.setupErrorHandling();
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Initialize the API client
|
|
42
|
-
*/
|
|
43
|
-
initClient() {
|
|
44
|
-
if (!this.client) {
|
|
45
|
-
this.client = createApiClient();
|
|
46
|
-
}
|
|
47
|
-
return this.client;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Setup request handlers
|
|
51
|
-
*/
|
|
52
|
-
setupHandlers() {
|
|
53
|
-
// List available tools
|
|
54
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
55
|
-
return {
|
|
56
|
-
tools: allTools,
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
// Handle tool calls
|
|
60
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
61
|
-
const { name, arguments: args } = request.params;
|
|
62
|
-
const client = this.initClient();
|
|
63
|
-
try {
|
|
64
|
-
let result;
|
|
65
|
-
switch (name) {
|
|
66
|
-
// Site Management Tools
|
|
67
|
-
case 'heyseo_list_sites': {
|
|
68
|
-
result = await executeListSites(client);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
case 'heyseo_select_site': {
|
|
72
|
-
const parsed = selectSiteSchema.parse(args);
|
|
73
|
-
result = await executeSelectSite(client, parsed.siteId);
|
|
74
|
-
// Update the selected site if valid
|
|
75
|
-
if (JSON.parse(result).success) {
|
|
76
|
-
this.selectedSiteId = parsed.siteId;
|
|
77
|
-
}
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case 'heyseo_get_current_site': {
|
|
81
|
-
result = await executeGetCurrentSite(client, this.selectedSiteId || undefined);
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
// GSC Tools
|
|
85
|
-
case 'heyseo_query_gsc': {
|
|
86
|
-
const parsed = queryGSCSchema.parse(args);
|
|
87
|
-
result = await executeQueryGSC(client, parsed);
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
case 'heyseo_top_keywords': {
|
|
91
|
-
const parsed = topKeywordsSchema.parse(args);
|
|
92
|
-
result = await executeTopKeywords(client, parsed);
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
case 'heyseo_top_pages': {
|
|
96
|
-
const parsed = topPagesSchema.parse(args);
|
|
97
|
-
result = await executeTopPages(client, parsed);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
case 'heyseo_ranking_history': {
|
|
101
|
-
const parsed = rankingHistorySchema.parse(args);
|
|
102
|
-
result = await executeRankingHistory(client, parsed);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
// GA4 Tools
|
|
106
|
-
case 'heyseo_query_ga4': {
|
|
107
|
-
const parsed = queryGA4Schema.parse(args);
|
|
108
|
-
result = await executeQueryGA4(client, parsed);
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
case 'heyseo_landing_pages': {
|
|
112
|
-
const parsed = landingPagesSchema.parse(args);
|
|
113
|
-
result = await executeLandingPages(client, parsed);
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
case 'heyseo_traffic_sources': {
|
|
117
|
-
const parsed = trafficSourcesSchema.parse(args);
|
|
118
|
-
result = await executeTrafficSources(client, parsed);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
// PageSpeed Tools
|
|
122
|
-
case 'heyseo_pagespeed': {
|
|
123
|
-
const parsed = analyzePageSpeedSchema.parse(args);
|
|
124
|
-
result = await executeAnalyzePageSpeed(client, parsed);
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
case 'heyseo_pagespeed_bulk': {
|
|
128
|
-
const parsed = bulkPageSpeedSchema.parse(args);
|
|
129
|
-
result = await executeBulkPageSpeed(client, parsed);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
// Comparison Tools
|
|
133
|
-
case 'heyseo_compare_periods': {
|
|
134
|
-
const parsed = comparePeriodSchema.parse(args);
|
|
135
|
-
result = await executeComparePeriod(client, parsed);
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
case 'heyseo_week_over_week': {
|
|
139
|
-
const parsed = weekOverWeekSchema.parse(args);
|
|
140
|
-
result = await executeWeekOverWeek(client, parsed);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
case 'heyseo_find_opportunities': {
|
|
144
|
-
const parsed = findOpportunitiesSchema.parse(args);
|
|
145
|
-
result = await executeFindOpportunities(client, parsed);
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
// Task Tools
|
|
149
|
-
case 'heyseo_create_task': {
|
|
150
|
-
const parsed = createTaskSchema.parse(args);
|
|
151
|
-
result = await executeCreateTask(client, parsed);
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
case 'heyseo_list_tasks': {
|
|
155
|
-
const parsed = listTasksSchema.parse(args);
|
|
156
|
-
result = await executeListTasks(client, parsed);
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
case 'heyseo_get_task': {
|
|
160
|
-
const parsed = getTaskSchema.parse(args);
|
|
161
|
-
result = await executeGetTask(client, parsed);
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case 'heyseo_update_task': {
|
|
165
|
-
const parsed = updateTaskSchema.parse(args);
|
|
166
|
-
result = await executeUpdateTask(client, parsed);
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case 'heyseo_delete_task': {
|
|
170
|
-
const parsed = deleteTaskSchema.parse(args);
|
|
171
|
-
result = await executeDeleteTask(client, parsed);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
case 'heyseo_bulk_create_tasks': {
|
|
175
|
-
const parsed = bulkCreateTasksSchema.parse(args);
|
|
176
|
-
result = await executeBulkCreateTasks(client, parsed);
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
case 'heyseo_bulk_update_tasks': {
|
|
180
|
-
const parsed = bulkUpdateTasksSchema.parse(args);
|
|
181
|
-
result = await executeBulkUpdateTasks(client, parsed);
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
default:
|
|
185
|
-
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
content: [
|
|
189
|
-
{
|
|
190
|
-
type: 'text',
|
|
191
|
-
text: result,
|
|
192
|
-
},
|
|
193
|
-
],
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
if (error instanceof McpError) {
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
201
|
-
return {
|
|
202
|
-
content: [
|
|
203
|
-
{
|
|
204
|
-
type: 'text',
|
|
205
|
-
text: JSON.stringify({ success: false, error: errorMessage }),
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
isError: true,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
// List available resources
|
|
213
|
-
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
214
|
-
try {
|
|
215
|
-
const client = this.initClient();
|
|
216
|
-
const resources = await listResources(client);
|
|
217
|
-
return { resources };
|
|
218
|
-
}
|
|
219
|
-
catch {
|
|
220
|
-
// Return resource templates if we can't fetch actual resources
|
|
221
|
-
return {
|
|
222
|
-
resources: resourceTemplates.map((t) => ({
|
|
223
|
-
uri: t.uriTemplate,
|
|
224
|
-
name: t.name,
|
|
225
|
-
description: t.description,
|
|
226
|
-
mimeType: t.mimeType,
|
|
227
|
-
})),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
// Read resource content
|
|
232
|
-
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
233
|
-
const { uri } = request.params;
|
|
234
|
-
const client = this.initClient();
|
|
235
|
-
try {
|
|
236
|
-
const { content, mimeType } = await fetchResource(client, uri);
|
|
237
|
-
return {
|
|
238
|
-
contents: [
|
|
239
|
-
{
|
|
240
|
-
uri,
|
|
241
|
-
mimeType,
|
|
242
|
-
text: content,
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
catch (error) {
|
|
248
|
-
throw new McpError(ErrorCode.InvalidRequest, error instanceof Error ? error.message : 'Failed to read resource');
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
// List available prompts
|
|
252
|
-
this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
253
|
-
return {
|
|
254
|
-
prompts: promptTemplates.map((p) => ({
|
|
255
|
-
name: p.name,
|
|
256
|
-
description: p.description,
|
|
257
|
-
arguments: p.arguments,
|
|
258
|
-
})),
|
|
259
|
-
};
|
|
260
|
-
});
|
|
261
|
-
// Get prompt content
|
|
262
|
-
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
263
|
-
const { name, arguments: args } = request.params;
|
|
264
|
-
const template = promptTemplates.find((p) => p.name === name);
|
|
265
|
-
if (!template) {
|
|
266
|
-
throw new McpError(ErrorCode.InvalidRequest, `Unknown prompt: ${name}`);
|
|
267
|
-
}
|
|
268
|
-
// Validate required arguments
|
|
269
|
-
for (const arg of template.arguments) {
|
|
270
|
-
if (arg.required && (!args || !args[arg.name])) {
|
|
271
|
-
throw new McpError(ErrorCode.InvalidParams, `Missing required argument: ${arg.name}`);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const messages = generatePromptMessages(name, args || {});
|
|
275
|
-
return {
|
|
276
|
-
description: template.description,
|
|
277
|
-
messages,
|
|
278
|
-
};
|
|
279
|
-
});
|
|
28
|
+
let selectedSiteId = null;
|
|
29
|
+
let apiClient = null;
|
|
30
|
+
function getClient() {
|
|
31
|
+
if (!apiClient) {
|
|
32
|
+
apiClient = createApiClient();
|
|
280
33
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
34
|
+
return apiClient;
|
|
35
|
+
}
|
|
36
|
+
const server = Sentry.wrapMcpServerWithSentry(new McpServer({
|
|
37
|
+
name: SERVER_NAME,
|
|
38
|
+
version: SERVER_VERSION,
|
|
39
|
+
}), {
|
|
40
|
+
recordInputs: true,
|
|
41
|
+
recordOutputs: true,
|
|
42
|
+
});
|
|
43
|
+
// ──────────────────────────────────────────
|
|
44
|
+
// Site Tools
|
|
45
|
+
// ──────────────────────────────────────────
|
|
46
|
+
server.registerTool('heyseo_list_sites', {
|
|
47
|
+
title: 'List Sites',
|
|
48
|
+
description: 'List all sites connected to your HeySeo account',
|
|
49
|
+
}, async () => {
|
|
50
|
+
const client = getClient();
|
|
51
|
+
const result = await executeListSites(client);
|
|
52
|
+
return { content: [{ type: 'text', text: result }] };
|
|
53
|
+
});
|
|
54
|
+
server.registerTool('heyseo_select_site', {
|
|
55
|
+
title: 'Select Site',
|
|
56
|
+
description: 'Select a site to work with',
|
|
57
|
+
inputSchema: selectSiteSchema.shape,
|
|
58
|
+
}, async ({ siteId }) => {
|
|
59
|
+
const client = getClient();
|
|
60
|
+
const result = await executeSelectSite(client, siteId);
|
|
61
|
+
if (JSON.parse(result).success) {
|
|
62
|
+
selectedSiteId = siteId;
|
|
304
63
|
}
|
|
64
|
+
return { content: [{ type: 'text', text: result }] };
|
|
65
|
+
});
|
|
66
|
+
server.registerTool('heyseo_get_current_site', {
|
|
67
|
+
title: 'Get Current Site',
|
|
68
|
+
description: 'Get the currently selected site',
|
|
69
|
+
}, async () => {
|
|
70
|
+
const client = getClient();
|
|
71
|
+
const result = await executeGetCurrentSite(client, selectedSiteId || undefined);
|
|
72
|
+
return { content: [{ type: 'text', text: result }] };
|
|
73
|
+
});
|
|
74
|
+
// ──────────────────────────────────────────
|
|
75
|
+
// GSC Tools
|
|
76
|
+
// ──────────────────────────────────────────
|
|
77
|
+
server.registerTool('heyseo_query_gsc', {
|
|
78
|
+
title: 'Query Google Search Console',
|
|
79
|
+
description: 'Query Google Search Console data with custom filters',
|
|
80
|
+
inputSchema: queryGSCSchema.shape,
|
|
81
|
+
}, async (args) => {
|
|
82
|
+
const client = getClient();
|
|
83
|
+
const result = await executeQueryGSC(client, args);
|
|
84
|
+
return { content: [{ type: 'text', text: result }] };
|
|
85
|
+
});
|
|
86
|
+
server.registerTool('heyseo_top_keywords', {
|
|
87
|
+
title: 'Top Keywords',
|
|
88
|
+
description: 'Get top performing keywords',
|
|
89
|
+
inputSchema: topKeywordsSchema.shape,
|
|
90
|
+
}, async (args) => {
|
|
91
|
+
const client = getClient();
|
|
92
|
+
const result = await executeTopKeywords(client, args);
|
|
93
|
+
return { content: [{ type: 'text', text: result }] };
|
|
94
|
+
});
|
|
95
|
+
server.registerTool('heyseo_top_pages', {
|
|
96
|
+
title: 'Top Pages',
|
|
97
|
+
description: 'Get top performing pages',
|
|
98
|
+
inputSchema: topPagesSchema.shape,
|
|
99
|
+
}, async (args) => {
|
|
100
|
+
const client = getClient();
|
|
101
|
+
const result = await executeTopPages(client, args);
|
|
102
|
+
return { content: [{ type: 'text', text: result }] };
|
|
103
|
+
});
|
|
104
|
+
server.registerTool('heyseo_ranking_history', {
|
|
105
|
+
title: 'Ranking History',
|
|
106
|
+
description: 'Get keyword ranking history over time',
|
|
107
|
+
inputSchema: rankingHistorySchema.shape,
|
|
108
|
+
}, async (args) => {
|
|
109
|
+
const client = getClient();
|
|
110
|
+
const result = await executeRankingHistory(client, args);
|
|
111
|
+
return { content: [{ type: 'text', text: result }] };
|
|
112
|
+
});
|
|
113
|
+
// ──────────────────────────────────────────
|
|
114
|
+
// GA4 Tools
|
|
115
|
+
// ──────────────────────────────────────────
|
|
116
|
+
server.registerTool('heyseo_query_ga4', {
|
|
117
|
+
title: 'Query GA4',
|
|
118
|
+
description: 'Query Google Analytics 4 data',
|
|
119
|
+
inputSchema: queryGA4Schema.shape,
|
|
120
|
+
}, async (args) => {
|
|
121
|
+
const client = getClient();
|
|
122
|
+
const result = await executeQueryGA4(client, args);
|
|
123
|
+
return { content: [{ type: 'text', text: result }] };
|
|
124
|
+
});
|
|
125
|
+
server.registerTool('heyseo_landing_pages', {
|
|
126
|
+
title: 'Landing Pages',
|
|
127
|
+
description: 'Get landing page performance data',
|
|
128
|
+
inputSchema: landingPagesSchema.shape,
|
|
129
|
+
}, async (args) => {
|
|
130
|
+
const client = getClient();
|
|
131
|
+
const result = await executeLandingPages(client, args);
|
|
132
|
+
return { content: [{ type: 'text', text: result }] };
|
|
133
|
+
});
|
|
134
|
+
server.registerTool('heyseo_traffic_sources', {
|
|
135
|
+
title: 'Traffic Sources',
|
|
136
|
+
description: 'Get traffic source breakdown',
|
|
137
|
+
inputSchema: trafficSourcesSchema.shape,
|
|
138
|
+
}, async (args) => {
|
|
139
|
+
const client = getClient();
|
|
140
|
+
const result = await executeTrafficSources(client, args);
|
|
141
|
+
return { content: [{ type: 'text', text: result }] };
|
|
142
|
+
});
|
|
143
|
+
// ──────────────────────────────────────────
|
|
144
|
+
// PageSpeed Tools
|
|
145
|
+
// ──────────────────────────────────────────
|
|
146
|
+
server.registerTool('heyseo_pagespeed', {
|
|
147
|
+
title: 'PageSpeed Analysis',
|
|
148
|
+
description: 'Analyze page speed performance',
|
|
149
|
+
inputSchema: analyzePageSpeedSchema.shape,
|
|
150
|
+
}, async (args) => {
|
|
151
|
+
const client = getClient();
|
|
152
|
+
const result = await executeAnalyzePageSpeed(client, args);
|
|
153
|
+
return { content: [{ type: 'text', text: result }] };
|
|
154
|
+
});
|
|
155
|
+
server.registerTool('heyseo_pagespeed_bulk', {
|
|
156
|
+
title: 'Bulk PageSpeed',
|
|
157
|
+
description: 'Analyze multiple pages for speed performance',
|
|
158
|
+
inputSchema: bulkPageSpeedSchema.shape,
|
|
159
|
+
}, async (args) => {
|
|
160
|
+
const client = getClient();
|
|
161
|
+
const result = await executeBulkPageSpeed(client, args);
|
|
162
|
+
return { content: [{ type: 'text', text: result }] };
|
|
163
|
+
});
|
|
164
|
+
// ──────────────────────────────────────────
|
|
165
|
+
// Comparison Tools
|
|
166
|
+
// ──────────────────────────────────────────
|
|
167
|
+
server.registerTool('heyseo_compare_periods', {
|
|
168
|
+
title: 'Compare Periods',
|
|
169
|
+
description: 'Compare SEO performance between two time periods',
|
|
170
|
+
inputSchema: comparePeriodSchema.shape,
|
|
171
|
+
}, async (args) => {
|
|
172
|
+
const client = getClient();
|
|
173
|
+
const result = await executeComparePeriod(client, args);
|
|
174
|
+
return { content: [{ type: 'text', text: result }] };
|
|
175
|
+
});
|
|
176
|
+
server.registerTool('heyseo_week_over_week', {
|
|
177
|
+
title: 'Week Over Week',
|
|
178
|
+
description: 'Compare this week vs last week performance',
|
|
179
|
+
inputSchema: weekOverWeekSchema.shape,
|
|
180
|
+
}, async (args) => {
|
|
181
|
+
const client = getClient();
|
|
182
|
+
const result = await executeWeekOverWeek(client, args);
|
|
183
|
+
return { content: [{ type: 'text', text: result }] };
|
|
184
|
+
});
|
|
185
|
+
server.registerTool('heyseo_find_opportunities', {
|
|
186
|
+
title: 'Find Opportunities',
|
|
187
|
+
description: 'Find SEO opportunities based on your data',
|
|
188
|
+
inputSchema: findOpportunitiesSchema.shape,
|
|
189
|
+
}, async (args) => {
|
|
190
|
+
const client = getClient();
|
|
191
|
+
const result = await executeFindOpportunities(client, args);
|
|
192
|
+
return { content: [{ type: 'text', text: result }] };
|
|
193
|
+
});
|
|
194
|
+
// ──────────────────────────────────────────
|
|
195
|
+
// Task Tools
|
|
196
|
+
// ──────────────────────────────────────────
|
|
197
|
+
server.registerTool('heyseo_create_task', {
|
|
198
|
+
title: 'Create Task',
|
|
199
|
+
description: 'Create a new SEO task',
|
|
200
|
+
inputSchema: createTaskSchema.shape,
|
|
201
|
+
}, async (args) => {
|
|
202
|
+
const client = getClient();
|
|
203
|
+
const result = await executeCreateTask(client, args);
|
|
204
|
+
return { content: [{ type: 'text', text: result }] };
|
|
205
|
+
});
|
|
206
|
+
server.registerTool('heyseo_list_tasks', {
|
|
207
|
+
title: 'List Tasks',
|
|
208
|
+
description: 'List all SEO tasks',
|
|
209
|
+
inputSchema: listTasksSchema.shape,
|
|
210
|
+
}, async (args) => {
|
|
211
|
+
const client = getClient();
|
|
212
|
+
const result = await executeListTasks(client, args);
|
|
213
|
+
return { content: [{ type: 'text', text: result }] };
|
|
214
|
+
});
|
|
215
|
+
server.registerTool('heyseo_get_task', {
|
|
216
|
+
title: 'Get Task',
|
|
217
|
+
description: 'Get a specific task by ID',
|
|
218
|
+
inputSchema: getTaskSchema.shape,
|
|
219
|
+
}, async (args) => {
|
|
220
|
+
const client = getClient();
|
|
221
|
+
const result = await executeGetTask(client, args);
|
|
222
|
+
return { content: [{ type: 'text', text: result }] };
|
|
223
|
+
});
|
|
224
|
+
server.registerTool('heyseo_update_task', {
|
|
225
|
+
title: 'Update Task',
|
|
226
|
+
description: 'Update an existing task',
|
|
227
|
+
inputSchema: updateTaskSchema.shape,
|
|
228
|
+
}, async (args) => {
|
|
229
|
+
const client = getClient();
|
|
230
|
+
const result = await executeUpdateTask(client, args);
|
|
231
|
+
return { content: [{ type: 'text', text: result }] };
|
|
232
|
+
});
|
|
233
|
+
server.registerTool('heyseo_delete_task', {
|
|
234
|
+
title: 'Delete Task',
|
|
235
|
+
description: 'Delete a task',
|
|
236
|
+
inputSchema: deleteTaskSchema.shape,
|
|
237
|
+
}, async (args) => {
|
|
238
|
+
const client = getClient();
|
|
239
|
+
const result = await executeDeleteTask(client, args);
|
|
240
|
+
return { content: [{ type: 'text', text: result }] };
|
|
241
|
+
});
|
|
242
|
+
server.registerTool('heyseo_bulk_create_tasks', {
|
|
243
|
+
title: 'Bulk Create Tasks',
|
|
244
|
+
description: 'Create multiple tasks at once',
|
|
245
|
+
inputSchema: bulkCreateTasksSchema.shape,
|
|
246
|
+
}, async (args) => {
|
|
247
|
+
const client = getClient();
|
|
248
|
+
const result = await executeBulkCreateTasks(client, args);
|
|
249
|
+
return { content: [{ type: 'text', text: result }] };
|
|
250
|
+
});
|
|
251
|
+
server.registerTool('heyseo_bulk_update_tasks', {
|
|
252
|
+
title: 'Bulk Update Tasks',
|
|
253
|
+
description: 'Update multiple tasks at once',
|
|
254
|
+
inputSchema: bulkUpdateTasksSchema.shape,
|
|
255
|
+
}, async (args) => {
|
|
256
|
+
const client = getClient();
|
|
257
|
+
const result = await executeBulkUpdateTasks(client, args);
|
|
258
|
+
return { content: [{ type: 'text', text: result }] };
|
|
259
|
+
});
|
|
260
|
+
// ──────────────────────────────────────────
|
|
261
|
+
// Reports Tools
|
|
262
|
+
// ──────────────────────────────────────────
|
|
263
|
+
server.registerTool('heyseo_list_reports', {
|
|
264
|
+
title: 'List Reports',
|
|
265
|
+
description: 'List AI-generated SEO reports',
|
|
266
|
+
inputSchema: listReportsSchema.shape,
|
|
267
|
+
}, async (args) => {
|
|
268
|
+
const client = getClient();
|
|
269
|
+
const result = await executeListReports(client, args);
|
|
270
|
+
return { content: [{ type: 'text', text: result }] };
|
|
271
|
+
});
|
|
272
|
+
server.registerTool('heyseo_get_report', {
|
|
273
|
+
title: 'Get Report',
|
|
274
|
+
description: 'Get full details of a specific SEO report',
|
|
275
|
+
inputSchema: getReportSchema.shape,
|
|
276
|
+
}, async (args) => {
|
|
277
|
+
const client = getClient();
|
|
278
|
+
const result = await executeGetReport(client, args);
|
|
279
|
+
return { content: [{ type: 'text', text: result }] };
|
|
280
|
+
});
|
|
281
|
+
// ──────────────────────────────────────────
|
|
282
|
+
// Indexing Tools
|
|
283
|
+
// ──────────────────────────────────────────
|
|
284
|
+
server.registerTool('heyseo_indexing_status', {
|
|
285
|
+
title: 'Indexing Status',
|
|
286
|
+
description: 'Get indexing health summary for a site',
|
|
287
|
+
inputSchema: indexingStatusSchema.shape,
|
|
288
|
+
}, async (args) => {
|
|
289
|
+
const client = getClient();
|
|
290
|
+
const result = await executeIndexingStatus(client, args);
|
|
291
|
+
return { content: [{ type: 'text', text: result }] };
|
|
292
|
+
});
|
|
293
|
+
server.registerTool('heyseo_indexing_pages', {
|
|
294
|
+
title: 'Indexing Pages',
|
|
295
|
+
description: 'List pages with their indexing status',
|
|
296
|
+
inputSchema: indexingPagesSchema.shape,
|
|
297
|
+
}, async (args) => {
|
|
298
|
+
const client = getClient();
|
|
299
|
+
const result = await executeIndexingPages(client, args);
|
|
300
|
+
return { content: [{ type: 'text', text: result }] };
|
|
301
|
+
});
|
|
302
|
+
server.registerTool('heyseo_submit_for_indexing', {
|
|
303
|
+
title: 'Submit for Indexing',
|
|
304
|
+
description: 'Submit a page to Google Indexing API for faster indexing',
|
|
305
|
+
inputSchema: submitForIndexingSchema.shape,
|
|
306
|
+
}, async (args) => {
|
|
307
|
+
const client = getClient();
|
|
308
|
+
const result = await executeSubmitForIndexing(client, args);
|
|
309
|
+
return { content: [{ type: 'text', text: result }] };
|
|
310
|
+
});
|
|
311
|
+
// ──────────────────────────────────────────
|
|
312
|
+
// Memory Tools
|
|
313
|
+
// ──────────────────────────────────────────
|
|
314
|
+
server.registerTool('heyseo_get_memory', {
|
|
315
|
+
title: 'Get SEO Memory',
|
|
316
|
+
description: 'Get the full SEO memory context for a site',
|
|
317
|
+
inputSchema: getMemorySchema.shape,
|
|
318
|
+
}, async (args) => {
|
|
319
|
+
const client = getClient();
|
|
320
|
+
const result = await executeGetMemory(client, args);
|
|
321
|
+
return { content: [{ type: 'text', text: result }] };
|
|
322
|
+
});
|
|
323
|
+
server.registerTool('heyseo_update_strategy', {
|
|
324
|
+
title: 'Update Strategy',
|
|
325
|
+
description: 'Update SEO strategy, create goals, or update goal progress',
|
|
326
|
+
inputSchema: updateStrategySchema.shape,
|
|
327
|
+
}, async (args) => {
|
|
328
|
+
const client = getClient();
|
|
329
|
+
const result = await executeUpdateStrategy(client, args);
|
|
330
|
+
return { content: [{ type: 'text', text: result }] };
|
|
331
|
+
});
|
|
332
|
+
server.registerTool('heyseo_record_action', {
|
|
333
|
+
title: 'Record Action',
|
|
334
|
+
description: 'Record an SEO action taken on the site',
|
|
335
|
+
inputSchema: recordActionSchema.shape,
|
|
336
|
+
}, async (args) => {
|
|
337
|
+
const client = getClient();
|
|
338
|
+
const result = await executeRecordAction(client, args);
|
|
339
|
+
return { content: [{ type: 'text', text: result }] };
|
|
340
|
+
});
|
|
341
|
+
server.registerTool('heyseo_add_learning', {
|
|
342
|
+
title: 'Add Learning',
|
|
343
|
+
description: 'Add a key fact or success pattern to site memory',
|
|
344
|
+
inputSchema: addLearningSchema.shape,
|
|
345
|
+
}, async (args) => {
|
|
346
|
+
const client = getClient();
|
|
347
|
+
const result = await executeAddLearning(client, args);
|
|
348
|
+
return { content: [{ type: 'text', text: result }] };
|
|
349
|
+
});
|
|
350
|
+
// ──────────────────────────────────────────
|
|
351
|
+
// Insights Tools
|
|
352
|
+
// ──────────────────────────────────────────
|
|
353
|
+
server.registerTool('heyseo_get_insights', {
|
|
354
|
+
title: 'Get Insights',
|
|
355
|
+
description: 'Get AI-generated insights for a site',
|
|
356
|
+
inputSchema: getInsightsSchema.shape,
|
|
357
|
+
}, async (args) => {
|
|
358
|
+
const client = getClient();
|
|
359
|
+
const result = await executeGetInsights(client, args);
|
|
360
|
+
return { content: [{ type: 'text', text: result }] };
|
|
361
|
+
});
|
|
362
|
+
// ──────────────────────────────────────────
|
|
363
|
+
// On-Page Audit Tools
|
|
364
|
+
// ──────────────────────────────────────────
|
|
365
|
+
server.registerTool('heyseo_onpage_audit', {
|
|
366
|
+
title: 'On-Page Audit',
|
|
367
|
+
description: 'Run a full on-page SEO audit on a URL',
|
|
368
|
+
inputSchema: onpageAuditSchema.shape,
|
|
369
|
+
}, async (args) => {
|
|
370
|
+
const client = getClient();
|
|
371
|
+
const result = await executeOnpageAudit(client, args);
|
|
372
|
+
return { content: [{ type: 'text', text: result }] };
|
|
373
|
+
});
|
|
374
|
+
// ──────────────────────────────────────────
|
|
375
|
+
// SERP Tools
|
|
376
|
+
// ──────────────────────────────────────────
|
|
377
|
+
server.registerTool('heyseo_serp_search', {
|
|
378
|
+
title: 'SERP Search',
|
|
379
|
+
description: 'Search Google SERP for a keyword',
|
|
380
|
+
inputSchema: serpSearchSchema.shape,
|
|
381
|
+
}, async (args) => {
|
|
382
|
+
const client = getClient();
|
|
383
|
+
const result = await executeSerpSearch(client, args);
|
|
384
|
+
return { content: [{ type: 'text', text: result }] };
|
|
385
|
+
});
|
|
386
|
+
// ──────────────────────────────────────────
|
|
387
|
+
// Sitemaps Tools
|
|
388
|
+
// ──────────────────────────────────────────
|
|
389
|
+
server.registerTool('heyseo_list_sitemaps', {
|
|
390
|
+
title: 'List Sitemaps',
|
|
391
|
+
description: 'List sitemaps registered in Google Search Console',
|
|
392
|
+
inputSchema: listSitemapsSchema.shape,
|
|
393
|
+
}, async (args) => {
|
|
394
|
+
const client = getClient();
|
|
395
|
+
const result = await executeListSitemaps(client, args);
|
|
396
|
+
return { content: [{ type: 'text', text: result }] };
|
|
397
|
+
});
|
|
398
|
+
// ──────────────────────────────────────────
|
|
399
|
+
// Site Tools (extended)
|
|
400
|
+
// ──────────────────────────────────────────
|
|
401
|
+
server.registerTool('heyseo_update_site', {
|
|
402
|
+
title: 'Update Site',
|
|
403
|
+
description: 'Update site settings',
|
|
404
|
+
inputSchema: updateSiteSchema.shape,
|
|
405
|
+
}, async (args) => {
|
|
406
|
+
const client = getClient();
|
|
407
|
+
const result = await executeUpdateSite(client, args);
|
|
408
|
+
return { content: [{ type: 'text', text: result }] };
|
|
409
|
+
});
|
|
410
|
+
server.registerTool('heyseo_delete_site', {
|
|
411
|
+
title: 'Delete Site',
|
|
412
|
+
description: 'Delete a site',
|
|
413
|
+
inputSchema: deleteSiteSchema.shape,
|
|
414
|
+
}, async (args) => {
|
|
415
|
+
const client = getClient();
|
|
416
|
+
const result = await executeDeleteSite(client, args);
|
|
417
|
+
return { content: [{ type: 'text', text: result }] };
|
|
418
|
+
});
|
|
419
|
+
server.registerTool('heyseo_sync_analytics', {
|
|
420
|
+
title: 'Sync Analytics',
|
|
421
|
+
description: 'Trigger analytics data sync for a site',
|
|
422
|
+
inputSchema: syncAnalyticsSchema.shape,
|
|
423
|
+
}, async (args) => {
|
|
424
|
+
const client = getClient();
|
|
425
|
+
const result = await executeSyncAnalytics(client, args);
|
|
426
|
+
return { content: [{ type: 'text', text: result }] };
|
|
427
|
+
});
|
|
428
|
+
// ──────────────────────────────────────────
|
|
429
|
+
// PageSpeed Tools (extended)
|
|
430
|
+
// ──────────────────────────────────────────
|
|
431
|
+
server.registerTool('heyseo_pagespeed_history', {
|
|
432
|
+
title: 'PageSpeed History',
|
|
433
|
+
description: 'Get PageSpeed analysis history',
|
|
434
|
+
inputSchema: pagespeedHistorySchema.shape,
|
|
435
|
+
}, async (args) => {
|
|
436
|
+
const client = getClient();
|
|
437
|
+
const result = await executePagespeedHistory(client, args);
|
|
438
|
+
return { content: [{ type: 'text', text: result }] };
|
|
439
|
+
});
|
|
440
|
+
// ──────────────────────────────────────────
|
|
441
|
+
// Task Tools (extended)
|
|
442
|
+
// ──────────────────────────────────────────
|
|
443
|
+
server.registerTool('heyseo_move_task', {
|
|
444
|
+
title: 'Move Task',
|
|
445
|
+
description: 'Move or reorder a task on the Kanban board',
|
|
446
|
+
inputSchema: moveTaskSchema.shape,
|
|
447
|
+
}, async (args) => {
|
|
448
|
+
const client = getClient();
|
|
449
|
+
const result = await executeMoveTask(client, args);
|
|
450
|
+
return { content: [{ type: 'text', text: result }] };
|
|
451
|
+
});
|
|
452
|
+
// ──────────────────────────────────────────
|
|
453
|
+
// Reports Tools (extended)
|
|
454
|
+
// ──────────────────────────────────────────
|
|
455
|
+
server.registerTool('heyseo_generate_report', {
|
|
456
|
+
title: 'Generate Report',
|
|
457
|
+
description: 'Generate a new SEO report',
|
|
458
|
+
inputSchema: generateReportSchema.shape,
|
|
459
|
+
}, async (args) => {
|
|
460
|
+
const client = getClient();
|
|
461
|
+
const result = await executeGenerateReport(client, args);
|
|
462
|
+
return { content: [{ type: 'text', text: result }] };
|
|
463
|
+
});
|
|
464
|
+
server.registerTool('heyseo_delete_report', {
|
|
465
|
+
title: 'Delete Report',
|
|
466
|
+
description: 'Delete a report',
|
|
467
|
+
inputSchema: deleteReportSchema.shape,
|
|
468
|
+
}, async (args) => {
|
|
469
|
+
const client = getClient();
|
|
470
|
+
const result = await executeDeleteReport(client, args);
|
|
471
|
+
return { content: [{ type: 'text', text: result }] };
|
|
472
|
+
});
|
|
473
|
+
server.registerTool('heyseo_report_settings', {
|
|
474
|
+
title: 'Report Settings',
|
|
475
|
+
description: 'Get report schedule settings',
|
|
476
|
+
inputSchema: reportSettingsSchema.shape,
|
|
477
|
+
}, async (args) => {
|
|
478
|
+
const client = getClient();
|
|
479
|
+
const result = await executeReportSettings(client, args);
|
|
480
|
+
return { content: [{ type: 'text', text: result }] };
|
|
481
|
+
});
|
|
482
|
+
server.registerTool('heyseo_update_report_settings', {
|
|
483
|
+
title: 'Update Report Settings',
|
|
484
|
+
description: 'Update report schedule settings',
|
|
485
|
+
inputSchema: updateReportSettingsSchema.shape,
|
|
486
|
+
}, async (args) => {
|
|
487
|
+
const client = getClient();
|
|
488
|
+
const result = await executeUpdateReportSettings(client, args);
|
|
489
|
+
return { content: [{ type: 'text', text: result }] };
|
|
490
|
+
});
|
|
491
|
+
server.registerTool('heyseo_send_test_report', {
|
|
492
|
+
title: 'Send Test Report',
|
|
493
|
+
description: 'Send a test report email',
|
|
494
|
+
inputSchema: sendTestReportSchema.shape,
|
|
495
|
+
}, async (args) => {
|
|
496
|
+
const client = getClient();
|
|
497
|
+
const result = await executeSendTestReport(client, args);
|
|
498
|
+
return { content: [{ type: 'text', text: result }] };
|
|
499
|
+
});
|
|
500
|
+
// ──────────────────────────────────────────
|
|
501
|
+
// Indexing Tools (extended)
|
|
502
|
+
// ──────────────────────────────────────────
|
|
503
|
+
server.registerTool('heyseo_indexing_check', {
|
|
504
|
+
title: 'Indexing Check',
|
|
505
|
+
description: 'Trigger an indexing check for a site',
|
|
506
|
+
inputSchema: indexingCheckSchema.shape,
|
|
507
|
+
}, async (args) => {
|
|
508
|
+
const client = getClient();
|
|
509
|
+
const result = await executeIndexingCheck(client, args);
|
|
510
|
+
return { content: [{ type: 'text', text: result }] };
|
|
511
|
+
});
|
|
512
|
+
server.registerTool('heyseo_indexing_history', {
|
|
513
|
+
title: 'Indexing History',
|
|
514
|
+
description: 'Get indexing check history',
|
|
515
|
+
inputSchema: indexingHistorySchema.shape,
|
|
516
|
+
}, async (args) => {
|
|
517
|
+
const client = getClient();
|
|
518
|
+
const result = await executeIndexingHistory(client, args);
|
|
519
|
+
return { content: [{ type: 'text', text: result }] };
|
|
520
|
+
});
|
|
521
|
+
server.registerTool('heyseo_indexing_settings', {
|
|
522
|
+
title: 'Indexing Settings',
|
|
523
|
+
description: 'Get indexing monitoring settings',
|
|
524
|
+
inputSchema: indexingSettingsSchema.shape,
|
|
525
|
+
}, async (args) => {
|
|
526
|
+
const client = getClient();
|
|
527
|
+
const result = await executeIndexingSettings(client, args);
|
|
528
|
+
return { content: [{ type: 'text', text: result }] };
|
|
529
|
+
});
|
|
530
|
+
server.registerTool('heyseo_update_indexing_settings', {
|
|
531
|
+
title: 'Update Indexing Settings',
|
|
532
|
+
description: 'Update indexing monitoring settings',
|
|
533
|
+
inputSchema: updateIndexingSettingsSchema.shape,
|
|
534
|
+
}, async (args) => {
|
|
535
|
+
const client = getClient();
|
|
536
|
+
const result = await executeUpdateIndexingSettings(client, args);
|
|
537
|
+
return { content: [{ type: 'text', text: result }] };
|
|
538
|
+
});
|
|
539
|
+
server.registerTool('heyseo_indexing_submissions', {
|
|
540
|
+
title: 'Indexing Submissions',
|
|
541
|
+
description: 'Get indexing submission history',
|
|
542
|
+
inputSchema: indexingSubmissionsSchema.shape,
|
|
543
|
+
}, async (args) => {
|
|
544
|
+
const client = getClient();
|
|
545
|
+
const result = await executeIndexingSubmissions(client, args);
|
|
546
|
+
return { content: [{ type: 'text', text: result }] };
|
|
547
|
+
});
|
|
548
|
+
server.registerTool('heyseo_remove_indexing_page', {
|
|
549
|
+
title: 'Remove Indexing Page',
|
|
550
|
+
description: 'Remove a page from indexing monitoring',
|
|
551
|
+
inputSchema: removeIndexingPageSchema.shape,
|
|
552
|
+
}, async (args) => {
|
|
553
|
+
const client = getClient();
|
|
554
|
+
const result = await executeRemoveIndexingPage(client, args);
|
|
555
|
+
return { content: [{ type: 'text', text: result }] };
|
|
556
|
+
});
|
|
557
|
+
// ──────────────────────────────────────────
|
|
558
|
+
// Memory Tools (extended)
|
|
559
|
+
// ──────────────────────────────────────────
|
|
560
|
+
server.registerTool('heyseo_delete_goal', {
|
|
561
|
+
title: 'Delete Goal',
|
|
562
|
+
description: 'Delete a goal',
|
|
563
|
+
inputSchema: deleteGoalSchema.shape,
|
|
564
|
+
}, async (args) => {
|
|
565
|
+
const client = getClient();
|
|
566
|
+
const result = await executeDeleteGoal(client, args);
|
|
567
|
+
return { content: [{ type: 'text', text: result }] };
|
|
568
|
+
});
|
|
569
|
+
server.registerTool('heyseo_memory_snapshots', {
|
|
570
|
+
title: 'Memory Snapshots',
|
|
571
|
+
description: 'Get performance snapshots',
|
|
572
|
+
inputSchema: memorySnapshotsSchema.shape,
|
|
573
|
+
}, async (args) => {
|
|
574
|
+
const client = getClient();
|
|
575
|
+
const result = await executeMemorySnapshots(client, args);
|
|
576
|
+
return { content: [{ type: 'text', text: result }] };
|
|
577
|
+
});
|
|
578
|
+
server.registerTool('heyseo_generate_snapshot', {
|
|
579
|
+
title: 'Generate Snapshot',
|
|
580
|
+
description: 'Generate a new performance snapshot',
|
|
581
|
+
inputSchema: generateSnapshotSchema.shape,
|
|
582
|
+
}, async (args) => {
|
|
583
|
+
const client = getClient();
|
|
584
|
+
const result = await executeGenerateSnapshot(client, args);
|
|
585
|
+
return { content: [{ type: 'text', text: result }] };
|
|
586
|
+
});
|
|
587
|
+
server.registerTool('heyseo_queue_action', {
|
|
588
|
+
title: 'Queue Action',
|
|
589
|
+
description: 'Queue an action for future implementation',
|
|
590
|
+
inputSchema: queueActionSchema.shape,
|
|
591
|
+
}, async (args) => {
|
|
592
|
+
const client = getClient();
|
|
593
|
+
const result = await executeQueueAction(client, args);
|
|
594
|
+
return { content: [{ type: 'text', text: result }] };
|
|
595
|
+
});
|
|
596
|
+
server.registerTool('heyseo_update_queued_action', {
|
|
597
|
+
title: 'Update Queued Action',
|
|
598
|
+
description: 'Update a queued action',
|
|
599
|
+
inputSchema: updateQueuedActionSchema.shape,
|
|
600
|
+
}, async (args) => {
|
|
601
|
+
const client = getClient();
|
|
602
|
+
const result = await executeUpdateQueuedAction(client, args);
|
|
603
|
+
return { content: [{ type: 'text', text: result }] };
|
|
604
|
+
});
|
|
605
|
+
// ──────────────────────────────────────────
|
|
606
|
+
// Insights Tools (extended)
|
|
607
|
+
// ──────────────────────────────────────────
|
|
608
|
+
server.registerTool('heyseo_generate_insights', {
|
|
609
|
+
title: 'Generate Insights',
|
|
610
|
+
description: 'Generate new AI insights',
|
|
611
|
+
inputSchema: generateInsightsSchema.shape,
|
|
612
|
+
}, async (args) => {
|
|
613
|
+
const client = getClient();
|
|
614
|
+
const result = await executeGenerateInsights(client, args);
|
|
615
|
+
return { content: [{ type: 'text', text: result }] };
|
|
616
|
+
});
|
|
617
|
+
// ──────────────────────────────────────────
|
|
618
|
+
// On-Page Tools (extended)
|
|
619
|
+
// ──────────────────────────────────────────
|
|
620
|
+
server.registerTool('heyseo_onpage_history', {
|
|
621
|
+
title: 'On-Page History',
|
|
622
|
+
description: 'Get on-page audit history',
|
|
623
|
+
inputSchema: onpageHistorySchema.shape,
|
|
624
|
+
}, async (args) => {
|
|
625
|
+
const client = getClient();
|
|
626
|
+
const result = await executeOnpageHistory(client, args);
|
|
627
|
+
return { content: [{ type: 'text', text: result }] };
|
|
628
|
+
});
|
|
629
|
+
// ──────────────────────────────────────────
|
|
630
|
+
// SERP Tools (extended)
|
|
631
|
+
// ──────────────────────────────────────────
|
|
632
|
+
server.registerTool('heyseo_serp_history', {
|
|
633
|
+
title: 'SERP History',
|
|
634
|
+
description: 'Get SERP search history',
|
|
635
|
+
inputSchema: serpHistorySchema.shape,
|
|
636
|
+
}, async (args) => {
|
|
637
|
+
const client = getClient();
|
|
638
|
+
const result = await executeSerpHistory(client, args);
|
|
639
|
+
return { content: [{ type: 'text', text: result }] };
|
|
640
|
+
});
|
|
641
|
+
server.registerTool('heyseo_serp_batch', {
|
|
642
|
+
title: 'SERP Batch',
|
|
643
|
+
description: 'Batch SERP preview for multiple keywords',
|
|
644
|
+
inputSchema: serpBatchSchema.shape,
|
|
645
|
+
}, async (args) => {
|
|
646
|
+
const client = getClient();
|
|
647
|
+
const result = await executeSerpBatch(client, args);
|
|
648
|
+
return { content: [{ type: 'text', text: result }] };
|
|
649
|
+
});
|
|
650
|
+
// ──────────────────────────────────────────
|
|
651
|
+
// Sitemaps Tools (extended)
|
|
652
|
+
// ──────────────────────────────────────────
|
|
653
|
+
server.registerTool('heyseo_submit_sitemap', {
|
|
654
|
+
title: 'Submit Sitemap',
|
|
655
|
+
description: 'Submit a sitemap to GSC',
|
|
656
|
+
inputSchema: submitSitemapSchema.shape,
|
|
657
|
+
}, async (args) => {
|
|
658
|
+
const client = getClient();
|
|
659
|
+
const result = await executeSubmitSitemap(client, args);
|
|
660
|
+
return { content: [{ type: 'text', text: result }] };
|
|
661
|
+
});
|
|
662
|
+
server.registerTool('heyseo_delete_sitemap', {
|
|
663
|
+
title: 'Delete Sitemap',
|
|
664
|
+
description: 'Delete a sitemap from GSC',
|
|
665
|
+
inputSchema: deleteSitemapSchema.shape,
|
|
666
|
+
}, async (args) => {
|
|
667
|
+
const client = getClient();
|
|
668
|
+
const result = await executeDeleteSitemap(client, args);
|
|
669
|
+
return { content: [{ type: 'text', text: result }] };
|
|
670
|
+
});
|
|
671
|
+
// ──────────────────────────────────────────
|
|
672
|
+
// Knowledge Tools
|
|
673
|
+
// ──────────────────────────────────────────
|
|
674
|
+
server.registerTool('heyseo_get_knowledge', {
|
|
675
|
+
title: 'Get Knowledge',
|
|
676
|
+
description: 'Get AI knowledge base for a site',
|
|
677
|
+
inputSchema: getKnowledgeSchema.shape,
|
|
678
|
+
}, async (args) => {
|
|
679
|
+
const client = getClient();
|
|
680
|
+
const result = await executeGetKnowledge(client, args);
|
|
681
|
+
return { content: [{ type: 'text', text: result }] };
|
|
682
|
+
});
|
|
683
|
+
server.registerTool('heyseo_update_knowledge', {
|
|
684
|
+
title: 'Update Knowledge',
|
|
685
|
+
description: 'Update AI knowledge base',
|
|
686
|
+
inputSchema: updateKnowledgeSchema.shape,
|
|
687
|
+
}, async (args) => {
|
|
688
|
+
const client = getClient();
|
|
689
|
+
const result = await executeUpdateKnowledge(client, args);
|
|
690
|
+
return { content: [{ type: 'text', text: result }] };
|
|
691
|
+
});
|
|
692
|
+
// ──────────────────────────────────────────
|
|
693
|
+
// Notification Tools
|
|
694
|
+
// ──────────────────────────────────────────
|
|
695
|
+
server.registerTool('heyseo_notification_settings', {
|
|
696
|
+
title: 'Notification Settings',
|
|
697
|
+
description: 'Get notification settings',
|
|
698
|
+
}, async () => {
|
|
699
|
+
const client = getClient();
|
|
700
|
+
const result = await executeNotificationSettings(client, {});
|
|
701
|
+
return { content: [{ type: 'text', text: result }] };
|
|
702
|
+
});
|
|
703
|
+
server.registerTool('heyseo_update_notification_settings', {
|
|
704
|
+
title: 'Update Notification Settings',
|
|
705
|
+
description: 'Update notification settings',
|
|
706
|
+
inputSchema: updateNotificationSettingsSchema.shape,
|
|
707
|
+
}, async (args) => {
|
|
708
|
+
const client = getClient();
|
|
709
|
+
const result = await executeUpdateNotificationSettings(client, args);
|
|
710
|
+
return { content: [{ type: 'text', text: result }] };
|
|
711
|
+
});
|
|
712
|
+
// ──────────────────────────────────────────
|
|
713
|
+
// DataForSEO Tools
|
|
714
|
+
// ──────────────────────────────────────────
|
|
715
|
+
server.registerTool('heyseo_keyword_volume', {
|
|
716
|
+
title: 'Keyword Volume',
|
|
717
|
+
description: 'Get keyword search volume data',
|
|
718
|
+
inputSchema: keywordVolumeSchema.shape,
|
|
719
|
+
}, async (args) => {
|
|
720
|
+
const client = getClient();
|
|
721
|
+
const result = await executeKeywordVolume(client, args);
|
|
722
|
+
return { content: [{ type: 'text', text: result }] };
|
|
723
|
+
});
|
|
724
|
+
// ──────────────────────────────────────────
|
|
725
|
+
// Chat Tools
|
|
726
|
+
// ──────────────────────────────────────────
|
|
727
|
+
server.registerTool('heyseo_chat', {
|
|
728
|
+
title: 'Chat',
|
|
729
|
+
description: 'Send a message to the AI assistant about your SEO data',
|
|
730
|
+
inputSchema: chatSchema.shape,
|
|
731
|
+
}, async (args) => {
|
|
732
|
+
const client = getClient();
|
|
733
|
+
const result = await executeChat(client, args);
|
|
734
|
+
return { content: [{ type: 'text', text: result }] };
|
|
735
|
+
});
|
|
736
|
+
// ──────────────────────────────────────────
|
|
737
|
+
// Conversation Tools
|
|
738
|
+
// ──────────────────────────────────────────
|
|
739
|
+
server.registerTool('heyseo_list_conversations', {
|
|
740
|
+
title: 'List Conversations',
|
|
741
|
+
description: 'List AI chat conversations',
|
|
742
|
+
inputSchema: listConversationsSchema.shape,
|
|
743
|
+
}, async (args) => {
|
|
744
|
+
const client = getClient();
|
|
745
|
+
const result = await executeListConversations(client, args);
|
|
746
|
+
return { content: [{ type: 'text', text: result }] };
|
|
747
|
+
});
|
|
748
|
+
server.registerTool('heyseo_get_conversation', {
|
|
749
|
+
title: 'Get Conversation',
|
|
750
|
+
description: 'Get a conversation with messages',
|
|
751
|
+
inputSchema: getConversationSchema.shape,
|
|
752
|
+
}, async (args) => {
|
|
753
|
+
const client = getClient();
|
|
754
|
+
const result = await executeGetConversation(client, args);
|
|
755
|
+
return { content: [{ type: 'text', text: result }] };
|
|
756
|
+
});
|
|
757
|
+
server.registerTool('heyseo_create_conversation', {
|
|
758
|
+
title: 'Create Conversation',
|
|
759
|
+
description: 'Create a new conversation',
|
|
760
|
+
inputSchema: createConversationSchema.shape,
|
|
761
|
+
}, async (args) => {
|
|
762
|
+
const client = getClient();
|
|
763
|
+
const result = await executeCreateConversation(client, args);
|
|
764
|
+
return { content: [{ type: 'text', text: result }] };
|
|
765
|
+
});
|
|
766
|
+
server.registerTool('heyseo_delete_conversation', {
|
|
767
|
+
title: 'Delete Conversation',
|
|
768
|
+
description: 'Delete a conversation',
|
|
769
|
+
inputSchema: deleteConversationSchema.shape,
|
|
770
|
+
}, async (args) => {
|
|
771
|
+
const client = getClient();
|
|
772
|
+
const result = await executeDeleteConversation(client, args);
|
|
773
|
+
return { content: [{ type: 'text', text: result }] };
|
|
774
|
+
});
|
|
775
|
+
// ──────────────────────────────────────────
|
|
776
|
+
// Resources
|
|
777
|
+
// ──────────────────────────────────────────
|
|
778
|
+
server.registerResource('site-list', 'heyseo://sites', {
|
|
779
|
+
title: 'Site List',
|
|
780
|
+
description: 'List of all connected sites',
|
|
781
|
+
mimeType: 'application/json',
|
|
782
|
+
}, async () => {
|
|
783
|
+
const client = getClient();
|
|
784
|
+
const resources = await listResources(client);
|
|
785
|
+
return {
|
|
786
|
+
contents: [
|
|
787
|
+
{
|
|
788
|
+
uri: 'heyseo://sites',
|
|
789
|
+
mimeType: 'application/json',
|
|
790
|
+
text: JSON.stringify(resources),
|
|
791
|
+
},
|
|
792
|
+
],
|
|
793
|
+
};
|
|
794
|
+
});
|
|
795
|
+
// ──────────────────────────────────────────
|
|
796
|
+
// Prompts
|
|
797
|
+
// ──────────────────────────────────────────
|
|
798
|
+
server.registerPrompt('generate-report', {
|
|
799
|
+
title: 'Generate SEO Report',
|
|
800
|
+
description: 'Generate a comprehensive SEO report',
|
|
801
|
+
argsSchema: {
|
|
802
|
+
period: z.enum(['7d', '30d', '90d']),
|
|
803
|
+
},
|
|
804
|
+
}, async (args) => {
|
|
805
|
+
const messages = generatePromptMessages('generate-report', { period: args.period || '30d' });
|
|
806
|
+
return {
|
|
807
|
+
messages: messages.map(m => ({
|
|
808
|
+
role: m.role,
|
|
809
|
+
content: {
|
|
810
|
+
type: 'text',
|
|
811
|
+
text: m.content,
|
|
812
|
+
},
|
|
813
|
+
})),
|
|
814
|
+
};
|
|
815
|
+
});
|
|
816
|
+
server.registerPrompt('indexing-audit', {
|
|
817
|
+
title: 'Indexing Audit',
|
|
818
|
+
description: 'Analyze indexing health and recommend fixes',
|
|
819
|
+
argsSchema: {
|
|
820
|
+
siteId: z.string(),
|
|
821
|
+
},
|
|
822
|
+
}, async (args) => {
|
|
823
|
+
const messages = generatePromptMessages('indexing_audit', { siteId: args.siteId });
|
|
824
|
+
return {
|
|
825
|
+
messages: messages.map(m => ({
|
|
826
|
+
role: m.role,
|
|
827
|
+
content: {
|
|
828
|
+
type: 'text',
|
|
829
|
+
text: m.content,
|
|
830
|
+
},
|
|
831
|
+
})),
|
|
832
|
+
};
|
|
833
|
+
});
|
|
834
|
+
server.registerPrompt('strategy-review', {
|
|
835
|
+
title: 'Strategy Review',
|
|
836
|
+
description: 'Review and update SEO strategy based on memory',
|
|
837
|
+
argsSchema: {
|
|
838
|
+
siteId: z.string(),
|
|
839
|
+
},
|
|
840
|
+
}, async (args) => {
|
|
841
|
+
const messages = generatePromptMessages('strategy_review', { siteId: args.siteId });
|
|
842
|
+
return {
|
|
843
|
+
messages: messages.map(m => ({
|
|
844
|
+
role: m.role,
|
|
845
|
+
content: {
|
|
846
|
+
type: 'text',
|
|
847
|
+
text: m.content,
|
|
848
|
+
},
|
|
849
|
+
})),
|
|
850
|
+
};
|
|
851
|
+
});
|
|
852
|
+
server.registerPrompt('insights-briefing', {
|
|
853
|
+
title: 'Insights Briefing',
|
|
854
|
+
description: 'Summarize recent insights and suggest actions',
|
|
855
|
+
argsSchema: {
|
|
856
|
+
siteId: z.string(),
|
|
857
|
+
},
|
|
858
|
+
}, async (args) => {
|
|
859
|
+
const messages = generatePromptMessages('insights_briefing', { siteId: args.siteId });
|
|
860
|
+
return {
|
|
861
|
+
messages: messages.map(m => ({
|
|
862
|
+
role: m.role,
|
|
863
|
+
content: {
|
|
864
|
+
type: 'text',
|
|
865
|
+
text: m.content,
|
|
866
|
+
},
|
|
867
|
+
})),
|
|
868
|
+
};
|
|
869
|
+
});
|
|
870
|
+
// ──────────────────────────────────────────
|
|
871
|
+
// Error Handling & Startup
|
|
872
|
+
// ──────────────────────────────────────────
|
|
873
|
+
process.on('uncaughtException', (error) => {
|
|
874
|
+
Sentry.captureException(error);
|
|
875
|
+
process.exit(1);
|
|
876
|
+
});
|
|
877
|
+
process.on('unhandledRejection', (reason) => {
|
|
878
|
+
Sentry.captureException(reason);
|
|
879
|
+
process.exit(1);
|
|
880
|
+
});
|
|
881
|
+
async function main() {
|
|
882
|
+
const transport = new StdioServerTransport();
|
|
883
|
+
await server.connect(transport);
|
|
884
|
+
console.error(`HeySeo MCP Server v${SERVER_VERSION} running on stdio`);
|
|
305
885
|
}
|
|
306
|
-
|
|
307
|
-
const server = new HeySeoMCPServer();
|
|
308
|
-
server.run().catch((error) => {
|
|
886
|
+
main().catch((error) => {
|
|
309
887
|
console.error('Failed to start HeySeo MCP Server:', error);
|
|
888
|
+
Sentry.captureException(error);
|
|
310
889
|
process.exit(1);
|
|
311
890
|
});
|
|
312
891
|
//# sourceMappingURL=index.js.map
|