Grubhub MCP服务器
MCP(模型上下文协议)服务器,提供对Grubhub食品配送平台的编程访问。通过MCP工具搜索餐厅、浏览菜单、管理购物车、下订单和跟踪配送。
特性
- 搜索与发现 --使用自动补全功能按位置、菜肴或关键字查找餐厅
- 餐厅和菜单 --查看餐厅详情、完整菜单、项目选项和定价
- 购物车管理 --创建购物车、添加/删除商品、应用促销代码、设置提示
- 指令流 --下订单,实时跟踪交货情况,重新订购过去的餐点
- 账户管理 --管理个人资料、保存的地址、收藏夹和密码
- 支付 --查看已保存的付款方式,检查礼品卡余额
全部36个工具
| 类别 | 工具 |
|---|---|
| 认证 | login, logout, get_session_info, send_login_otp, verify_login_otp, create_account, send_password_reset |
| 搜索 | search_restaurants, autocomplete_search |
| 餐厅 | get_restaurant, get_menu, get_menu_item |
| 购物车 | create_cart, get_cart, add_to_cart, update_cart_item, remove_from_cart, apply_promo_code, set_tip |
| 订单 | place_order, get_order, get_order_history, track_order, reorder, post_delivery_tip |
| 账户 | get_profile, update_profile, get_addresses, add_address, get_favorites, add_favorite, remove_favorite, change_password |
| 支付 | get_payment_methods, get_gift_card_balance, apply_gift_card |
安装
Claude代码插件(推荐)
claude plugin marketplace add aserper/grubhub-mcp
claude plugin install grubhub-mcp@grubhub-marketplaceuvx(无需安装)
添加到您的Claude Code MCP设置中(~/.claude/settings.json):
{
"mcpServers": {
"grubhub": {
"command": "uvx",
"args": ["--from", "grubhub-mcp", "grubhub"]
}
}
}手册/来源
需要Python 3.11+。
git clone https://github.com/aserper/grubhub-mcp.git
cd grubhub-mcp
uv venv && source .venv/bin/activate
uv pip install -e .然后添加到 ~/.claude/settings.json:
{
"mcpServers": {
"grubhub": {
"command": "/path/to/grubhub-mcp/.venv/bin/grubhub"
}
}
}与其他MCP客户端一起使用
通过stdio运行服务器:
# With uvx (no install needed)
uvx --from grubhub-mcp grubhub
# Or from a local install
grubhub
# Or as a Python module
python -m grubhub_mcp认证
无需登录 用于浏览——无需帐户即可搜索餐厅、查看菜单和查看价格。服务器会自动创建匿名会话。
需要登录 对于订购、帐户管理和订单历史记录:
Use the login tool with my email and password支持电子邮件/密码登录和OTP(一次性密码)身份验证。
运作原理
API端点从Grubhub Android应用程序(v2026.11.1)中反向工程,通过使用jadx反编译APK并分析改装服务接口、OkHttp拦截器和数据模型。
关键技术细节:
- API基础:
https://api-gtm.grubhub.com - 认证:通过电子邮件/密码或匿名会话进行承载令牌
- 运输:REST/JSON适用于大多数端点,Protobuf适用于某些BFF服务
- 标头:模拟Android应用程序的请求标头,包括
x-gh-browser-id
项目结构
src/grubhub_mcp/
├── __init__.py
├── __main__.py # python -m entry point
├── server.py # MCP server setup and tool registration
├── client.py # HTTP client with auth and header management
├── auth.py # Authentication flows (login, anonymous, OTP, refresh)
└── tools/
├── auth.py # Auth tools (login, logout, OTP, account creation)
├── search.py # Restaurant search and autocomplete
├── restaurant.py # Restaurant details, menus, menu items
├── cart.py # Cart CRUD, promo codes, tips
├── order.py # Place orders, track, reorder, order history
├── account.py # Profile, addresses, favorites, password
└── payments.py # Payment methods, gift cards免责声明
这个项目是供教育和个人使用的。它不隶属于Grubhub或得到Grubhub的认可。按照Grubhub的服务条款负责任地使用。
许可证
麻省理工学院
