MA

Market Fiyati MCP Server — Turkish Grocery Comparison

Compare grocery prices across Turkish markets with the Market Fiyati MCP server to search, filter, and find the best deals quickly.

Quick Install
npx -y @mtcnbzks/market-fiyati-mcp-server

Overview

Market Fiyati MCP Server is an implementation of a Model Context Protocol (MCP) server tailored for comparing grocery prices across Turkish markets. It exposes a small set of tools and endpoints that let applications (including LLM-based agents) search items, fetch product details, list markets, and compare prices to help users find the best deals quickly.

This server is useful for developers building consumer price comparison apps, chatbots that answer “where is X cheapest?”, or agents that need up-to-date local grocery pricing as contextual tools. By following MCP conventions, the server can be plugged into agent architectures that dynamically call external tools to gather facts before responding.

Repository: https://github.com/mtcnbzks/market-fiyati-mcp-server

Features

  • Search grocery items across multiple Turkish markets
  • Retrieve product details (price history, unit prices, brand, category)
  • Compare prices for a product across markets
  • List markets and categories covered by the dataset
  • Lightweight MCP-compatible HTTP API for integration with agents or backend services
  • Docker and Node.js-friendly deployment options

Installation / Configuration

Prerequisites:

  • Node.js 18+ (or use Docker)
  • Optional: MongoDB or other datastore if using persistent data

Clone the repo and install dependencies:

git clone https://github.com/mtcnbzks/market-fiyati-mcp-server.git
cd market-fiyati-mcp-server
npm install

Environment variables (example .env):

PORT=3000
NODE_ENV=production
DATA_SOURCE=local         # or "mongo"
MONGO_URI=mongodb://localhost:27017/market-fiyati
LOG_LEVEL=info

Run locally:

npm run build
npm start
# or for development
npm run dev

Docker (build and run):

docker build -t market-fiyati-mcp .
docker run -p 3000:3000 \
  -e PORT=3000 \
  -e DATA_SOURCE=local \
  -e MONGO_URI='mongodb://mongo:27017/market-fiyati' \
  market-fiyati-mcp

Configuration notes:

  • DATA_SOURCE controls whether the server reads from a local static dataset or a database.
  • When using MongoDB, ensure the MONGO_URI points to a reachable database and the database contains expected collections (products, markets, price_history).
  • LOG_LEVEL can be set to debug for verbose output while developing.

Available Tools / Resources

The server exposes a small set of MCP-style tools (HTTP endpoints) that can be used by agents or other services:

  • /mcp/manifest — MCP manifest describing available tools and their schemas
  • /mcp/search — Search items by name, category, or market
  • /mcp/product/:id — Get detailed product information and price history
  • /mcp/compare — Compare a product across multiple markets
  • /mcp/markets — List markets and metadata
  • /mcp/categories — List available product categories

Example manifest fetch:

curl http://localhost:3000/mcp/manifest

Example search request:

curl -X POST http://localhost:3000/mcp/search \
  -H "Content-Type: application/json" \
  -d '{"query":"süt 1 litre","market":"migros","limit":5}'

Sample (abbreviated) search response:

{
  "results": [
    {"id":"p123","name":"Süt 1L - Brand A","market":"Migros","price":18.90},
    {"id":"p456","name":"Süt 1L - Brand B","market":"CarrefourSA","price":17.75}
  ]
}

Use Cases

  • LLM-integrated shopping assistant:

    • An LLM agent uses the MCP manifest to discover the search tool, queries for “en ucuz süt 1 litre”, and then calls compare to produce a recommendation with market links and prices.
  • Price-comparison website or mobile app:

    • Use /mcp/search to populate product search, /mcp/compare to show cheapest market for a selected product, and /mcp/product/:id to display price history and unit-price normalization.
  • Alert and analytics:

    • A backend job queries /mcp/product/:id periodically to detect price drops for specific items and sends notifications when a threshold is crossed.
  • Chatbot integration (Slack/Telegram):

    • Connect the bot to the MCP endpoints so users can ask “Fiyatı kimde en uygun — çay 500g?” and receive a concise market comparison.

Example Integration (Node.js client)

Basic example showing how a Node.js backend might call search and compare:

import fetch from "node-fetch";

async function findCheapest(query) {
  const searchRes = await fetch("http://localhost:3000/mcp/search", {
    method: "POST",
    headers: {"Content-Type": "application/json"},
    body: JSON.stringify({query, limit: 10})
  });
  const {results} = await searchRes.json();
  if (!results || results.length === 0) return null;

  const id = results[0].id;
  const cmpRes = await fetch("http://localhost:3000/mcp/compare", {
    method: "POST",
    headers: {"Content-Type": "application/json"},
    body: JSON.stringify({productId: id})
  });
  return await cmpRes.json();
}

Notes and Next Steps

  • The repository README contains implementation details and sample datasets — consult it for data formats and schema details.
  • If you plan to use the server in production, configure persistent storage and monitoring, and consider rate-limiting for public endpoints.
  • Contributing: open issues and pull requests on the GitHub repo linked above.
Tags:search