@heyseo/mcp-server 0.1.2 → 0.2.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 +119 -24
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +38 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/tools/gsc.d.ts +52 -0
- package/dist/tools/gsc.d.ts.map +1 -1
- package/dist/tools/gsc.js +143 -0
- package/dist/tools/gsc.js.map +1 -1
- package/dist/tools/index.d.ts +187 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +16 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/site.d.ts +42 -0
- package/dist/tools/site.d.ts.map +1 -0
- package/dist/tools/site.js +167 -0
- package/dist/tools/site.js.map +1 -0
- package/dist/tools/tasks.d.ts +180 -0
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +174 -0
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/workflows.d.ts +53 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +162 -0
- package/dist/tools/workflows.js.map +1 -0
- package/dist/utils/api-client.d.ts +16 -0
- package/dist/utils/api-client.d.ts.map +1 -1
- package/dist/utils/api-client.js +38 -1
- package/dist/utils/api-client.js.map +1 -1
- package/dist/utils/response-formatter.d.ts +68 -0
- package/dist/utils/response-formatter.d.ts.map +1 -0
- package/dist/utils/response-formatter.js +128 -0
- package/dist/utils/response-formatter.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://heyseo.app/img/logo.svg" alt="HeySeo Logo" width="200" />
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# HeySeo MCP Server
|
|
5
|
+
|
|
6
|
+
Connect your LLM to your SEO data. Query Google Search Console, Google Analytics 4, and PageSpeed Insights directly from Claude, ChatGPT, Cursor, or any MCP-compatible client.
|
|
7
|
+
</div>
|
|
4
8
|
|
|
5
9
|
## Quick Start
|
|
6
10
|
|
|
@@ -144,20 +148,59 @@ Restart Claude Desktop, Cursor, or your MCP client to load the new server.
|
|
|
144
148
|
|
|
145
149
|
## Available Tools
|
|
146
150
|
|
|
151
|
+
### Site Management
|
|
152
|
+
|
|
153
|
+
**Select a site before running SEO operations.** The MCP server requires explicit site selection to ensure data isolation and prevent accidental cross-site operations.
|
|
154
|
+
|
|
155
|
+
| Tool | Description |
|
|
156
|
+
|------|-------------|
|
|
157
|
+
| `heyseo_list_sites` | List all available sites and their connection status (GSC/GA4) |
|
|
158
|
+
| `heyseo_select_site` | Select a specific site for all subsequent operations |
|
|
159
|
+
| `heyseo_get_current_site` | Get information about the currently selected site |
|
|
160
|
+
|
|
161
|
+
### Google Search Console
|
|
162
|
+
|
|
147
163
|
| Tool | Description |
|
|
148
164
|
|------|-------------|
|
|
149
165
|
| `heyseo_query_gsc` | Query Google Search Console with custom dimensions and filters |
|
|
150
166
|
| `heyseo_top_keywords` | Get top performing keywords for a site |
|
|
151
167
|
| `heyseo_top_pages` | Get top performing pages for a site |
|
|
168
|
+
| `heyseo_ranking_history` | Track keyword position changes over time (7-90 days) |
|
|
169
|
+
|
|
170
|
+
### Google Analytics 4
|
|
171
|
+
|
|
172
|
+
| Tool | Description |
|
|
173
|
+
|------|-------------|
|
|
152
174
|
| `heyseo_query_ga4` | Query Google Analytics 4 data |
|
|
153
175
|
| `heyseo_landing_pages` | Get landing page performance with engagement metrics |
|
|
154
176
|
| `heyseo_traffic_sources` | Analyze traffic sources and channels |
|
|
177
|
+
|
|
178
|
+
### PageSpeed & Performance
|
|
179
|
+
|
|
180
|
+
| Tool | Description |
|
|
181
|
+
|------|-------------|
|
|
155
182
|
| `heyseo_pagespeed` | Run PageSpeed Insights analysis with Core Web Vitals |
|
|
156
183
|
| `heyseo_pagespeed_bulk` | Analyze multiple pages at once |
|
|
184
|
+
|
|
185
|
+
### Comparison & Opportunities
|
|
186
|
+
|
|
187
|
+
| Tool | Description |
|
|
188
|
+
|------|-------------|
|
|
157
189
|
| `heyseo_compare_periods` | Compare SEO metrics between two time periods |
|
|
158
190
|
| `heyseo_week_over_week` | Quick week-over-week comparison |
|
|
159
191
|
| `heyseo_find_opportunities` | Discover SEO optimization opportunities |
|
|
160
|
-
|
|
192
|
+
|
|
193
|
+
### Task Management
|
|
194
|
+
|
|
195
|
+
| Tool | Description |
|
|
196
|
+
|------|-------------|
|
|
197
|
+
| `heyseo_create_task` | Create a single SEO task in HeySeo Kanban |
|
|
198
|
+
| `heyseo_list_tasks` | List all tasks for a site with optional filters |
|
|
199
|
+
| `heyseo_get_task` | Get detailed information about a specific task |
|
|
200
|
+
| `heyseo_update_task` | Update task title, description, status, priority, or category |
|
|
201
|
+
| `heyseo_delete_task` | Delete a task from the Kanban board |
|
|
202
|
+
| `heyseo_bulk_create_tasks` | Create multiple tasks at once (up to 10) |
|
|
203
|
+
| `heyseo_bulk_update_tasks` | Update multiple tasks at once (up to 10) |
|
|
161
204
|
|
|
162
205
|
## Resources
|
|
163
206
|
|
|
@@ -185,11 +228,31 @@ Pre-built prompts for common SEO tasks:
|
|
|
185
228
|
| `traffic_analysis` | Traffic patterns and sources |
|
|
186
229
|
| `quick_wins` | Low-effort, high-impact opportunities |
|
|
187
230
|
| `ranking_changes` | Recent ranking changes analysis |
|
|
231
|
+
| `task_review` | Review and prioritize SEO tasks for a site |
|
|
188
232
|
|
|
189
233
|
---
|
|
190
234
|
|
|
191
235
|
## Usage Examples
|
|
192
236
|
|
|
237
|
+
### Site Selection (Start here!)
|
|
238
|
+
|
|
239
|
+
Before performing any SEO operations, you must select a site:
|
|
240
|
+
|
|
241
|
+
**List available sites:**
|
|
242
|
+
> "Show me all my connected sites"
|
|
243
|
+
|
|
244
|
+
**Select a site:**
|
|
245
|
+
> "Select the site with ID: abc123def456"
|
|
246
|
+
>
|
|
247
|
+
> Or ask Claude to list sites and select one for you
|
|
248
|
+
|
|
249
|
+
**Check current site:**
|
|
250
|
+
> "What site am I currently working with?"
|
|
251
|
+
|
|
252
|
+
### SEO Operations
|
|
253
|
+
|
|
254
|
+
Once a site is selected, you can perform SEO operations:
|
|
255
|
+
|
|
193
256
|
**Get top keywords:**
|
|
194
257
|
> "What are my top 10 keywords this month?"
|
|
195
258
|
|
|
@@ -205,6 +268,56 @@ Pre-built prompts for common SEO tasks:
|
|
|
205
268
|
**Find opportunities:**
|
|
206
269
|
> "Find quick win SEO opportunities"
|
|
207
270
|
|
|
271
|
+
**Track keyword ranking history:**
|
|
272
|
+
> "How has my ranking for 'best seo tools' changed over the last 30 days?"
|
|
273
|
+
|
|
274
|
+
**Review and prioritize tasks:**
|
|
275
|
+
> "Review my SEO tasks and help me prioritize them"
|
|
276
|
+
|
|
277
|
+
**Create tasks from audit findings:**
|
|
278
|
+
> "Create tasks for the top 5 issues you found in the audit"
|
|
279
|
+
|
|
280
|
+
**Bulk update task status:**
|
|
281
|
+
> "Mark all the technical tasks as done"
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Site Selection Workflow
|
|
286
|
+
|
|
287
|
+
The HeySeo MCP server uses explicit site selection to prevent data isolation issues:
|
|
288
|
+
|
|
289
|
+
### Typical Workflow
|
|
290
|
+
|
|
291
|
+
1. **Initialize**: User starts a conversation with Claude
|
|
292
|
+
2. **List Sites**: User asks to see available sites
|
|
293
|
+
```
|
|
294
|
+
→ heyseo_list_sites
|
|
295
|
+
← Returns all available sites with IDs and connection status
|
|
296
|
+
```
|
|
297
|
+
3. **Select Site**: User chooses which site to work with
|
|
298
|
+
```
|
|
299
|
+
→ heyseo_select_site { siteId: "your-site-id" }
|
|
300
|
+
← Confirms selection and shows site details
|
|
301
|
+
```
|
|
302
|
+
4. **Verify Selection**: (Optional) User confirms the current site
|
|
303
|
+
```
|
|
304
|
+
→ heyseo_get_current_site
|
|
305
|
+
← Returns details of the selected site
|
|
306
|
+
```
|
|
307
|
+
5. **Perform Operations**: All subsequent SEO operations use the selected site
|
|
308
|
+
```
|
|
309
|
+
→ heyseo_query_gsc { siteId: <auto-filled>, ... }
|
|
310
|
+
→ heyseo_top_keywords { siteId: <auto-filled>, ... }
|
|
311
|
+
→ etc.
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Benefits
|
|
315
|
+
|
|
316
|
+
- **Data Isolation**: Prevents accidentally querying wrong site's data
|
|
317
|
+
- **Explicit Selection**: User clearly knows which site they're working with
|
|
318
|
+
- **Session Persistence**: Selection persists across multiple operations
|
|
319
|
+
- **Safety**: Perfect for users managing multiple sites
|
|
320
|
+
|
|
208
321
|
---
|
|
209
322
|
|
|
210
323
|
## Environment Variables
|
|
@@ -212,7 +325,7 @@ Pre-built prompts for common SEO tasks:
|
|
|
212
325
|
| Variable | Required | Default | Description |
|
|
213
326
|
|----------|----------|---------|-------------|
|
|
214
327
|
| `HEYSEO_API_KEY` | Yes | - | Your HeySeo API key |
|
|
215
|
-
| `HEYSEO_API_URL` | No | `https://heyseo.app` | Custom API URL |
|
|
328
|
+
| `HEYSEO_API_URL` | No | `https://www.heyseo.app` | Custom API URL |
|
|
216
329
|
|
|
217
330
|
## Rate Limits
|
|
218
331
|
|
|
@@ -221,29 +334,11 @@ Pre-built prompts for common SEO tasks:
|
|
|
221
334
|
|
|
222
335
|
---
|
|
223
336
|
|
|
224
|
-
## Development
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Clone the repo
|
|
228
|
-
git clone https://github.com/heyseo/mcp-server
|
|
229
|
-
cd mcp-server
|
|
230
|
-
|
|
231
|
-
# Install dependencies
|
|
232
|
-
npm install
|
|
233
|
-
|
|
234
|
-
# Build
|
|
235
|
-
npm run build
|
|
236
|
-
|
|
237
|
-
# Test locally
|
|
238
|
-
HEYSEO_API_KEY=your_key node dist/index.js
|
|
239
|
-
```
|
|
240
|
-
|
|
241
337
|
## License
|
|
242
338
|
|
|
243
339
|
MIT
|
|
244
340
|
|
|
245
341
|
## Support
|
|
246
342
|
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
- Discord: [HeySeo Community](https://discord.gg/heyseo)
|
|
343
|
+
- Website: [heyseo.app](https://heyseo.app)
|
|
344
|
+
- Email: support@heyseo.app
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
10
10
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
11
11
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, ErrorCode, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
12
12
|
import { createApiClient } from './utils/api-client.js';
|
|
13
|
-
import { allTools, executeQueryGSC, executeTopKeywords, executeTopPages, executeQueryGA4, executeLandingPages, executeTrafficSources, executeAnalyzePageSpeed, executeBulkPageSpeed, executeComparePeriod, executeWeekOverWeek, executeFindOpportunities, executeCreateTask, executeListTasks, executeGetTask, executeUpdateTask, executeDeleteTask, queryGSCSchema, topKeywordsSchema, topPagesSchema, queryGA4Schema, landingPagesSchema, trafficSourcesSchema, analyzePageSpeedSchema, bulkPageSpeedSchema, comparePeriodSchema, weekOverWeekSchema, findOpportunitiesSchema, createTaskSchema, listTasksSchema, getTaskSchema, updateTaskSchema, deleteTaskSchema, } from './tools/index.js';
|
|
13
|
+
import { allTools, executeListSites, executeSelectSite, executeGetCurrentSite, selectSiteSchema, executeQueryGSC, executeTopKeywords, executeTopPages, executeRankingHistory, executeQueryGA4, executeLandingPages, executeTrafficSources, executeAnalyzePageSpeed, executeBulkPageSpeed, executeComparePeriod, executeWeekOverWeek, executeFindOpportunities, executeCreateTask, executeListTasks, executeGetTask, executeUpdateTask, executeDeleteTask, executeBulkCreateTasks, executeBulkUpdateTasks, queryGSCSchema, topKeywordsSchema, topPagesSchema, rankingHistorySchema, queryGA4Schema, landingPagesSchema, trafficSourcesSchema, analyzePageSpeedSchema, bulkPageSpeedSchema, comparePeriodSchema, weekOverWeekSchema, findOpportunitiesSchema, createTaskSchema, listTasksSchema, getTaskSchema, updateTaskSchema, deleteTaskSchema, bulkCreateTasksSchema, bulkUpdateTasksSchema, } from './tools/index.js';
|
|
14
14
|
import { listResources, fetchResource, resourceTemplates } from './resources/index.js';
|
|
15
15
|
import { promptTemplates, generatePromptMessages } from './prompts/index.js';
|
|
16
16
|
// Server info
|
|
@@ -22,6 +22,7 @@ const SERVER_VERSION = '0.1.0';
|
|
|
22
22
|
class HeySeoMCPServer {
|
|
23
23
|
server;
|
|
24
24
|
client = null;
|
|
25
|
+
selectedSiteId = null;
|
|
25
26
|
constructor() {
|
|
26
27
|
this.server = new Server({
|
|
27
28
|
name: SERVER_NAME,
|
|
@@ -62,6 +63,24 @@ class HeySeoMCPServer {
|
|
|
62
63
|
try {
|
|
63
64
|
let result;
|
|
64
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
|
+
}
|
|
65
84
|
// GSC Tools
|
|
66
85
|
case 'heyseo_query_gsc': {
|
|
67
86
|
const parsed = queryGSCSchema.parse(args);
|
|
@@ -78,6 +97,11 @@ class HeySeoMCPServer {
|
|
|
78
97
|
result = await executeTopPages(client, parsed);
|
|
79
98
|
break;
|
|
80
99
|
}
|
|
100
|
+
case 'heyseo_ranking_history': {
|
|
101
|
+
const parsed = rankingHistorySchema.parse(args);
|
|
102
|
+
result = await executeRankingHistory(client, parsed);
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
81
105
|
// GA4 Tools
|
|
82
106
|
case 'heyseo_query_ga4': {
|
|
83
107
|
const parsed = queryGA4Schema.parse(args);
|
|
@@ -147,6 +171,16 @@ class HeySeoMCPServer {
|
|
|
147
171
|
result = await executeDeleteTask(client, parsed);
|
|
148
172
|
break;
|
|
149
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
|
+
}
|
|
150
184
|
default:
|
|
151
185
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
152
186
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EAErB,gBAAgB,EAEhB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,oBAA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,SAAS,EAAE,KAAK,IAAI,EAAE;YAC/B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,sBAAsB,cAAc,mBAAmB,CAAC,CAAC;IACzE,CAAC;CACF;AAED,mBAAmB;AACnB,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;AACrC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC3B,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,EA6I3C,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA8K1C"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -116,6 +116,22 @@ export const promptTemplates = [
|
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
118
|
},
|
|
119
|
+
{
|
|
120
|
+
name: 'task_review',
|
|
121
|
+
description: 'Review and prioritize SEO tasks for a site, helping organize and plan work.',
|
|
122
|
+
arguments: [
|
|
123
|
+
{
|
|
124
|
+
name: 'siteId',
|
|
125
|
+
description: 'The ID of the site to review tasks for',
|
|
126
|
+
required: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'focus',
|
|
130
|
+
description: 'Focus area: "all" (default), "overdue", "high-priority", or "by-category"',
|
|
131
|
+
required: false,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
119
135
|
];
|
|
120
136
|
/**
|
|
121
137
|
* Generate prompt messages for a template
|
|
@@ -255,6 +271,28 @@ Compare the last 7 days to the previous 7 days and identify:
|
|
|
255
271
|
7. Opportunities to capitalize on improvements`,
|
|
256
272
|
},
|
|
257
273
|
];
|
|
274
|
+
case 'task_review':
|
|
275
|
+
return [
|
|
276
|
+
{
|
|
277
|
+
role: 'user',
|
|
278
|
+
content: `Review and help prioritize SEO tasks for site ${args.siteId}.
|
|
279
|
+
|
|
280
|
+
${args.focus === 'overdue' ? 'Focus on identifying overdue or stale tasks that need attention.' : ''}
|
|
281
|
+
${args.focus === 'high-priority' ? 'Focus on high-priority tasks that should be addressed first.' : ''}
|
|
282
|
+
${args.focus === 'by-category' ? 'Organize tasks by category (technical, content, links, ux) for better planning.' : ''}
|
|
283
|
+
|
|
284
|
+
Please:
|
|
285
|
+
1. List all current tasks grouped by status (todo, in_progress, done)
|
|
286
|
+
2. Identify high-priority incomplete tasks that need immediate attention
|
|
287
|
+
3. Suggest task prioritization based on SEO impact and effort required
|
|
288
|
+
4. Recommend which tasks to tackle next based on:
|
|
289
|
+
- Current SEO performance data
|
|
290
|
+
- Quick wins vs long-term improvements
|
|
291
|
+
- Dependencies between tasks
|
|
292
|
+
5. Flag any tasks that may be outdated or no longer relevant
|
|
293
|
+
6. Suggest new tasks if there are obvious gaps based on site performance`,
|
|
294
|
+
},
|
|
295
|
+
];
|
|
258
296
|
default:
|
|
259
297
|
return [
|
|
260
298
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,8GAA8G;QAChH,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;gBAC1C,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,6EAA6E;gBAC/E,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,iFAAiF;QACnF,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,iFAAiF;QACnF,SAAS,EAAE;YACT;gBACE,IAA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,WAAW,YAAY,yCAAyC;iBAC1E;aACF,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/dist/tools/gsc.d.ts
CHANGED
|
@@ -81,6 +81,20 @@ export declare const topPagesSchema: z.ZodObject<{
|
|
|
81
81
|
endDate?: string | undefined;
|
|
82
82
|
}>;
|
|
83
83
|
export type TopPagesInput = z.infer<typeof topPagesSchema>;
|
|
84
|
+
export declare const rankingHistorySchema: z.ZodObject<{
|
|
85
|
+
siteId: z.ZodString;
|
|
86
|
+
keyword: z.ZodString;
|
|
87
|
+
days: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
keyword: string;
|
|
90
|
+
siteId: string;
|
|
91
|
+
days: number;
|
|
92
|
+
}, {
|
|
93
|
+
keyword: string;
|
|
94
|
+
siteId: string;
|
|
95
|
+
days?: number | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
export type RankingHistoryInput = z.infer<typeof rankingHistorySchema>;
|
|
84
98
|
/**
|
|
85
99
|
* Execute GSC query tool
|
|
86
100
|
*/
|
|
@@ -93,6 +107,10 @@ export declare function executeTopKeywords(client: HeySeoApiClient, input: TopKe
|
|
|
93
107
|
* Execute top pages tool
|
|
94
108
|
*/
|
|
95
109
|
export declare function executeTopPages(client: HeySeoApiClient, input: TopPagesInput): Promise<string>;
|
|
110
|
+
/**
|
|
111
|
+
* Execute ranking history tool
|
|
112
|
+
*/
|
|
113
|
+
export declare function executeRankingHistory(client: HeySeoApiClient, input: RankingHistoryInput): Promise<string>;
|
|
96
114
|
/**
|
|
97
115
|
* GSC tool definitions for MCP
|
|
98
116
|
*/
|
|
@@ -154,6 +172,8 @@ export declare const gscTools: ({
|
|
|
154
172
|
description: string;
|
|
155
173
|
};
|
|
156
174
|
limit?: undefined;
|
|
175
|
+
keyword?: undefined;
|
|
176
|
+
days?: undefined;
|
|
157
177
|
};
|
|
158
178
|
required: string[];
|
|
159
179
|
};
|
|
@@ -187,6 +207,38 @@ export declare const gscTools: ({
|
|
|
187
207
|
dimensions?: undefined;
|
|
188
208
|
rowLimit?: undefined;
|
|
189
209
|
filters?: undefined;
|
|
210
|
+
keyword?: undefined;
|
|
211
|
+
days?: undefined;
|
|
212
|
+
};
|
|
213
|
+
required: string[];
|
|
214
|
+
};
|
|
215
|
+
} | {
|
|
216
|
+
name: string;
|
|
217
|
+
description: string;
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: string;
|
|
220
|
+
properties: {
|
|
221
|
+
siteId: {
|
|
222
|
+
type: string;
|
|
223
|
+
description: string;
|
|
224
|
+
};
|
|
225
|
+
keyword: {
|
|
226
|
+
type: string;
|
|
227
|
+
description: string;
|
|
228
|
+
};
|
|
229
|
+
days: {
|
|
230
|
+
type: string;
|
|
231
|
+
minimum: number;
|
|
232
|
+
maximum: number;
|
|
233
|
+
default: number;
|
|
234
|
+
description: string;
|
|
235
|
+
};
|
|
236
|
+
startDate?: undefined;
|
|
237
|
+
endDate?: undefined;
|
|
238
|
+
dimensions?: undefined;
|
|
239
|
+
rowLimit?: undefined;
|
|
240
|
+
filters?: undefined;
|
|
241
|
+
limit?: undefined;
|
|
190
242
|
};
|
|
191
243
|
required: string[];
|
|
192
244
|
};
|
package/dist/tools/gsc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gsc.d.ts","sourceRoot":"","sources":["../../src/tools/gsc.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,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCzB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG3D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAm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,MAAM,CAAC,CA8CjB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CAuGjB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0KpB,CAAC"}
|
package/dist/tools/gsc.js
CHANGED
|
@@ -83,6 +83,18 @@ export const topPagesSchema = z.object({
|
|
|
83
83
|
.optional()
|
|
84
84
|
.describe('End date (defaults to today)'),
|
|
85
85
|
});
|
|
86
|
+
// Schema for ranking history tool
|
|
87
|
+
export const rankingHistorySchema = z.object({
|
|
88
|
+
siteId: z.string().describe('The ID of the site to query'),
|
|
89
|
+
keyword: z.string().describe('The specific keyword to track'),
|
|
90
|
+
days: z
|
|
91
|
+
.number()
|
|
92
|
+
.min(7)
|
|
93
|
+
.max(90)
|
|
94
|
+
.optional()
|
|
95
|
+
.default(28)
|
|
96
|
+
.describe('Lookback period in days (7, 14, 28, or 90)'),
|
|
97
|
+
});
|
|
86
98
|
/**
|
|
87
99
|
* Execute GSC query tool
|
|
88
100
|
*/
|
|
@@ -204,6 +216,104 @@ export async function executeTopPages(client, input) {
|
|
|
204
216
|
});
|
|
205
217
|
}
|
|
206
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Execute ranking history tool
|
|
221
|
+
*/
|
|
222
|
+
export async function executeRankingHistory(client, input) {
|
|
223
|
+
try {
|
|
224
|
+
const endDate = new Date().toISOString().split('T')[0];
|
|
225
|
+
const startDate = new Date(Date.now() - input.days * 24 * 60 * 60 * 1000)
|
|
226
|
+
.toISOString()
|
|
227
|
+
.split('T')[0];
|
|
228
|
+
const result = await client.queryGSC({
|
|
229
|
+
siteId: input.siteId,
|
|
230
|
+
startDate,
|
|
231
|
+
endDate,
|
|
232
|
+
dimensions: ['date', 'query'],
|
|
233
|
+
rowLimit: input.days + 10, // Slightly more to ensure we get all days
|
|
234
|
+
filters: [
|
|
235
|
+
{
|
|
236
|
+
dimension: 'query',
|
|
237
|
+
operator: 'equals',
|
|
238
|
+
expression: input.keyword,
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
});
|
|
242
|
+
// Extract daily positions for the keyword
|
|
243
|
+
const dailyData = result.rows
|
|
244
|
+
.filter((row) => row.keys[1] === input.keyword)
|
|
245
|
+
.map((row) => ({
|
|
246
|
+
date: row.keys[0],
|
|
247
|
+
position: row.position,
|
|
248
|
+
clicks: row.clicks,
|
|
249
|
+
impressions: row.impressions,
|
|
250
|
+
ctr: row.ctr,
|
|
251
|
+
}))
|
|
252
|
+
.sort((a, b) => a.date.localeCompare(b.date));
|
|
253
|
+
if (dailyData.length === 0) {
|
|
254
|
+
return JSON.stringify({
|
|
255
|
+
success: true,
|
|
256
|
+
keyword: input.keyword,
|
|
257
|
+
message: 'No ranking data found for this keyword in the specified period',
|
|
258
|
+
period: { startDate, endDate, days: input.days },
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
// Calculate statistics
|
|
262
|
+
const positions = dailyData.map((d) => d.position);
|
|
263
|
+
const bestPosition = Math.min(...positions);
|
|
264
|
+
const worstPosition = Math.max(...positions);
|
|
265
|
+
const avgPosition = positions.reduce((a, b) => a + b, 0) / positions.length;
|
|
266
|
+
// Determine trend
|
|
267
|
+
const firstHalf = positions.slice(0, Math.floor(positions.length / 2));
|
|
268
|
+
const secondHalf = positions.slice(Math.floor(positions.length / 2));
|
|
269
|
+
const firstHalfAvg = firstHalf.reduce((a, b) => a + b, 0) / firstHalf.length;
|
|
270
|
+
const secondHalfAvg = secondHalf.reduce((a, b) => a + b, 0) / secondHalf.length;
|
|
271
|
+
const positionChange = firstHalfAvg - secondHalfAvg; // Positive = improved (lower position is better)
|
|
272
|
+
let trend;
|
|
273
|
+
if (positionChange > 2) {
|
|
274
|
+
trend = 'improving';
|
|
275
|
+
}
|
|
276
|
+
else if (positionChange < -2) {
|
|
277
|
+
trend = 'declining';
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
trend = 'stable';
|
|
281
|
+
}
|
|
282
|
+
// Calculate total metrics
|
|
283
|
+
const totalClicks = dailyData.reduce((sum, d) => sum + d.clicks, 0);
|
|
284
|
+
const totalImpressions = dailyData.reduce((sum, d) => sum + d.impressions, 0);
|
|
285
|
+
return JSON.stringify({
|
|
286
|
+
success: true,
|
|
287
|
+
keyword: input.keyword,
|
|
288
|
+
period: { startDate, endDate, days: input.days },
|
|
289
|
+
summary: {
|
|
290
|
+
trend,
|
|
291
|
+
bestPosition: bestPosition.toFixed(1),
|
|
292
|
+
worstPosition: worstPosition.toFixed(1),
|
|
293
|
+
averagePosition: avgPosition.toFixed(1),
|
|
294
|
+
positionChange: positionChange.toFixed(1),
|
|
295
|
+
totalClicks,
|
|
296
|
+
totalImpressions,
|
|
297
|
+
avgCtr: totalImpressions > 0
|
|
298
|
+
? `${((totalClicks / totalImpressions) * 100).toFixed(2)}%`
|
|
299
|
+
: '0%',
|
|
300
|
+
},
|
|
301
|
+
dailyData: dailyData.map((d) => ({
|
|
302
|
+
date: d.date,
|
|
303
|
+
position: d.position.toFixed(1),
|
|
304
|
+
clicks: d.clicks,
|
|
305
|
+
impressions: d.impressions,
|
|
306
|
+
ctr: `${(d.ctr * 100).toFixed(2)}%`,
|
|
307
|
+
})),
|
|
308
|
+
}, null, 2);
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
return JSON.stringify({
|
|
312
|
+
success: false,
|
|
313
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
207
317
|
/**
|
|
208
318
|
* GSC tool definitions for MCP
|
|
209
319
|
*/
|
|
@@ -344,5 +454,38 @@ Useful for understanding which pages drive the most organic traffic.`,
|
|
|
344
454
|
required: ['siteId'],
|
|
345
455
|
},
|
|
346
456
|
},
|
|
457
|
+
{
|
|
458
|
+
name: 'heyseo_ranking_history',
|
|
459
|
+
description: `Track keyword position changes over time.
|
|
460
|
+
|
|
461
|
+
Returns daily ranking data for a specific keyword, including:
|
|
462
|
+
- Daily position, clicks, impressions, and CTR
|
|
463
|
+
- Trend direction (improving, declining, or stable)
|
|
464
|
+
- Best and worst positions in the period
|
|
465
|
+
- Average position change
|
|
466
|
+
|
|
467
|
+
Use this to monitor how a keyword's ranking evolves and identify ranking volatility.`,
|
|
468
|
+
inputSchema: {
|
|
469
|
+
type: 'object',
|
|
470
|
+
properties: {
|
|
471
|
+
siteId: {
|
|
472
|
+
type: 'string',
|
|
473
|
+
description: 'The ID of the site to query',
|
|
474
|
+
},
|
|
475
|
+
keyword: {
|
|
476
|
+
type: 'string',
|
|
477
|
+
description: 'The specific keyword to track',
|
|
478
|
+
},
|
|
479
|
+
days: {
|
|
480
|
+
type: 'number',
|
|
481
|
+
minimum: 7,
|
|
482
|
+
maximum: 90,
|
|
483
|
+
default: 28,
|
|
484
|
+
description: 'Lookback period in days (7, 14, 28, or 90)',
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
required: ['siteId', 'keyword'],
|
|
488
|
+
},
|
|
489
|
+
},
|
|
347
490
|
];
|
|
348
491
|
//# sourceMappingURL=gsc.js.map
|