Skip to main content
Glama

AIDataNordic — Food Recipe MCP

一个用于食谱的生产级语义搜索服务器——专为使用模型上下文协议 (MCP) 的 AI 智能体构建。通过混合稠密 + 稀疏检索和交叉编码器重排序,搜索超过 50,000 份食谱。


这是什么

一个自托管的 MCP 服务器,通过语义搜索公开食谱数据集。智能体可以通过自然语言进行查询,按饮食、难度、时间和份量进行过滤,并获得包含配料、说明和营养信息的排名结构化食谱数据。

专为通过 HTTP 使用 FastMCP 3.2 进行自主机器对机器消费而设计。


架构

Query (natural language)
        ↓
  Dense embedding          Sparse embedding
  (e5-large-v2)            (BM25 / fastembed)
        ↓                        ↓
       Qdrant — Hybrid Fusion (RRF)
                    ↓
          Cross-encoder reranking
          (mmarco-mMiniLMv2-L12-H384-v1)
                    ↓
          Structured JSON response
                    ↓
           MCP tool / AI agent

数据覆盖范围

字段

详情

食谱总数

50,000+

来源

food.com 及其他

字段

title, description, ingredients, instructions, nutrition, rating, difficulty, diet, total_time, servings

饮食标签

vegetarian, vegan, gluten-free, dairy-free

难度

easy, medium, hard


技术栈

搜索

  • 稠密嵌入:intfloat/e5-large-v2 (1024 维)

  • 稀疏嵌入:Qdrant/bm25 (通过 fastembed)

  • 融合:Qdrant 中的倒数排名融合 (RRF)

  • 重排序器:cross-encoder/mmarco-mMiniLMv2-L12-H384-v1

服务

  • 通过 HTTP 的 FastMCP 3.2 (/mcp 端点)

  • 兼容 Claude、LangChain 以及任何支持 MCP 的智能体

基础设施

  • Ubuntu Server 24 LTS,自托管

  • Qdrant 向量数据库 (自托管)


MCP 工具

search_recipes(
    query="quick chicken pasta",       # required — natural language
    diet="vegetarian",                 # optional: vegetarian, vegan, gluten-free, dairy-free
    difficulty="easy",                 # optional: easy, medium, hard
    max_minutes=30,                    # optional: maximum total time in minutes
    servings=4,                        # optional: number of servings
    limit=5                            # optional: number of results (default 5)
)
# Returns semantically ranked recipes with ingredients, instructions, nutrition, and ratings

示例响应

[
  {
    "rerank_score": 7.96,
    "title": "quick and easy chicken pasta salad",
    "description": "great use for left-over chicken.",
    "total_time": 25,
    "difficulty": "medium",
    "diet": [],
    "main_ingredient": "chicken",
    "ingredients": ["cooked chicken", "pasta shells", "tomatoes", "italian dressing"],
    "instructions": ["combine ingredients", "pour dressing", "chill 1 hour"],
    "nutrition": {"calories": 424, "protein_g": 26, "carbs_g": 38.5, "fat_g": 19.5},
    "rating": 4.8,
    "rating_count": 5
  }
]

快速入门

1. 安装依赖

pip install -r requirements.txt

2. 启动服务器

python recipe_mcp_server.py

服务器启动于 http://localhost:8004/mcp

3. 使用 FastMCP 客户端连接

import fastmcp, asyncio

async def main():
    async with fastmcp.Client("http://localhost:8004/mcp") as client:
        result = await client.call_tool("search_recipes", {
            "query": "quick chicken pasta",
            "max_minutes": 30,
            "limit": 3
        })
        for recipe in result.structured_content["result"]:
            print(recipe["title"], "-", recipe["total_time"], "min")

asyncio.run(main())

4. 使用 Claude Desktop 连接

添加到你的 claude_desktop_config.json

{
  "mcpServers": {
    "food-recipes": {
      "url": "https://recipes.aidatanorge.no/mcp"
    }
  }
}

在线演示

recipes.aidatanorge.no 尝试搜索界面


文件

文件

描述

recipe_mcp_server.py

带有混合搜索的 FastMCP 服务器

mcp_client.py

Python 客户端示例

requirements.txt

Python 依赖项


作为 AIDataNordic 的一部分构建和运营——为自主智能体提供的自托管 AI 数据基础设施。

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - A tier

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/AIDataNordic/Food-Recipe-MCP'

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