Skip to main contentSkip to navigation
← Back to documentation

MCP Integration

BuyWhere works natively with Claude Desktop, Cursor, Windsurf, and any Model Context Protocol (MCP)(https://modelcontextprotocol.io/) client. This guide…

AI Agent Integration via MCP

BuyWhere works natively with Claude Desktop, Cursor, Windsurf, and any Model Context Protocol (MCP) client. This guide shows you how to set it up.

What You Get

Once connected, your AI agent has access to these tools:

ToolDescription
search_productsKeyword search with country, category, price, and brand filters
get_productFetch full product details by UUID
compare_productsSide-by-side comparison of 2–10 products
get_dealsFind discounted products
list_categoriesBrowse the product category taxonomy
find_best_priceLocate the cheapest option across all merchants

Setup: Claude Desktop

  1. Get a BuyWhere API key at buywhere.ai/api-keys

  2. Open your Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add the BuyWhere MCP server:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": {
        "BUYWHERE_API_KEY": "bw_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}
  1. Restart Claude Desktop.

Setup: Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": {
        "BUYWHERE_API_KEY": "bw_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Setup: Claude Code

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": {
        "BUYWHERE_API_KEY": "bw_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Try It

Once connected, ask your AI agent:

"Find me the cheapest wireless headphones in Singapore under $200"

"Compare the Sony WH-1000XM5 with the Bose QuietComfort Ultra"

"What are the best electronics deals right now?"

"Track the price history for this laptop over the last 30 days"

The agent will automatically use BuyWhere's tools to search products, compare prices, and find deals.

Using the TypeScript SDK

For programmatic agent integrations, use the TypeScript SDK:

npm install @buywhere/sdk

const client = new BuyWhereClient({
  apiKey: process.env.BUYWHERE_API_KEY,
});

const results = await client.search.search({
  q: "mechanical keyboard",
  country_code: "SG",
  limit: 5,
});

console.log(results.products);

Using the LangChain Integration

npm install @buywhere/buywhere-langchain

const tools = new BuyWhereTools({
  apiKey: process.env.BUYWHERE_API_KEY,
});

// Use with any LangChain agent
const agent = createAgent({
  tools: tools.getTools(),
  // ...
});

OpenAI Function Calling

Use the OpenAPI spec directly for OpenAI function calling:

GET https://api.buywhere.ai/openapi.json

A ChatGPT Actions-compatible version is available at:

GET https://api.buywhere.ai/chatgpt-openapi.json

Discovery Endpoints

BuyWhere exposes standard discovery endpoints for AI agent platforms:

EndpointPurpose
/.well-known/ai-plugin.jsonOpenAI plugin manifest
/.well-known/mcp.jsonMCP server manifest
/.well-known/glama.jsonGlama.ai agent discovery
/openapi.jsonOpenAPI 3.1 spec
/chatgpt-openapi.jsonChatGPT Actions spec
/llms.txtLLM-readable service description

Next Steps

Get the best deals weekly

Price drops, new markets, and AI shopping tips — straight to your inbox.