Agentic Swiggy MCP Server
Agentic Swiggy MCP Server
一个高度模块化、非确定性的代理式模型上下文协议(MCP)服务器,模拟食品配送助手(如 Swiggy)。该服务器基于 LangGraph、FastMCP 和 ChromaDB 构建,利用智能 ReAct 代理动态路由任务、回答问题、提供推荐,并通过 人在回路(HITL) 工作流安全地执行食品订单。
核心特性
非确定性 ReAct 代理:代理根据对话上下文动态决定使用哪些工具,无需硬编码工作流。
人在回路(HITL):订单下达会被安全拦截。代理会暂停执行,在完成任何真实交易前请求人工授权。
多格式 RAG 摄取:一个解耦的摄取管道,可统一解析
.json、.csv、.md、.txt和.pdf文件到本地 ChromaDB 向量存储中。上下文感知推荐:根据用户当前地理位置和时段,动态评估并推荐前 3 个食品。
模型上下文协议(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-dotenv2. 配置环境变量
在根目录创建 .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_here3. 初始化向量数据库
在运行代理之前,先摄取合成数据以构建本地 ChromaDB 向量存储:
python src/ingestion.py使用方法
选项 1:运行交互式代理演示
通过终端测试 LangGraph 代理和人在回路订单工作流:
python main.py尝试类似这样的提示:"你好,我是位于 Koramangala 的 USR_500,现在是 21:00。附近有什么好吃的?查看评论了解大家的评价,如果评分不错,就点 1 份送到 5th Block。"
选项 2:启动 MCP 服务器
要将工具暴露给兼容 MCP 的客户端(如 Claude Desktop 或外部应用):
python src/mcp_server.py工具参考
工具名称 | 描述 | 输出 |
| 下单购买食品。触发图中断,要求用户进行 | JSON 确认 |
| 根据 | JSON 数组 |
| 检索特定用户 ID 的活动及历史订单数据。 | JSON 字典 |
| 对评论、菜单和平台政策执行 RAG 语义搜索。 | Markdown 文本 |
许可证
MIT 许可证
This server cannot be installed
Maintenance
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
- FlicenseNot gradedqualityDmaintenanceA proof-of-concept Model Context Protocol server that enables LLM applications to interact with Uber Eats, allowing AI agents to browse and order food through natural language.235
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to order food from TGO Yemek by browsing restaurants, managing carts, and completing checkouts. It allows users to handle address selection and order tracking directly through natural language interactions.3714MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to discover restaurants and place food delivery orders on Uber Eats and Thuisbezorgd (Just Eat Takeaway). It provides tools for restaurant discovery and order management through normalized platform APIs.22MIT
- AlicenseAqualityDmaintenanceMCP server for Chipotle — let AI agents find locations, browse menus, build custom orders, and checkout for pickup or delivery.41850MIT
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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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