Skip to main content

menus-mcp:全球美食推荐 MCP Server

基于 462 道菜、41 个菜系的全球美食知识库做加权随机推荐。任何支持 Model Context Protocol(MCP)的 AI agent 均可使用,包括:

快速安装

也可在 MCP Registry 直接搜到本 server(io.github.spyyps/menus-recommender)。

方式 1:uvx(推荐,无需安装)

{
  "mcpServers": {
    "menus": {
      "command": "uvx",
      "args": ["menus-mcp"]
    }
  }
}

uvx 会自动从 PyPI 下载并运行,首次启动稍有延迟(数据加载约 1s),后续缓存到本地。

方式 2:pip install

pip install menus-mcp

然后在 MCP 客户端配置中:

{
  "mcpServers": {
    "menus": {
      "command": "menus-mcp"
    }
  }
}

方式 3:本地源码运行

git clone https://github.com/spyyps/recommend-dish
cd recommend-dish/mcp-server
pip install mcp          # 唯一依赖
# 运行入口
python3 -m menus_mcp

然后客户端配置:

{
  "mcpServers": {
    "menus": {
      "command": "python3",
      "args": ["-m", "menus_mcp"],
      "cwd": "/path/to/recommend-dish/mcp-server"
    }
  }
}

开放的工具

recommend_dishes

主推荐工具。参数(皆为可选):

参数 类型 默认 说明
count int 3 推荐数量
keywords str "" 逗号分隔的关键词(OR语义),见下方白名单
price_tier str "" 经济(≤20)/实惠(21-50)/中档(51-100)/高档(101-200)/奢华(>200)
max_price int 0 价格上限(CNY)
cuisine str "" 菜系名(如「川菜」「日本料理」)
geo str "" 地理大类(如「亚洲」「欧洲」)
exclude_ids str "" 逗号分隔的菜品 ID,用于换一批去重
seed int 0 随机种子(0=系统时间)

支持的关键词白名单:

  • 口味:麻辣、辣、甜、酸、咸、鲜
  • 食材:海鲜、牛肉、羊肉、猪肉、鸡肉、素食、牛油果
  • 类型:面食、米饭类、汤、甜品、烧烤、火锅、咖喱、汉堡披萨、饮品

否定注意:用户说「不要太辣」时不要传入 辣——传空即可。关键词做硬过滤,传入就会强制匹配。

返回示例(JSON):

{
  "dishes": [
    {"id": "cn_ch_001", "name": "麻婆豆腐", "name_en": "Mapo Tofu", "price": 38, "cuisine": "川菜", "region": "中华料理", "description": "嫩豆腐配牛肉末,以花椒和豆瓣酱炒制,麻辣鲜香"}
  ],
  "exhausted": false,
  "filters": {"count": 3, "keywords": ["辣"], "price_tier": "", "relaxed": false, ...},
  "candidate_pool_size": 54,
  "returned": 3
}

exhausted=true 表示候选池不足,应触发兜底链(放宽约束、网络搜索、LLM 常识)。

list_keywords

返回支持的关键词白名单。无参数。

兜底推荐

MCP server 仅负责第一层(本地知识库 + 加权随机)。当 exhausted=true 时,应自行按以下链兜底:

  1. 降级过滤:去掉价格约束,重试
  2. Web 搜索:查 "{用户原话} 推荐 菜品"
  3. LLM 常识:基于通用知识推荐,标注「非知识库菜品」

算法说明

  • 关键词硬过滤:用户传关键词时菜品必须至少匹配一个(OR)
  • 反偏置:权重 × 1/√(该菜系菜品数),防止大菜系压制小菜系
  • 多样性:同一菜系最多 ceil(count/3) 道
  • 价格松弛:候选不足时自动去价格档重试一次

发布

cd mcp-server
pip install build
python3 -m build
twine upload dist/*

详见 PyPI 发布指南。

Metadata

Release files for menus-mcp 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for menus-mcp 1.1.1
File Size Uploaded Provenance Actions
menus_mcp-1.1.1.tar.gz 86.5 kB Without provenance Details for menus_mcp-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for menus-mcp 1.1.1
File Interpreter ABI Platform Actions
menus_mcp-1.1.1-py3-none-any.whl Python 3 none any Details for menus_mcp-1.1.1-py3-none-any.whl

Total release size: 178.2 kB

Security for menus-mcp 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page