Using Apify Actors as MCP tools for product data in a Next.js dog‑fashion app
说明与用途
使用 Apify Actors 作为 MCP 工具,在 Next.js 狗狗时尚推荐应用中自动获取最新的电商产品数据。
问题
The developer needed up‑to‑date e‑commerce product data for a dog‑fashion recommendation app without manually scraping or copying URLs from Amazon and eBay.
结果
The integration allowed the app to automatically retrieve up‑to‑date product listings from Amazon and eBay, eliminating manual scraping and reducing maintenance overhead.
工作流
- 1. Create an Apify account and obtain an API token or OAuth credentials.
- 2. Install opencode and configure its MCP settings to point to https://mcp.apify.com with desired tools (fetch‑actor‑details, apify/e-commerce‑scraping‑tool).
- 3. Authenticate opencode with Apify via OAuth (opencode mcp auth apify).
- 4. Use opencode to test the tool by asking a natural language query (e.g., "Find me ecommerce product poodle dog harness").
- 5. Write a TypeScript client in the Next.js app that uses the @modelcontextprotocol/sdk to call the MCP server, poll for run completion, and fetch dataset items.
- 6. Handle missing API token and error states in the client code.
- 7. Deploy the app; the server-side code fetches product data on each request, returning real listings to the frontend.
证据
I asked opencode a plain-English question: Find me ecommerce product poodle dog harness. opencode picked the apify--e-commerce-scraping-tool tool, called it, polled the run, and read the dataset.
- 记录日期: 2026-09-15T07:31:12.088Z