Skip to main content
Glama
Ichibu013

Agentic Swiggy MCP Server

by Ichibu013

エージェント型 Swiggy MCP サーバー

Python LangChain LangGraph FastMCP ChromaDB

フードデリバリーアシスタント(Swiggy など)を模した、高度にモジュール化された非決定的なエージェント型 Model Context Protocol (MCP) サーバーです。LangGraphFastMCPChromaDB で構築されており、インテリジェントな ReAct エージェントを活用して、タスクの動的なルーティング、質問への回答、レコメンデーションの提供、そして Human-in-the-Loop (HITL) ワークフローによる安全なフード注文の実行を行います。


主な機能

  • 非決定的 ReAct エージェント: エージェントはハードコードされたワークフローなしに、会話コンテキストに基づいて使用するツールを動的に決定します。

  • Human-In-The-Loop (HITL): 注文処理は安全にインターセプトされます。エージェントは実際の取引を確定する前に、人間の承認を求めて実行を一時停止します。

  • マルチフォーマット RAG インジェスト: .json.csv.md.txt.pdf ファイルをユニバーサルに解析し、ローカルの ChromaDB ベクターストアに取り込む、分離されたインジェストパイプラインです。

  • コンテキストに基づくレコメンデーション: ユーザーの現在の地理的位置と時刻に基づいて動的に評価された、上位 3 件のフードアイテムを推奨します。

  • Model Context Protocol (MCP): エージェントの機能を標準化された MCP ツールとして公開し、最新の LLM クライアント(Claude Desktop など)から検出・利用可能にします。

  • 100% ローカル埋め込み: コスト不要でオフラインのベクター埋め込みを実現する、HuggingFace sentence-transformers の組み込みサポートを提供します。


Related MCP server: Food402

プロジェクト構造

swiggy_agent/
├── data/
│   ├── restaurants_menu.json        # Restaurant catalog & timings
│   ├── order_history.json           # Past & active order records
│   ├── food_reviews.csv             # Customer reviews & sentiment
│   └── platform_policies.md         # Packaging & late-night guidelines
├── src/
│   ├── ingestion.py                 # Multi-format universal data ingestor
│   ├── tools/
│   │   ├── __init__.py
│   │   ├── order_tool.py            # Tool 1: Order Food (HITL sensitive)
│   │   ├── recommendation_tool.py   # Tool 2: Geo/Time Recommendations
│   │   ├── history_tool.py          # Tool 3: Order tracking & history
│   │   └── rag_tool.py              # Tool 4: Review retrieval RAG
│   ├── agent.py                     # Non-deterministic LangGraph agent + HITL
│   └── mcp_server.py                # FastMCP Server exposing tools
├── requirements.txt
├── .env                             # Environment variables (API Keys)
└── main.py                          # Entry point for interactive CLI testing

セットアップとインストール

1. 依存関係のインストール

Python 3.10 以上がインストールされていることを確認してください。必要なパッケージをインストールします:

pip install -r requirements.txt
# Alternatively, install manually:
pip install mcp langchain langchain-openai langchain-huggingface langchain-chroma langgraph chromadb sentence-transformers python-dotenv

2. 環境変数の設定

ルートディレクトリに .env ファイルを作成し、LLM API キー(例: Google Gemini、OpenAI、Groq)を追加します:

# Example using Google Gemini (Recommended for free tier)
GEMINI_API_KEY=your_api_key_here

# Example using OpenAI (If applicable)
# OPENAI_API_KEY=your_api_key_here

3. ベクターデータベースの初期化

エージェントを実行する前に、合成データを取り込んでローカルの ChromaDB ベクターストアを構築します:

python src/ingestion.py

使用方法

オプション 1: インタラクティブエージェントデモの実行

ターミナルで LangGraph エージェントと Human-in-the-Loop 注文ワークフローをテストします:

python main.py

*次のようなプロンプトを試してください: 「こんにちは、私は Koramangala にいる USR_500 です。時刻は 21:00 です。この辺りで何かおいしいものはありますか? 人々の意見をレビューで確認して、評価が良ければ 1 人前を 5th Block に注文してください。」

オプション 2: MCP サーバーの起動

ツールを MCP 互換クライアント(Claude Desktop や外部アプリなど)に公開するには:

python src/mcp_server.py

ツールリファレンス

ツール名

説明

出力

order_food

フードの注文を行います。ユーザーからの "yes" 承認を必要とするグラフ割り込みをトリガーします。

JSON 確認

get_top_3_food

locationcurrent_time に基づいて地元のレストランを評価し、最適なオプションを提案します。

JSON 配列

get_order_status_and_history

特定のユーザー ID のアクティブな注文データと過去の注文データを取得します。

JSON 辞書

query_food_reviews_and_policies

レビュー、メニュー、プラットフォームポリシーに対して RAG セマンティック検索を実行します。

Markdown テキスト


ライセンス

MIT ライセンス

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ichibu013/Swiggy-Agentic-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server