Skip to main content
Glama
alessmar

cooklang-mcp-server

by alessmar

cooklang-mcp-server

MCP Version Python License: MIT

一个轻量的 FastMCP 服务器,它将 CookCLI 食谱服务器(cook server,随 ghcr.io/cooklang/cookcli 一同发布)以 MCP 工具的形式暴露给编码代理。借助它,代理可以通过 CookCLI HTTP API 浏览、读取、写入、删除和搜索 Cooklang 食谱。

你需要这个吗?

当食谱通过 HTTP 访问时使用此服务器:例如 cook server 运行在另一台机器或 NAS 上,或者像 Claude Desktop 这样没有 shell 访问权限的 MCP 客户端。

如果食谱是本地文件,且代理可以运行命令(Claude Code、Codex),那么官方的 cooklang-skills 插件更合适。它直接驱动 cook CLI,且覆盖面更广:膳食规划、食材库存跟踪、按过道分组的购物清单、导出等。

Related MCP server: Nextcloud Cookbook MCP Server

工作原理

每个 MCP 工具与 CookCLI HTTP 端点一一对应(read_recipe -> GET /api/recipes/{path},依此类推)。此服务器是一个无状态适配器:它不保存数据、不进行解析,并且需要单独运行一个 cook server 进程(参见要求)。所有食谱都存放在 CookCLI 的食谱目录中。

工具

工具

映射到

用途

list_recipes()

GET /api/recipes

完整食谱树(文件夹 + .cook / .menu 文件)

read_recipe(path, scale=1.0)

GET /api/recipes/{path}

将单个食谱解析为食材、厨具、定时器和步骤

read_recipe_source(path)

GET /api/recipes/raw/{path}

原始 Cooklang 源代码,包含 frontmatter

write_recipe(path, source)

PUT /api/recipes/{path}

根据原始 Cooklang 文本创建或覆盖食谱

delete_recipe(path)

DELETE /api/recipes/{path}

永久删除食谱文件(无撤销,无回收站)

search_recipes(query)

GET /api/search?q=

对食谱名称和内容进行全文搜索

collection_stats()

GET /api/stats

食谱集计数(recipe_countmenu_count、食材库存计数)

path 相对于 CookCLI 服务器的食谱目录,例如 Dolci/bunet-piemontese.cook 扩展名可选)。write_recipe 要求父文件夹已存在,并以原子方式写入(临时文件 + 重命名)。标题图片无法通过 HTTP 写入:请将它们放在食谱目录(或 Docker 卷)中 .cook 文件的旁边。

要求

  • Python >= 3.10 和 uv

  • 正在运行的 CookCLI 服务器,例如:

    docker run -d --name cooklang-cookcli-1 -p 9080:9080 \
      -v cooklang_recipes:/recipes \
      ghcr.io/cooklang/cookcli server --host 0.0.0.0 /recipes

    或者,在本地安装了 CookCLI 的情况下,运行 cook server ./my-recipes

在 Claude Code 中注册

无需克隆。uvx 会直接从该仓库获取、构建并缓存服务器:

claude mcp add cooklang \
  --env COOKLANG_SERVER_URL=http://localhost:9080 \
  -- uvx --from git+https://github.com/alessmar/cooklang-mcp-server cooklang-mcp-server

或者在 .mcp.json / ~/.claude.json 中:

{
  "mcpServers": {
    "cooklang": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/alessmar/cooklang-mcp-server",
               "cooklang-mcp-server"],
      "env": { "COOKLANG_SERVER_URL": "http://localhost:9080" }
    }
  }
}

COOKLANG_SERVER_URL 默认为 http://localhost:9080。要固定版本,请在 git URL 末尾追加 @<tag>,例如 ...cooklang-mcp-server@v0.1.0

本地开发

git clone https://github.com/alessmar/cooklang-mcp-server
cd cooklang-mcp-server
uv sync
COOKLANG_SERVER_URL=http://localhost:9080 uv run cooklang-mcp-server

说明

  • CookCLI 服务器没有认证且开放 CORS:请将其保持在 localhost 或可信的局域网内。

  • 在当前 CookCLI 中,/ api/reload 是空操作:服务器会在每次请求时从磁盘读取,因此通过 API 之外所做的文件更改会立即生效。

许可证

MIT。参见 LICENSE

Install Server
A
license - permissive license
A
quality
B
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

  • Free public MCP for AI agents — 193 tools, 44 workflows. No API key.

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

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/alessmar/cooklang-mcp-server'

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