Repository navigation
feat(mcp): add read-only competitor and report tools - #1156
Merged
gkhngyk merged 6 commits intoOct 18, 2026
Merged
Conversation
There was a problem hiding this comment.
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.
gkhngyk
approved these changes
Oct 18, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
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,getReportsandgetReport, and eachbrands!innerembed has a single foreign key to resolve. - The largest saved payload in production is about 25 KB, so
get_reportstays 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
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
9 of 12 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 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 featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Validation note: Lint, typecheck, and formatting checks have not been run locally. They should be run before merging.