Skip to main content
Glama
Market Fiyatı MCP Server

Market Fiyatı MCP Server

by aigile-era

Market Fiyatı MCP Server

Market Fiyatı API'si için Model Context Protocol (MCP) server ve Gemini AI entegrasyonu.

🚀 Özellikler

  • MCP Server: Model Context Protocol desteği

  • Gemini AI: Google Gemini AI entegrasyonu

  • Market API: Market Fiyatı API entegrasyonu

  • Express API: Mobil uygulama için REST API

  • TypeScript: Tam tip güvenliği

  • Akıllı Öneriler: AI destekli ürün önerileri

Related MCP server: Bargainer MCP Server

📦 Kurulum

Gereksinimler

  • Node.js 18+

  • npm veya yarn

  • Gemini AI API Key

Adımlar

  1. Bağımlılıkları yükle:

npm install
  1. Çevre değişkenlerini ayarla:

# .env dosyası oluştur
GEMINI_API_KEY=AIzaSyDPk3L-PUmd6vgqkFfutz1ETU1EQOg2CLs
MARKET_API_BASE_URL=https://api.marketfiyati.org.tr/api/v2
PORT=3000
NODE_ENV=development
  1. Projeyi derle:

npm run build
  1. Server'ı başlat:

# MCP Server
npm start

# Express API Server (mobil uygulama için)
npm run dev

🛠️ MCP Araçları

1. search_products

Ürün arama işlemi yapar.

Parametreler:

  • keywords (string): Aranacak ürün anahtar kelimeleri

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

  • distance (number, opsiyonel): Arama mesafesi (km)

  • size (number, opsiyonel): Sonuç sayısı

2. search_by_id

Ürün ID'si ile arama yapar.

Parametreler:

  • productId (string): Ürün ID'si

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

3. compare_prices

Ürün fiyatlarını karşılaştırır.

Parametreler:

  • productId (string): Karşılaştırılacak ürün ID'si

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

4. find_cheapest

En ucuz ürünleri bulur.

Parametreler:

  • keywords (string): Aranacak ürün anahtar kelimeleri

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

5. filter_by_market

Belirli markete göre ürünleri filtreler.

Parametreler:

  • keywords (string): Aranacak ürün anahtar kelimeleri

  • marketName (string): Market adı (bim, sok, a101, migros, vb.)

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

6. get_ai_recommendations

AI destekli ürün önerileri alır.

Parametreler:

  • userQuery (string): Kullanıcının sorusu veya isteği

  • keywords (string): Aranacak ürün anahtar kelimeleri

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

7. analyze_prices

Fiyat analizi yapar ve AI önerisi verir.

Parametreler:

  • productId (string): Analiz edilecek ürün ID'si

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

8. generate_shopping_list

AI destekli alışveriş listesi oluşturur.

Parametreler:

  • items (array): Alışveriş listesindeki ürünler

  • budget (number, opsiyonel): Bütçe (TL)

  • preferences (array, opsiyonel): Kullanıcı tercihleri

9. compare_markets

Marketleri karşılaştırır ve AI analizi verir.

Parametreler:

  • keywords (string): Karşılaştırma için ürün anahtar kelimeleri

  • latitude (number): Kullanıcı enlem koordinatı

  • longitude (number): Kullanıcı boylam koordinatı

10. chat

AI ile genel sohbet.

Parametreler:

  • message (string): Kullanıcı mesajı

  • context (object, opsiyonel): Ek bağlam bilgisi

🌐 REST API Endpoints

Ürün İşlemleri

  • POST /api/search - Ürün arama

  • POST /api/search-by-id - ID ile ürün arama

  • POST /api/compare-prices - Fiyat karşılaştırma

  • POST /api/cheapest - En ucuz ürünler

  • POST /api/filter-by-market - Market filtresi

  • POST /api/nearby-markets - Yakın marketler

AI İşlemleri

  • POST /api/ai/recommendations - AI önerileri

  • POST /api/ai/analyze-prices - Fiyat analizi

  • POST /api/ai/shopping-list - Alışveriş listesi

  • POST /api/ai/compare-markets - Market karşılaştırması

  • POST /api/ai/chat - AI sohbet

Sistem

  • GET /health - Sistem durumu

📱 Mobil Uygulama Entegrasyonu

Örnek Kullanım

// Ürün arama
const searchProducts = async (keywords, latitude, longitude) => {
  const response = await fetch('http://localhost:3000/api/search', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      keywords,
      latitude,
      longitude,
      distance: 5,
      size: 24
    })
  });
  
  return await response.json();
};

// AI önerisi alma
const getAIRecommendations = async (userQuery, keywords, latitude, longitude) => {
  const response = await fetch('http://localhost:3000/api/ai/recommendations', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      userQuery,
      keywords,
      latitude,
      longitude
    })
  });
  
  return await response.json();
};

// Fiyat karşılaştırması
const comparePrices = async (productId, latitude, longitude) => {
  const response = await fetch('http://localhost:3000/api/compare-prices', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      productId,
      latitude,
      longitude
    })
  });
  
  return await response.json();
};

🤖 AI Özellikleri

Gemini AI Entegrasyonu

  • Ürün Önerileri: Kullanıcı ihtiyaçlarına göre akıllı öneriler

  • Fiyat Analizi: Detaylı fiyat analizi ve tasarruf önerileri

  • Alışveriş Listesi: Bütçe dostu alışveriş listesi oluşturma

  • Market Karşılaştırması: Marketlerin avantaj/dezavantaj analizi

  • Sohbet: Genel market ve alışveriş danışmanlığı

