Skip to content

feat(mcp): expose list_shopping_cards / get_product_visibility tools + REST endpoints - #177

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/mcp-shopping-cards
Jun 5, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/mcp-shopping-cards

Conversation

@Pallavikumarimdb

Copy link
Copy Markdown
Contributor

Exposes normalized shopping card data to both the MCP server and parallel REST endpoints.

Key Changes

  • Data Functions (web/src/lib/mcp/data.ts):
    • listShoppingCards: Fetches normalized cards with cursor-based pagination and organization-level ownership check.
    • getProductVisibility: Aggregates appearances of a single product across platforms, regions, and dates.
  • MCP Registrations (web/src/lib/mcp/server.ts):
    • Registered list_shopping_cards and get_product_visibility tools with Zod input schema validations and commercial-intent context descriptions.
  • REST Endpoints (web/src/app/api/mcp/):
    • Implemented GET routes under /api/mcp/shopping-cards and /api/mcp/product-visibility authenticated via authenticateMcpRequest.
  • Security: Wrong-org access returns 404 instead of 403 to prevent ID enumeration.

Closes: #107

@Pallavikumarimdb
Pallavikumarimdb marked this pull request as ready for review June 4, 2026 19:28
@gkhngyk
gkhngyk merged commit 969f719 into ansvisor:main Jun 5, 2026
1 check passed
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.

feat(mcp): expose list_shopping_cards / get_product_visibility tools + REST endpoints

2 participants