mcp-scraper 0.6.0 → 0.7.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/dist/bin/api-server.cjs +296 -198
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.cjs +1 -1
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-install.cjs +1 -1
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +1 -1
- package/dist/bin/mcp-stdio-server.cjs +3 -3
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +3 -3
- package/dist/bin/paa-harvest.cjs +166 -74
- package/dist/bin/paa-harvest.cjs.map +1 -1
- package/dist/bin/paa-harvest.js +1 -1
- package/dist/chunk-EGWJ74EX.js +7 -0
- package/dist/chunk-EGWJ74EX.js.map +1 -0
- package/dist/{chunk-APJO2XV5.js → chunk-HL33CGJF.js} +3 -3
- package/dist/{chunk-APJO2XV5.js.map → chunk-HL33CGJF.js.map} +1 -1
- package/dist/{chunk-AUCXKRRH.js → chunk-RMPPYKUV.js} +167 -75
- package/dist/chunk-RMPPYKUV.js.map +1 -0
- package/dist/{chunk-BL7BBSYF.js → chunk-RUGJE5EB.js} +2 -2
- package/dist/{chunk-3K5GT6VG.js → chunk-YGRZU7IR.js} +3 -3
- package/dist/index.cjs +166 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{server-WHM446IZ.js → server-JNY4XPZE.js} +81 -76
- package/dist/server-JNY4XPZE.js.map +1 -0
- package/dist/{site-extract-repository-U476J44K.js → site-extract-repository-NVSZH35Y.js} +3 -3
- package/dist/{worker-KJZ3ZN2N.js → worker-JQTS437L.js} +4 -4
- package/dist/worker-JQTS437L.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-AUCXKRRH.js.map +0 -1
- package/dist/chunk-F2BXETDX.js +0 -7
- package/dist/chunk-F2BXETDX.js.map +0 -1
- package/dist/server-WHM446IZ.js.map +0 -1
- package/dist/worker-KJZ3ZN2N.js.map +0 -1
- package/docs/spec-browser-routing.md +0 -108
- package/docs/spec-kernel-computer-controls.md +0 -166
- package/docs/spec-mcp-tools.md +0 -146
- package/docs/spec-server-instructions.md +0 -94
- package/docs/specs/agent-ready-seo-packet-spec.md +0 -237
- package/docs/specs/audit-visual-demo.md +0 -309
- package/docs/specs/cli-agent-wiring-spec.md +0 -206
- package/docs/specs/local-competitive-audit-spec.md +0 -311
- package/docs/specs/scheduled-workflows-api-spec.md +0 -304
- package/docs/specs/seo-cli-growth-roadmap-spec.md +0 -181
- package/docs/specs/seo-workflow-runner-and-reports-spec.md +0 -241
- /package/dist/{chunk-BL7BBSYF.js.map → chunk-RUGJE5EB.js.map} +0 -0
- /package/dist/{chunk-3K5GT6VG.js.map → chunk-YGRZU7IR.js.map} +0 -0
- /package/dist/{site-extract-repository-U476J44K.js.map → site-extract-repository-NVSZH35Y.js.map} +0 -0
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
# Scheduled Workflows API — Implementation Spec
|
|
2
|
-
|
|
3
|
-
Scheduled workflows turn MCP Scraper from one-off data pulls into recurring SEO intelligence. This spec adds hosted schedule CRUD, run history, webhook delivery, and report retrieval for workflow runs.
|
|
4
|
-
|
|
5
|
-
## Goals
|
|
6
|
-
|
|
7
|
-
- Schedule recurring workflow runs through API/CLI.
|
|
8
|
-
- Persist run history and artifacts.
|
|
9
|
-
- Send webhook callbacks on completion/failure.
|
|
10
|
-
- Support rank-monitor style use cases without replacing `rank_tracker_blueprint`.
|
|
11
|
-
- Keep local CLI and hosted scheduler using the same workflow registry.
|
|
12
|
-
|
|
13
|
-
## Non-goals
|
|
14
|
-
|
|
15
|
-
- Do not build a full dashboard in this phase.
|
|
16
|
-
- Do not make `rank_tracker_blueprint` execute work; it remains a planning tool.
|
|
17
|
-
- Do not require OAuth; API key auth is enough for this phase.
|
|
18
|
-
|
|
19
|
-
## Command surface
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
mcp-scraper-cli schedule create local-competitive-audit \
|
|
23
|
-
--weekly \
|
|
24
|
-
--query roofers \
|
|
25
|
-
--state TN \
|
|
26
|
-
--min-pop 100000 \
|
|
27
|
-
--webhook https://example.com/mcp-scraper-hook
|
|
28
|
-
|
|
29
|
-
mcp-scraper-cli schedule list
|
|
30
|
-
mcp-scraper-cli schedule run <schedule-id>
|
|
31
|
-
mcp-scraper-cli schedule pause <schedule-id>
|
|
32
|
-
mcp-scraper-cli schedule resume <schedule-id>
|
|
33
|
-
mcp-scraper-cli schedule delete <schedule-id>
|
|
34
|
-
mcp-scraper-cli runs list
|
|
35
|
-
mcp-scraper-cli runs status <run-id>
|
|
36
|
-
mcp-scraper-cli runs download <run-id>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## API routes
|
|
40
|
-
|
|
41
|
-
Mount:
|
|
42
|
-
|
|
43
|
-
```text
|
|
44
|
-
/workflows
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Routes:
|
|
48
|
-
|
|
49
|
-
| Method | Path | Purpose |
|
|
50
|
-
|---|---|---|
|
|
51
|
-
| `GET` | `/workflows/definitions` | List available workflows and input schemas. |
|
|
52
|
-
| `POST` | `/workflows/run` | Start a manual workflow run. |
|
|
53
|
-
| `GET` | `/workflows/runs/:id` | Get run status, manifest, artifact links. |
|
|
54
|
-
| `GET` | `/workflows/runs/:id/artifacts/:artifactId` | Download artifact. |
|
|
55
|
-
| `POST` | `/workflows/schedules` | Create schedule. |
|
|
56
|
-
| `GET` | `/workflows/schedules` | List schedules for user. |
|
|
57
|
-
| `PATCH` | `/workflows/schedules/:id` | Pause/resume/update. |
|
|
58
|
-
| `DELETE` | `/workflows/schedules/:id` | Delete schedule. |
|
|
59
|
-
| `POST` | `/workflows/schedules/:id/run` | Manual run of a schedule. |
|
|
60
|
-
|
|
61
|
-
All routes use `createApiKeyAuth`.
|
|
62
|
-
|
|
63
|
-
## Database schema
|
|
64
|
-
|
|
65
|
-
Add to `src/api/db.ts` migrations:
|
|
66
|
-
|
|
67
|
-
```sql
|
|
68
|
-
CREATE TABLE IF NOT EXISTS workflow_schedules (
|
|
69
|
-
id TEXT PRIMARY KEY,
|
|
70
|
-
user_id INTEGER NOT NULL,
|
|
71
|
-
workflow_id TEXT NOT NULL,
|
|
72
|
-
name TEXT NOT NULL,
|
|
73
|
-
input_json TEXT NOT NULL,
|
|
74
|
-
cadence TEXT NOT NULL, -- daily | weekly | monthly | custom
|
|
75
|
-
cron_expr TEXT,
|
|
76
|
-
timezone TEXT NOT NULL DEFAULT 'UTC',
|
|
77
|
-
webhook_url TEXT,
|
|
78
|
-
status TEXT NOT NULL DEFAULT 'active', -- active | paused | deleted
|
|
79
|
-
next_run_at TEXT,
|
|
80
|
-
last_run_at TEXT,
|
|
81
|
-
created_at TEXT NOT NULL,
|
|
82
|
-
updated_at TEXT NOT NULL
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
CREATE TABLE IF NOT EXISTS workflow_runs (
|
|
86
|
-
id TEXT PRIMARY KEY,
|
|
87
|
-
user_id INTEGER NOT NULL,
|
|
88
|
-
schedule_id TEXT,
|
|
89
|
-
workflow_id TEXT NOT NULL,
|
|
90
|
-
input_json TEXT NOT NULL,
|
|
91
|
-
status TEXT NOT NULL DEFAULT 'queued', -- queued | running | succeeded | partial | failed | cancelled
|
|
92
|
-
manifest_json TEXT,
|
|
93
|
-
error_message TEXT,
|
|
94
|
-
queued_at TEXT NOT NULL,
|
|
95
|
-
started_at TEXT,
|
|
96
|
-
completed_at TEXT,
|
|
97
|
-
idempotency_key TEXT
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
CREATE TABLE IF NOT EXISTS workflow_artifacts (
|
|
101
|
-
id TEXT PRIMARY KEY,
|
|
102
|
-
run_id TEXT NOT NULL,
|
|
103
|
-
user_id INTEGER NOT NULL,
|
|
104
|
-
kind TEXT NOT NULL,
|
|
105
|
-
label TEXT NOT NULL,
|
|
106
|
-
path TEXT NOT NULL,
|
|
107
|
-
content_type TEXT NOT NULL,
|
|
108
|
-
bytes INTEGER,
|
|
109
|
-
rows_count INTEGER,
|
|
110
|
-
created_at TEXT NOT NULL
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
CREATE TABLE IF NOT EXISTS workflow_webhook_deliveries (
|
|
114
|
-
id TEXT PRIMARY KEY,
|
|
115
|
-
run_id TEXT NOT NULL,
|
|
116
|
-
schedule_id TEXT,
|
|
117
|
-
user_id INTEGER NOT NULL,
|
|
118
|
-
webhook_url TEXT NOT NULL,
|
|
119
|
-
status TEXT NOT NULL, -- pending | delivered | failed
|
|
120
|
-
attempts INTEGER NOT NULL DEFAULT 0,
|
|
121
|
-
last_error TEXT,
|
|
122
|
-
created_at TEXT NOT NULL,
|
|
123
|
-
delivered_at TEXT
|
|
124
|
-
);
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Indexes:
|
|
128
|
-
|
|
129
|
-
```sql
|
|
130
|
-
CREATE INDEX IF NOT EXISTS idx_workflow_schedules_due ON workflow_schedules(status, next_run_at);
|
|
131
|
-
CREATE INDEX IF NOT EXISTS idx_workflow_runs_user_created ON workflow_runs(user_id, queued_at);
|
|
132
|
-
CREATE INDEX IF NOT EXISTS idx_workflow_artifacts_run ON workflow_artifacts(run_id);
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Worker model
|
|
136
|
-
|
|
137
|
-
Initial implementation can use a hosted cron route:
|
|
138
|
-
|
|
139
|
-
```text
|
|
140
|
-
POST /workflows/cron/dispatch
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Protected by `CRON_SECRET`.
|
|
144
|
-
|
|
145
|
-
Dispatch steps:
|
|
146
|
-
|
|
147
|
-
1. Find active schedules where `next_run_at <= now`.
|
|
148
|
-
2. Create `workflow_runs` row with idempotency key `<scheduleId>:<scheduledTime>`.
|
|
149
|
-
3. Enqueue/run workflow.
|
|
150
|
-
4. Advance `next_run_at`.
|
|
151
|
-
|
|
152
|
-
If no queue is available, run small workflows inline and mark long workflows as queued for later worker integration. The workflow registry should not care whether a run is local, HTTP, or queued.
|
|
153
|
-
|
|
154
|
-
## Run execution
|
|
155
|
-
|
|
156
|
-
`WorkflowRunService`:
|
|
157
|
-
|
|
158
|
-
```ts
|
|
159
|
-
interface WorkflowRunService {
|
|
160
|
-
startManualRun(userId: number, workflowId: string, input: unknown): Promise<WorkflowRun>
|
|
161
|
-
startScheduledRun(schedule: WorkflowSchedule, scheduledFor: string): Promise<WorkflowRun>
|
|
162
|
-
executeRun(runId: string): Promise<void>
|
|
163
|
-
getRun(userId: number, runId: string): Promise<WorkflowRunWithArtifacts>
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Execution rules:
|
|
168
|
-
|
|
169
|
-
- Debit estimated credits before paid API work.
|
|
170
|
-
- Refund failed units when workflow has per-item partial failures.
|
|
171
|
-
- Persist `manifest_json` after every major phase so status pages are useful during partial failure.
|
|
172
|
-
- Save artifacts through a hosted artifact writer. Local paths are not enough for hosted runs.
|
|
173
|
-
|
|
174
|
-
## Artifact storage
|
|
175
|
-
|
|
176
|
-
Phase 1:
|
|
177
|
-
|
|
178
|
-
- Store artifacts on local/Vercel ephemeral disk only for immediate response is not durable enough.
|
|
179
|
-
- Therefore hosted scheduled workflows need object storage before public rollout.
|
|
180
|
-
|
|
181
|
-
Recommended minimal storage:
|
|
182
|
-
|
|
183
|
-
- S3/R2-compatible bucket.
|
|
184
|
-
- Store by `user_id/run_id/artifact_id`.
|
|
185
|
-
- DB stores key/path and content type.
|
|
186
|
-
|
|
187
|
-
Local CLI can continue writing to `~/Downloads/mcp-scraper`.
|
|
188
|
-
|
|
189
|
-
## Webhooks
|
|
190
|
-
|
|
191
|
-
Payload:
|
|
192
|
-
|
|
193
|
-
```ts
|
|
194
|
-
interface WorkflowWebhookPayload {
|
|
195
|
-
event: 'workflow.run.succeeded' | 'workflow.run.partial' | 'workflow.run.failed'
|
|
196
|
-
runId: string
|
|
197
|
-
scheduleId: string | null
|
|
198
|
-
workflowId: string
|
|
199
|
-
status: string
|
|
200
|
-
completedAt: string
|
|
201
|
-
summary: {
|
|
202
|
-
title: string
|
|
203
|
-
counts: Record<string, number>
|
|
204
|
-
warnings: string[]
|
|
205
|
-
errors: string[]
|
|
206
|
-
}
|
|
207
|
-
artifacts: Array<{
|
|
208
|
-
kind: string
|
|
209
|
-
label: string
|
|
210
|
-
downloadUrl: string
|
|
211
|
-
}>
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Security:
|
|
216
|
-
|
|
217
|
-
- Sign payloads with `MCP_SCRAPER_WEBHOOK_SECRET`.
|
|
218
|
-
- Header: `x-mcp-scraper-signature`.
|
|
219
|
-
- Include timestamp header to prevent replay.
|
|
220
|
-
|
|
221
|
-
Retries:
|
|
222
|
-
|
|
223
|
-
- 3 attempts with exponential backoff.
|
|
224
|
-
- Persist every attempt in `workflow_webhook_deliveries`.
|
|
225
|
-
|
|
226
|
-
## Scheduling modes
|
|
227
|
-
|
|
228
|
-
Supported:
|
|
229
|
-
|
|
230
|
-
```ts
|
|
231
|
-
type WorkflowCadence = 'daily' | 'weekly' | 'monthly' | 'custom'
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
For `custom`, require cron expression and timezone.
|
|
235
|
-
|
|
236
|
-
Validation:
|
|
237
|
-
|
|
238
|
-
- Minimum cadence: daily for expensive live-web workflows unless account tier allows more.
|
|
239
|
-
- Cap concurrent active schedules per account tier.
|
|
240
|
-
- Cap max run timeout.
|
|
241
|
-
|
|
242
|
-
## Integration with `rank_tracker_blueprint`
|
|
243
|
-
|
|
244
|
-
`rank_tracker_blueprint` should mention scheduled workflows as an execution option:
|
|
245
|
-
|
|
246
|
-
- Use `scheduled-workflows` for hosted recurring MCP Scraper runs.
|
|
247
|
-
- Use generated rank-tracker schema when the user wants their own database/dashboard.
|
|
248
|
-
|
|
249
|
-
Do not make the blueprint depend on schedules.
|
|
250
|
-
|
|
251
|
-
## Tests
|
|
252
|
-
|
|
253
|
-
- Schedule CRUD auth and ownership tests.
|
|
254
|
-
- Cron dispatch only runs due active schedules.
|
|
255
|
-
- Idempotency prevents duplicate runs for same scheduled time.
|
|
256
|
-
- Manual run creates run row and artifacts.
|
|
257
|
-
- Webhook signing and retry tests.
|
|
258
|
-
- Artifact download requires owning API key.
|
|
259
|
-
- Schedule create rejects unknown workflow IDs and invalid inputs.
|
|
260
|
-
|
|
261
|
-
## Rollout phases
|
|
262
|
-
|
|
263
|
-
## Implementation status
|
|
264
|
-
|
|
265
|
-
Implemented in the first working pass:
|
|
266
|
-
|
|
267
|
-
- Database migrations and helpers for `workflow_schedules`, `workflow_runs`, `workflow_artifacts`, and `workflow_webhook_deliveries`.
|
|
268
|
-
- Authenticated hosted routes for definitions, manual runs, run status, artifact downloads, schedule CRUD, manual schedule runs, and cron dispatch.
|
|
269
|
-
- Cron integration from the main `/cron/tick` route.
|
|
270
|
-
- CLI commands: `schedule create/list/run/pause/resume/delete` and `runs list/status/download`.
|
|
271
|
-
- Signed webhook delivery when `MCP_SCRAPER_WEBHOOK_SECRET` is configured, with delivery history.
|
|
272
|
-
|
|
273
|
-
Still required before broad public rollout:
|
|
274
|
-
|
|
275
|
-
- Durable object storage for hosted artifacts. Current hosted artifacts are filesystem-backed, which is enough for local/server testing and immediate retrieval but not durable across serverless cold starts or instance changes.
|
|
276
|
-
- More route coverage for cron idempotency, ownership on artifact downloads, and webhook retries.
|
|
277
|
-
- Account-tier schedule caps and preflight cost estimation before expensive hosted runs.
|
|
278
|
-
|
|
279
|
-
### Phase 1 — API definitions and manual runs
|
|
280
|
-
|
|
281
|
-
- `/workflows/definitions`
|
|
282
|
-
- `/workflows/run`
|
|
283
|
-
- `/workflows/runs/:id`
|
|
284
|
-
- Local or test artifact storage.
|
|
285
|
-
|
|
286
|
-
### Phase 2 — Durable artifact storage
|
|
287
|
-
|
|
288
|
-
- S3/R2 bucket.
|
|
289
|
-
- Artifact download routes.
|
|
290
|
-
|
|
291
|
-
### Phase 3 — Schedules and cron dispatch
|
|
292
|
-
|
|
293
|
-
- Schedule CRUD.
|
|
294
|
-
- Cron-protected dispatcher.
|
|
295
|
-
|
|
296
|
-
### Phase 4 — Webhooks
|
|
297
|
-
|
|
298
|
-
- Signed completion callbacks.
|
|
299
|
-
- Retry/delivery history.
|
|
300
|
-
|
|
301
|
-
### Phase 5 — CLI schedule commands
|
|
302
|
-
|
|
303
|
-
- `schedule create/list/run/pause/resume/delete`.
|
|
304
|
-
- `runs list/status/download`.
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
# SEO CLI Growth Roadmap — Product + Implementation Spec
|
|
2
|
-
|
|
3
|
-
This spec packages the planned MCP Scraper growth work into buildable slices. The product goal is to make MCP Scraper the command-line and MCP data layer for AI SEO work: run live web intelligence workflows, save evidence-rich reports, and hand clean artifacts to AI agents.
|
|
4
|
-
|
|
5
|
-
## Product thesis
|
|
6
|
-
|
|
7
|
-
AI SEO users do not only need scraped data. They need repeatable evidence workflows that answer:
|
|
8
|
-
|
|
9
|
-
- Which sources and competitors are visible in AI/Search surfaces?
|
|
10
|
-
- What do Maps competitors look like across a market?
|
|
11
|
-
- What do reviews say customers care about?
|
|
12
|
-
- What should an AI agent do next with the evidence?
|
|
13
|
-
- Can the workflow run again on a schedule?
|
|
14
|
-
|
|
15
|
-
The CLI should therefore feel like a workflow machine, not a loose collection of endpoints.
|
|
16
|
-
|
|
17
|
-
## Spec set
|
|
18
|
-
|
|
19
|
-
| Spec | Purpose | Recommended priority |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| `cli-agent-wiring-spec.md` | Make MCP Scraper easy to install into Codex, Claude, and other AI-agent hosts. | P0 |
|
|
22
|
-
| `seo-workflow-runner-and-reports-spec.md` | Add a human CLI workflow runner plus local HTML/CSV/JSON/Markdown report artifacts. | P0 |
|
|
23
|
-
| `agent-ready-seo-packet-spec.md` | Produce a folder that an AI agent can use directly: brief, evidence, sources, tasks, report. | P1 |
|
|
24
|
-
| `local-competitive-audit-spec.md` | Turn directory + Maps + review/profile hydration into a market audit workflow. | P1 |
|
|
25
|
-
| `scheduled-workflows-api-spec.md` | Add hosted recurring workflow schedules, webhooks, run history, and API surfaces. | P2 |
|
|
26
|
-
|
|
27
|
-
## Current tool surface to reuse
|
|
28
|
-
|
|
29
|
-
Already shipped:
|
|
30
|
-
|
|
31
|
-
- `maps_search` — multi-business Maps result search, up to 50 results.
|
|
32
|
-
- `maps_place_intel` — profile-level Maps details, review count, category, review histogram, review topics, attributes, optional review cards.
|
|
33
|
-
- `directory_workflow` — Census/city selection + city-by-city Maps searches + CSV output.
|
|
34
|
-
- `rank_tracker_blueprint` — local planning tool for database schema, cron, metrics, and implementation prompts.
|
|
35
|
-
- `search_serp` / `harvest_paa` — SERP, PAA, AI Overview, forums, videos, and source evidence.
|
|
36
|
-
- `mcp-scraper-install` — human terminal installer card.
|
|
37
|
-
- `mcp-scraper-combined` — combined MCP stdio server for web intelligence + browser tools.
|
|
38
|
-
|
|
39
|
-
Important distinction: `rank_tracker_blueprint` is not a live tracker runner. It should be referenced by scheduled workflow specs, not replaced.
|
|
40
|
-
|
|
41
|
-
## New CLI command family
|
|
42
|
-
|
|
43
|
-
Keep existing stdio server binaries protocol-safe. Add a new human-facing CLI binary:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"bin": {
|
|
48
|
-
"mcp-scraper-cli": "dist/bin/mcp-scraper-cli.js"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Rationale: `mcp-scraper` is already the stdio MCP server. It must stay silent except for JSON-RPC. The human CLI can print progress bars, report paths, cards, and diagnostics.
|
|
54
|
-
|
|
55
|
-
Primary commands:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
mcp-scraper-cli doctor
|
|
59
|
-
mcp-scraper-cli agent install codex
|
|
60
|
-
mcp-scraper-cli agent install claude
|
|
61
|
-
mcp-scraper-cli agent prompt agent-packet
|
|
62
|
-
mcp-scraper-cli workflow list
|
|
63
|
-
mcp-scraper-cli workflow run agent-packet --keyword "roof repair Denver" --domain example.com
|
|
64
|
-
mcp-scraper-cli workflow run local-competitive-audit --query roofers --state TN --min-pop 100000 --per-city 20
|
|
65
|
-
mcp-scraper-cli report open last
|
|
66
|
-
mcp-scraper-cli schedule create local-competitive-audit --weekly --webhook https://example.com/hook
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The existing `mcp-scraper-install` stays as the branded terminal card and can point users at `mcp-scraper-cli`.
|
|
70
|
-
|
|
71
|
-
## Workflow catalog
|
|
72
|
-
|
|
73
|
-
P0/P1 workflows:
|
|
74
|
-
|
|
75
|
-
| Workflow | What it answers | Primary outputs |
|
|
76
|
-
|---|---|---|
|
|
77
|
-
| `agent-packet` | What evidence and tasks should an AI agent use for this SEO problem? | agent folder, HTML report |
|
|
78
|
-
| `local-competitive-audit` | Who ranks in local markets, how strong are they, and what do customers say? | report, CSVs, review insights |
|
|
79
|
-
| `directory` | Which businesses are ranking across selected city markets? | CSV, market report |
|
|
80
|
-
| `map-comparison` | How do Maps competitors compare by rank, reviews, categories, websites, and profile signals? | comparison CSV, profile insights, HTML report |
|
|
81
|
-
| `serp-comparison` | Why are ranking pages winning and what content gaps should the target inspect? | page comparison, heading gaps, PAA and AI Overview evidence |
|
|
82
|
-
| `paa-expansion-brief` | What should a page cover based on People Also Ask expansion? | writer brief, question map, source-domain table |
|
|
83
|
-
| `ai-overview-language` | How should content be phrased for AI Overview-style answer blocks and citation hooks? | language guidance, claim patterns, citation table |
|
|
84
|
-
| `answer-gap` | Which cited/ranking sources answer the query better than the target page? | gap report, task list |
|
|
85
|
-
| `ai-citations` | Is the brand/domain cited in AI Overview/search evidence? | citation table, trends when scheduled |
|
|
86
|
-
|
|
87
|
-
P2/P3 workflows:
|
|
88
|
-
|
|
89
|
-
| Workflow | What it answers |
|
|
90
|
-
|---|---|
|
|
91
|
-
| `maps-rank-monitor` | How does a target GBP move across markets and keywords? |
|
|
92
|
-
| `content-decay` | Which pages are stale compared with current live SERP/PAA evidence? |
|
|
93
|
-
| `forum-demand` | What objections, use cases, and language are showing up in forums? |
|
|
94
|
-
| `entity-audit` | Is brand/entity consistency strong across public search surfaces? |
|
|
95
|
-
|
|
96
|
-
## Shared artifact contract
|
|
97
|
-
|
|
98
|
-
Every workflow writes a run folder:
|
|
99
|
-
|
|
100
|
-
```text
|
|
101
|
-
~/Downloads/mcp-scraper/workflows/<workflow>/<timestamp>-<slug>/
|
|
102
|
-
manifest.json
|
|
103
|
-
report.html
|
|
104
|
-
summary.md
|
|
105
|
-
evidence.json
|
|
106
|
-
sources.csv
|
|
107
|
-
tasks.md
|
|
108
|
-
logs/attempts.jsonl
|
|
109
|
-
exports/*.csv
|
|
110
|
-
screenshots/* # optional
|
|
111
|
-
replays/* # optional
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
`manifest.json` is the stable contract:
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
interface WorkflowManifest {
|
|
118
|
-
workflow: string
|
|
119
|
-
runId: string
|
|
120
|
-
startedAt: string
|
|
121
|
-
completedAt: string | null
|
|
122
|
-
status: 'running' | 'succeeded' | 'partial' | 'failed'
|
|
123
|
-
input: Record<string, unknown>
|
|
124
|
-
artifacts: Array<{
|
|
125
|
-
kind: 'html_report' | 'markdown' | 'json' | 'csv' | 'log' | 'screenshot' | 'replay'
|
|
126
|
-
label: string
|
|
127
|
-
path: string
|
|
128
|
-
rows?: number
|
|
129
|
-
}>
|
|
130
|
-
counts: Record<string, number>
|
|
131
|
-
warnings: string[]
|
|
132
|
-
costs?: { estimatedMc: number; actualMc?: number }
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Implementation phases
|
|
137
|
-
|
|
138
|
-
### Phase 1 — Human CLI shell + agent wiring
|
|
139
|
-
|
|
140
|
-
- Add `bin/mcp-scraper-cli.ts`.
|
|
141
|
-
- Implement `doctor`, `agent install`, `agent prompt`, and `workflow list`.
|
|
142
|
-
- No new paid workflow execution yet.
|
|
143
|
-
- Tests: CLI argument parsing, generated config snapshots, installer card references.
|
|
144
|
-
|
|
145
|
-
### Phase 2 — Workflow runner + report artifact system
|
|
146
|
-
|
|
147
|
-
- Add local workflow registry and artifact writer.
|
|
148
|
-
- Implement `report open last`.
|
|
149
|
-
- Implement `directory` as first wrapped workflow around existing `directory_workflow`.
|
|
150
|
-
- Tests: run folder creation, manifest shape, report renderer.
|
|
151
|
-
|
|
152
|
-
### Phase 3 — Agent-ready SEO packet
|
|
153
|
-
|
|
154
|
-
- Implement `agent-packet` workflow.
|
|
155
|
-
- Use `search_serp`, `harvest_paa`, optional `extract_url`, and report writer.
|
|
156
|
-
- Tests: fixture evidence to deterministic packet artifacts.
|
|
157
|
-
|
|
158
|
-
### Phase 4 — Local competitive audit
|
|
159
|
-
|
|
160
|
-
- Implement `local-competitive-audit`.
|
|
161
|
-
- Add `review_count` to directory CSV base export.
|
|
162
|
-
- Hydrate top-N competitors per city using `maps_place_intel`.
|
|
163
|
-
- Generate review/category/market-strength report.
|
|
164
|
-
|
|
165
|
-
### Phase 5 — Hosted schedules/API
|
|
166
|
-
|
|
167
|
-
- Add workflow run and schedule database tables.
|
|
168
|
-
- Add API routes for schedule CRUD, manual run, run status, report download.
|
|
169
|
-
- Add webhook callbacks.
|
|
170
|
-
- Keep scheduled workflows separate from `rank_tracker_blueprint`; the blueprint can generate schema/plans for custom rank trackers.
|
|
171
|
-
|
|
172
|
-
## Tool-description impact
|
|
173
|
-
|
|
174
|
-
When each workflow ships, update:
|
|
175
|
-
|
|
176
|
-
- `README.md` install and tool sections.
|
|
177
|
-
- `public/skills/mcp-scraper/skill.md`.
|
|
178
|
-
- MCP tool descriptions in `src/mcp/paa-mcp-server.ts` if a workflow becomes a real MCP tool.
|
|
179
|
-
- `mcp-scraper-install` newest-feature line.
|
|
180
|
-
|
|
181
|
-
Avoid naming underlying browser/proxy vendors in outward-facing CLI text, tool descriptions, and error messages.
|