Skip to content

mcp: autoblog tools — post, guest-post, link-exchange, articles, traffic - #250

Merged
ralyodio merged 1 commit into
masterfrom
mcp-autoblog
Sep 12, 2026
Merged

ralyodio merged 1 commit into
masterfrom
mcp-autoblog

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Extends the existing CrawlProof MCP server at /api/mcp so an agent holding a crp_ token can drive the autoblog and link-exchange engine the dashboard drives by hand. New lib/mcp/autoblog.ts, registered next to the promote/stats/audits/leads modules — no new server, no new transport.

Tools

  • autoblog_sites — the caller's autoblog sites (id, domain, status, exchange on/off, next-due).
  • autoblog_post — queue an article on one of them (topic from the site's own keyword plan, exactly like a scheduled article).
  • autoblog_guest_post — request a guest post from the caller's site (author) to another site (target), with the same dedupe as the dashboard route (a generated one is reported, a failed one retried, a live one returned, else queued) and the same worker enqueue.
  • autoblog_link_exchange — read-only reciprocal backlink candidates for a site, via the existing findExchangeCandidates matcher.
  • autoblog_articles — a site's recent articles and their status.
  • traffic — a site's visitors/pageviews and top sources/pages (the tracker data the dashboard shows), filterable by humans/bots/all, wrapping projectStats/resolveProject.

Scoping

Every tool scopes to the authenticated user and verifies site ownership before any side effect. The MCP route uses the service-role client (no RLS), and the lx HTTP routes authenticate by a Supabase session cookie an MCP caller does not have, so these tools call the lib/lx/* and lib/tracker/* functions directly with explicit user_id/owner checks rather than proxying the routes — the same approach as the existing lib/mcp/stats.ts.

Tests

A contract test (tests/contract/mcp-autoblog.test.ts) pins the tool surface and each tool's input schema over the real MCP SDK, mirroring the existing mcp-stats/mcp-promote/mcp-audits tests. Handlers touch no DB in that test. I could not run vitest locally in this checkout (dev deps not installed here); CI runs it.

Together with mynaposter's new autoblog blog target (which posts composed content to CrawlProof's webhook receiver), this gives agents both paths: send a finished post via the webhook, or drive generation, guest posts and link exchange over MCP.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MxNif5tsYq4LczgG7aE8Jp

Extends the existing CrawlProof MCP server (/api/mcp) with the autoblog and
link-exchange engine that the dashboard drives by hand, so an agent holding
a crp_ token can drive it too. New lib/mcp/autoblog.ts, registered alongside
the promote/stats/audits/leads modules.

Tools:
- autoblog_sites — the caller's autoblog sites, ids and status.
- autoblog_post — queue an article on one of them (topic from its own plan).
- autoblog_guest_post — request a guest post from the caller's site to
  another, mirroring the dashboard route's dedupe (generated reported, failed
  retried, live returned, else queued) and enqueueing the worker.
- autoblog_link_exchange — read-only: reciprocal backlink candidates for a
  site via the existing matcher.
- autoblog_articles — a site's recent articles and status.
- traffic — a site's visitors/pageviews and top sources/pages, the tracker
  data the dashboard shows, filterable by humans/bots/all.

Every tool scopes to the authenticated user and verifies site ownership
before any side effect: the MCP route uses the service-role client, and the
lx HTTP routes authenticate by session cookie an MCP caller lacks, so these
call the lib functions directly with owner checks rather than proxying
routes. A contract test pins the tool surface and schemas over the real SDK,
mirroring the stats/promote/audits/leads tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxNif5tsYq4LczgG7aE8Jp
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

39 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 28 | LOW: 9

Severity Rule Location
HIGH tls-verification-disabled lib/onion.ts:48
HIGH secret-generic-credential lib/sp/platforms/facebook.ts:32
MEDIUM js-unescaped-html-sink app/(app)/dashboard/admin/email-broadcast/EmailBroadcastForm.tsx:125
MEDIUM js-unescaped-html-sink app/(app)/dashboard/projects/[id]/autoblog/articles/[articleId]/page.tsx:214
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:67
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:97
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:104
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:110
MEDIUM js-unescaped-html-sink app/(marketing)/recent/page.tsx:186
MEDIUM js-unescaped-html-sink app/(marketing)/recent/page.tsx:190
MEDIUM js-unescaped-html-sink app/c/[project]/[slug]/page.tsx:77
MEDIUM js-unescaped-html-sink app/c/[project]/page.tsx:57
MEDIUM js-unescaped-html-sink app/careers.js/route.ts:228
MEDIUM js-unescaped-html-sink app/careers.js/route.ts:285
MEDIUM js-unescaped-html-sink app/layout.tsx:129
MEDIUM js-open-redirect app/login/form.tsx:39
MEDIUM js-unescaped-html-sink app/r/[token]/page.tsx:176
MEDIUM js-open-redirect app/signup/form.tsx:43
MEDIUM js-open-redirect components/billing/buy-credits-modal.tsx:98
MEDIUM js-unescaped-html-sink components/json-ld.tsx:8
MEDIUM js-unescaped-html-sink components/report/markdown-view.tsx:15
MEDIUM js-unescaped-html-sink lib/careers/page-templates.ts:198
MEDIUM redos-nested-quantifier lib/emailMarkdown.ts:41
MEDIUM redos-nested-quantifier lib/emailMarkdown.ts:324
MEDIUM redos-nested-quantifier lib/lx/articleGen.ts:99
MEDIUM redos-nested-quantifier lib/tracker/agent-gate.ts:61
MEDIUM sh-remote-script-execution prober/deploy/provision.sh:30
MEDIUM sql-template-interpolation scripts/detect-slot-themes.ts:31
MEDIUM sql-template-interpolation scripts/purge-constructed-keywords.ts:163
MEDIUM sql-template-interpolation scripts/purge-offniche-keywords.ts:124
LOW secret-generic-credential app/(marketing)/docs/autoblog-webhook/page.tsx:145
LOW secret-generic-credential lib/sp/platforms/linkedin.ts:25
LOW js-dynamic-code-execution tests/careers-page-templates.test.ts:21
LOW js-dynamic-code-execution tests/careers-widget-script.test.ts:19
LOW js-dynamic-code-execution tests/careers-widget-script.test.ts:69
LOW js-dynamic-code-execution tests/contract/ad-visitor-id.test.ts:51
LOW js-dynamic-code-execution tests/contract/ad-visitor-id.test.ts:52
LOW secret-generic-credential tests/contract/posthog-integration.test.ts:13
LOW secret-generic-credential tests/lead-campaign.test.ts:16

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit ed0ebd9 into master Sep 12, 2026
10 checks passed
@ralyodio
ralyodio deleted the mcp-autoblog branch September 12, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant