Skip to content

feat(mcp): expose list_citations tool + REST endpoint #97

Closed

Description

@gkhngyk

What

Add an MCP tool list_citations (+ /api/mcp/citations REST) returning the URLs AI engines cite alongside the brand, classified by source type (news / review / owned / social / forum), filterable by brand, date range, platform.

Why

Citations are a core dashboard surface not yet exposed via MCP. Lets clients / the assistant (#94) answer "which sources cite me (or my competitors)?".

Data source

web/src/lib/actions/citations.ts (getCitationsOverview) already derives this from prompt_results (+ brand_domains / competitors). Reuse the same logic.

Where to change (existing MCP pattern)

  • data.ts: listCitationsFor(auth, { brandId, ... }) — ownership check, reuse citations logic.
  • server.ts: register list_citations.
  • web/src/app/api/mcp/citations/route.ts: GET, same data fn.

Acceptance criteria

  • Returns cited URLs + source-type classification for the brand/filters.
  • Org-ownership enforced — wrong-org → 404.
  • MCP tool and REST route share the same data function.

Out of scope

UI, scoring changes.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on May 25, 2026
  2. added a commit that references this issue on May 28, 2026
    dd4d6c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions