跳到正文
DEV Community· SecretPass·· 13 天前AI 評分38

如何為 AI 助手接入 SecretPass 開放 MCP 伺服器,搜尋真實優惠

Give your AI assistant real coupon search with an open MCP server

AI 導讀

SecretPass 團隊透過開放 MCP 伺服器,讓 AI 助手搜尋美國、英國和澳洲網店的優惠。伺服器無需帳戶或 API key,提供 search_offers、get_offer 和 list_filters 三項唯讀工具,並可接入 Claude Code 或 Cursor。搜尋結果不含優惠碼,會員須到 SecretPass 網站解鎖。

正文

SecretPass

Most shopping assistants stop at "try searching for a coupon". We wanted an AI assistant to be able to look up real offers, so we put the SecretPass offer search behind an open Model Context Protocol (MCP) server.

SecretPass is a shopping club with coupon codes and deals for online shopping stores in the United States, the United Kingdom and Australia. This post shows how to connect the MCP server to an assistant, and how to call it directly. It needs no account or API key.

Disclosure: this is written by the team behind SecretPass.

What the server does

The endpoint is https://secretpass.com/mcp (Streamable HTTP, no authentication). It has three read-only tools:

Tool What it does
search_offers Search offers by keyword, region, category, shop, brand or product type
get_offer Read the full public details of one offer
list_filters List countries, categories, brands and product types with offer counts

Results link to the SecretPass offer page. Voucher codes are not included in MCP results: search is free, and membership unlocks the codes on the website.

Connect it to an assistant

In Claude Code:

claude mcp add --transport http secretpass https://secretpass.com/mcp

In Cursor, add it to mcp.json:

{
  "mcpServers": {
    "secretpass": { "url": "https://secretpass.com/mcp" }
  }
}

Then ask something like: "Find current shoe offers in the US and compare the savings."

Call it directly

MCP over HTTP is JSON-RPC, so you can try it with curl:

curl -s -X POST https://secretpass.com/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"search_offers",
                 "arguments":{"query":"shoes","region":"us","limit":2}}}'

Each offer comes back as structured data. Trimmed, one result looks like this:

{
  "id": "us/48237228",
  "business": "Marion Parke",
  "title": "New pre-fall footwear",
  "region": "us",
  "category_name": "Retail & Gifts",
  "offer_display": {
    "product_type": "Shoes",
    "features": ["15% off the first order."]
  },
  "expires_at": null,
  "url": "https://secretpass.com/offer-item/us/48237228",
  "membership_required_to_unlock": true
}

Offers change and expire, so have your agent check expires_at and updated_at, and show the user the offer page instead of promising a saving.

A few tips for agents

  • Call list_filters first if you need exact brand or product type values.
  • Use limit and next_offset to page through results.
  • Use get_offer with an id to read an offer's conditions before comparing it with others.

Full documentation is at secretpass.com/mcp-api-docs. If you build something with it, we'd like to hear what's missing.

來源:DEV Community · dev.to