Skip to content

feat(mcp): add read-only competitor and report tools - #1156

Merged
gkhngyk merged 6 commits into
ansvisor:mainfrom
knockknock10:feature/mcp-read-only-tools-918-current
Oct 18, 2026
Merged

gkhngyk merged 6 commits into
ansvisor:mainfrom
knockknock10:feature/mcp-read-only-tools-918-current

Conversation

@knockknock10

Copy link
Copy Markdown
Contributor

Summary

Adds three read-only MCP tools for accessing configured competitors and saved report snapshots:

  • list_competitors — Lists configured competitors for a brand, including their IDs, names, and domains.
  • list_reports — Lists saved reports for a brand, newest first, returning metadata without loading full report payloads. Defaults to 50 reports per call, with a maximum of 100.
  • get_report — Retrieves a saved report snapshot, including its stored payload, without regenerating the report.

The implementation scopes database queries to the authenticated organization, handles missing organization context and inaccessible resources, and bounds report-list limits, including non-finite values. The MCP server documentation has been updated to describe the new tools.

Related issue

Related to #918

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — read-only competitor and report MCP tools, plus their documentation

Validation note: Lint, typecheck, and formatting checks have not been run locally. They should be run before merging.

Copilot AI balanced review requested due to automatic review settings October 18, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@knockknock10 knockknock10 changed the title Feature/mcp read only tools 918 current feat(mcp): add read-only competitor and report tools Oct 18, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @knockknock10. Checked:

  • Every read is scoped to the key's organization, and a brand or report from another org returns "not found".
  • The columns match the dashboard's getCompetitors, getReports and getReport, and each brands!inner embed has a single foreign key to resolve.
  • The largest saved payload in production is about 25 KB, so get_report stays small.

Typecheck, lint, format and the MCP tests pass locally. Merging this first; #1157 needs the tool count raised to 36 on top of it, which I'll do in a merge commit.

@gkhngyk
gkhngyk merged commit 30ff03a into ansvisor:main Oct 18, 2026
5 checks passed
gkhngyk added a commit to knockknock10/ansvisor that referenced this pull request Oct 18, 2026
The read-only competitor and report tools (ansvisor#1156) landed in the same spot
of server.ts; both sets are kept, prompt suggestions after the topic
suggestion tools. The guide's count is 36: 30 before, three from each PR.

Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
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.

3 participants