weekplan-mcp-server

weekplan-mcp-server

MCP server enabling AI assistants to manage recipes and ingredients in the WeekPlan app via its REST API.

Category
访问服务器

README

WeekPlan MCP Server

An MCP (Model Context Protocol) server that gives AI assistants like Claude the ability to manage recipes and ingredients in your WeekPlan app via its REST API. See WeekPlan for the main app. See WeekPlan Watch for an Apple Watch companion app.

What It Does

Once connected, Claude can:

  • List, add, and delete ingredients (name + unit)
  • List, add, and delete recipes (name, ingredients with quantities, and step-by-step instructions)
  • Automatically create missing ingredients when adding a recipe

Prerequisites

  • Node.js 18+Download here
  • A running WeekPlan API server (defaults to http://localhost:3000)

Installation

Option 1 — Clone and build (recommended for local development)

git clone <your-repo-url> weekplan-mcp-server
cd weekplan-mcp-server
npm install
npm run build

The compiled server will be at dist/index.js.

Option 2 — Install globally from npm (once published)

npm install -g weekplan-mcp-server

This makes the weekplan-mcp-server command available system-wide.


Configuration

The server is configured via a single environment variable:

Variable Default Description
WEEKPLAN_URL http://localhost:3000 Base URL of your WeekPlan REST API

Adding to Claude Code

Run the following command to register the server with Claude Code:

claude mcp add weekplan-mcp-server -e WEEKPLAN_URL=http://localhost:3000 -- node /absolute/path/to/weekplan-mcp-server/dist/index.js

Replace /absolute/path/to/weekplan-mcp-server with the actual path where you cloned the repo.

Or edit ~/.claude.json to add it to a specific project.

Or edit claude_desktop_config.json directly (see the Claude Desktop section below — the format is the same).


Adding to Claude Desktop

Edit your Claude Desktop config file:

  • macOS: ~/Library/'Application Support'/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add the server under mcpServers:

{
  "mcpServers": {
    "weekplan": {
      "command": "node",
      "args": ["/absolute/path/to/weekplan-mcp-server/dist/index.js"],
      "env": {
        "WEEKPLAN_URL": "http://localhost:3000"
      }
    }
  }
}

Restart Claude Desktop after saving the file.


Adding to Cursor

Open Cursor settings and navigate to Features → MCP Servers, then add:

{
  "weekplan": {
    "command": "node",
    "args": ["/absolute/path/to/weekplan-mcp-server/dist/index.js"],
    "env": {
      "WEEKPLAN_URL": "http://localhost:3000"
    }
  }
}

Adding to VS Code (Copilot / MCP extension)

In your .vscode/mcp.json or user settings:

{
  "servers": {
    "weekplan": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/weekplan-mcp-server/dist/index.js"],
      "env": {
        "WEEKPLAN_URL": "http://localhost:3000"
      }
    }
  }
}

Available Tools

Ingredients

Tool Description Parameters
weekplan_list_ingredients List all ingredients (none)
weekplan_add_ingredient Add or update an ingredient name (string), unit (string)
weekplan_delete_ingredient Delete an ingredient id (string)

Recipes

Tool Description Parameters
weekplan_list_recipes List all recipes (none)
weekplan_add_recipe Add or update a recipe name (string), ingredients (array), steps (array of strings)
weekplan_delete_recipe Delete a recipe id (string)

The ingredients array in weekplan_add_recipe accepts objects with:

  • ingredientName — name of the ingredient (created automatically if missing)
  • quantity — numeric amount
  • unit — unit of measurement (e.g. "g", "ml", "tbsp")

IDs are generated automatically from names (e.g. "Olive Oil""olive-oil"), so add operations are idempotent — running them twice won't create duplicates.


Example Prompts

Once the server is connected, try asking Claude:

Add a recipe for spaghetti bolognese with ingredients and steps.
List all my ingredients.
Add 500g of chicken breast as an ingredient.
Delete the recipe for lasagne.

Development

# Run directly from TypeScript (no build step needed)
npm run dev

# Build to dist/
npm run build

# Run the compiled server
npm start

The server communicates over stdio, so it has no open ports and is safe to run as a subprocess managed by your AI client.


Project Structure

src/
├── index.ts          # Entry point — connects stdio transport
├── server.ts         # Registers all tools with the MCP server
├── api-client.ts     # HTTP client for the WeekPlan REST API
├── slugify.ts        # Converts names to stable IDs
└── tools/
    ├── ingredients.ts # Ingredient tool handlers
    └── recipes.ts     # Recipe tool handlers

Troubleshooting

"Cannot connect to WeekPlan API" Make sure your WeekPlan server is running and WEEKPLAN_URL points to the correct address.

"command not found: node" Node.js is not installed or not on your PATH. Install it from nodejs.org.

Tools don't appear in Claude

  • Confirm the path in your config points to dist/index.js (not src/index.ts)
  • Make sure you ran npm run build after cloning
  • Restart your AI client after changing the config

Build errors Run npm install first to ensure all dependencies are present, then npm run build.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选