Half Price MCP icon
AI

Half Price MCP

Let AI agents search weekly supermarket deals.

readchunkstext → vectorupsertColesWoolworthsScraperhalf-price dealsS3~2,500 dealsManual startrun by handStep Functionssplits into chunksIngest Lambdaclean · embed · upsertAmazon BedrockTitan V2Aurorapgvector

1/6 Collect

A scraper reads the half-price deals from Coles and Woolworths. It writes them to a JSON file.

🔎

Hybrid search

The search_deals tool takes a text query. It joins vector search and full-text search in one SQL query. A retailer filter and a maximum price are optional.

🧠

Embeddings in Postgres

Titan Text Embeddings V2 on Bedrock makes the vectors. Aurora PostgreSQL with pgvector stores them. An HNSW index finds the nearest deals.

🧾

Prices only from data

Each deal has a retailer, a price, valid dates, and a source URL. Each result has an as_of date. A model never creates a price.

🛡️

Prompt injection defense

Text from store websites is data. The ingest step cleans it. Each tool description tells the agent to not follow instructions in it.

☁️

Serverless on AWS

AWS Lambda functions run in Sydney (ap-southeast-2). API Gateway exposes the MCP server over HTTPS.

🔁

Repeatable ingest

A scraper writes the weekly deals to a JSON file. The ingest function cleans, embeds, and upserts them. A second run adds no duplicates.

Half Price MCP is an MCP server. An AI agent calls it to find half-price deals at Coles and Woolworths. The server turns each deal into an embedding and keeps it in a vector database. With these results, an agent can plan a shopping basket or suggest when to buy an item. I built it to show a full AI system on AWS: data collection, retrieval, and a tool interface.

The server uses MCP over streamable HTTP. The URL is https://halfprice.terrydo.dev/mcp. No token or account is needed.

  1. Claude Code

    Run this command.

    Terminal
    claude mcp add --transport http half-price https://halfprice.terrydo.dev/mcp
  2. Other MCP clients

    Add this entry to the MCP configuration file of your client. For Claude Code, the file is .mcp.json. Other clients can use a different file name or key names.

    .mcp.json
    {  "mcpServers": {    "half-price": {      "type": "http",      "url": "https://halfprice.terrydo.dev/mcp"    }  }}
  3. Test with MCP Inspector

    Run the Inspector. Select the Streamable HTTP transport. Enter the URL. Then call the search_deals tool.

    Terminal
    npx @modelcontextprotocol/inspector
  4. Use the tool

    The server has one tool: search_deals. It takes a query. The retailer and max_price arguments are optional. Each result has an as_of date. Each deal has a retailer, a price, valid dates, and a source URL. Try this prompt:

    Prompt
    Find coffee deals at half price. Plan a basket for under $40 and tell me which items to buy this week.
Python 3.12MCP (streamable HTTP)AWS LambdaAPI GatewayAurora PostgreSQLpgvectorAmazon BedrockTitan Text Embeddings V2PydanticDocker