feat: add paginated get_backlinks_profile MCP tool#38
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
Exposes detailed per-link backlink rows over MCP, reusing BacklinksService paginated row fetching. Closes every-app#36.
6 tasks
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.
Summary
Adds a paginated
get_backlinks_profileMCP tool that exposes detailed per-link backlink rows (linking URLs, anchors, dofollow/nofollow, authority/spam signals, new/lost/broken status) over MCP. The MCP server previously only exposedget_backlinks_overview(summary + top referring domains), so agentic backlink-analysis workflows had no way to reach the per-row data the web UI already renders.Why this matters
Issue #36 (labeled
status:ready/type:enhancement) asks for exactly this, and the maintainer named the reuse points in the issue. The new tool reusesBacklinksService's paginated row fetching (backlinksServiceData/backlinksApiFilters) instead of re-querying DataForSEO, accepts the existing filter/sort params plus theone_per_domain/as_ismodes fromsrc/types/schemas/backlinks.ts, and returns rows in a bounded pagination envelope (page,pageSize,totalCount,hasMore) so a profile is never dumped unbounded. Existing DataForSEO access/credit error messaging is preserved.Changes
src/server/mcp/tools/get-backlinks-profile.ts, modeled onget-backlinks-overview.ts, reusingBacklinksServicefor row fetching.src/server/mcp/server.ts; output schema added insrc/server/mcp/output-schemas.ts; surfaced insrc/client/features/ai-mcp/AvailableTools.tsx.Testing
Output-schema validation for the new tool added in
src/server/mcp/tools/output-schema-validation.test.ts, covering the envelope shape and row schema. Pagination (hasMore/totalCount) and theone_per_domain/as_ismodes are exercised.Closes #36
AI was used for assistance.