AI Prompt Örnekleri

  • "En ucuz patates nerede?"

  • "100 TL bütçeyle haftalık alışveriş listesi oluştur"

  • "BIM ve A101'i karşılaştır"

  • "Hangi marketten alışveriş yapmalıyım?"

🏗️ Proje Yapısı

src/
├── types/           # TypeScript tip tanımları
│   └── market.ts
├── services/        # Servis sınıfları
│   ├── marketApi.ts
│   └── geminiService.ts
├── mcp/            # MCP server
│   └── server.ts
├── api/            # Express API
│   └── express-server.ts
└── index.ts        # Ana giriş dosyası

🔧 Geliştirme

Scripts

npm run build      # TypeScript derleme
npm run dev        # Geliştirme modu
npm start          # Üretim modu
npm test           # Testleri çalıştır

Linting ve Formatting

npm run lint       # ESLint kontrolü
npm run format     # Prettier formatting

📊 Örnek Veri Yapıları

Ürün Arama Sonucu

{
  "numberOfFound": 52,
  "searchResultType": 1,
  "content": [
    {
      "id": "00000000010CO",
      "title": "Patates",
      "brand": "Markasız",
      "imageUrl": "https://cdn.cimri.io/market/500x500/-_185267.jpg",
      "refinedVolumeOrWeight": "1 kg",
      "productDepotInfoList": [
        {
          "depotId": "tarim_kredi-6761",
          "depotName": "Samsun Atakum Körfez",
          "price": 19.9,
          "unitPrice": "19,90 ₺/kg",
          "marketAdi": "tarim_kredi",
          "longitude": 36.2287,
          "latitude": 41.36649
        }
      ]
    }
  ]
}

AI Önerisi

{
  "recommendation": "Size en uygun patates seçenekleri...",
  "products": [...]
}

🚀 Deployment

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist ./dist
EXPOSE 3000
CMD ["node", "dist/index.js"]

Environment Variables

GEMINI_API_KEY=your_gemini_api_key
MARKET_API_BASE_URL=https://api.marketfiyati.org.tr/api/v2
PORT=3000
NODE_ENV=production

📝 Lisans

MIT License

🤝 Katkıda Bulunma

  1. Fork yapın

  2. Feature branch oluşturun (git checkout -b feature/amazing-feature)

  3. Commit yapın (git commit -m 'Add amazing feature')

  4. Push yapın (git push origin feature/amazing-feature)

  5. Pull Request oluşturun

📞 İletişim

Proje hakkında sorularınız için issue açabilirsiniz.


Market Fiyatı MCP Server - Akıllı alışveriş deneyimi için AI destekli market fiyat karşılaştırma sistemi.

Available Tools

10 tools
analyze_pricesC

Fiyat analizi yapar ve AI önerisi verir

Inputs: latitude (required), longitude (required), productId (required).

chatC

AI ile genel sohbet

Inputs: message (required), context.

compare_marketsC

Marketleri karşılaştırır ve AI analizi verir

Inputs: keywords (required), latitude (required), longitude (required).

compare_pricesC

Ürün fiyatlarını karşılaştırır

Inputs: latitude (required), longitude (required), productId (required).

filter_by_marketC

Belirli markete göre ürünleri filtreler

Inputs: keywords (required), latitude (required), longitude (required), marketName (required).

find_cheapestC

En ucuz ürünleri bulur

Inputs: keywords (required), latitude (required), longitude (required).

generate_shopping_listC

AI destekli alışveriş listesi oluşturur

Inputs: items (required), budget, preferences.

get_ai_recommendationsC

AI destekli ürün önerileri alır

Inputs: keywords (required), latitude (required), longitude (required), userQuery (required).

search_by_idC

Ürün ID'si ile arama yapar

Inputs: latitude (required), longitude (required), productId (required).

search_productsD

Ürün arama işlemi yapar

Inputs: keywords (required), latitude (required), longitude (required), size, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.5/5.0

    Scored across 10 tools

    Disambiguation2/5

    Several tools have overlapping functionality, particularly around AI recommendations (get_ai_recommendations, analyze_prices, compare_markets) and price comparison (compare_prices, find_cheapest, analyze_prices). While search tools are distinct, the boundaries between analysis tools are unclear.

    Naming Consistency4/5

    Most tools follow a verb_noun snake_case pattern (search_products, compare_prices, filter_by_market). Minor deviations include 'chat' (verb only) and 'find_cheapest' (verb + adjective), but overall the convention is consistent.

    Tool Count4/5

    10 tools is appropriate for a market price comparison server, though there is some redundancy in the AI-related tools. The count is within a reasonable range and each tool has a stated purpose.

    Completeness4/5

    The server covers search, price comparison, filtering, and AI-driven analysis. It lacks explicit product detail retrieval beyond search_by_id and has no price history or alert features, but the core workflows for price comparison are present.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server enabling product searches across e-commerce platforms, price history tracking, and product specification-based searches using natural language prompts.
      2
      142 PyPI
      19
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that aggregates and compares deals from multiple sources including Slickdeals, RapidAPI marketplace, and web scraping, enabling users to search, filter, and compare deals through a chat interface.
      6
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that enables real-time product, price, and stock searching across major Turkish electronic component retailers including Robotistan, Robocombo, Direnc.net, and Robo90. It allows AI models to compare local market data to find the best deals and available components.
      4
      MIT