mcp: autoblog tools — post, guest-post, link-exchange, articles, traffic - #250
Merged
Merged
Conversation
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
ThreatCrush Security Scan39 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 28 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the existing CrawlProof MCP server at
/api/mcpso an agent holding acrp_token can drive the autoblog and link-exchange engine the dashboard drives by hand. Newlib/mcp/autoblog.ts, registered next to the promote/stats/audits/leads modules — no new server, no new transport.Tools
findExchangeCandidatesmatcher.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
lxHTTP routes authenticate by a Supabase session cookie an MCP caller does not have, so these tools call thelib/lx/*andlib/tracker/*functions directly with explicituser_id/owner checks rather than proxying the routes — the same approach as the existinglib/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 existingmcp-stats/mcp-promote/mcp-auditstests. 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
autoblogblog 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