ourgroceries-mcp

ourgroceries-mcp

Manage grocery lists on OurGroceries.com via CLI or MCP, supporting item operations, list management, and natural-language resolution.

Category
访问服务器

README

OurGroceries MCP Server & CLI

A command-line tool and Model Context Protocol (MCP) server for managing grocery lists on OurGroceries.com.

Features

This package provides CLI commands and MCP tools to:

  • Get visible shopping-list summaries without raw item arrays
  • Get categories, settings, active items, and crossed-off item history
  • Resolve natural-language item requests against the master catalog and shopping history
  • Add items to lists
  • Remove items from lists
  • Update item details (name, category, notes, star rating)
  • Cross off and uncross items

Installation

The npm package is published as @sergib/ourgroceries-mcp. The installed executable remains ourgroceries-mcp.

Login to OurGroceries

Authenticate with your OurGroceries account:

npx -y @sergib/ourgroceries-mcp login

Enter your email and password when prompted.

The login command saves an OurGroceries auth cookie and team ID. It does not save your password.

CLI Usage

Run commands directly with npx; no global install is required. Operational commands print JSON on success and write errors to stderr with a nonzero exit code.

Start by listing your shopping lists, then use the returned list IDs for item commands:

npx -y @sergib/ourgroceries-mcp get-lists
npx -y @sergib/ourgroceries-mcp get-active-items --list-id LIST_ID
npx -y @sergib/ourgroceries-mcp get-crossed-off-items --list-id LIST_ID --search "milk" --limit 20

Use the resolver before adding item text. It can infer a likely target list from history, tell you whether to add a new item, uncross an existing crossed-off item, or do nothing because the item is already active:

npx -y @sergib/ourgroceries-mcp resolve-item-to-add --query "plátanos"
npx -y @sergib/ourgroceries-mcp resolve-item-to-add --query "add olives" --list-id LIST_ID
npx -y @sergib/ourgroceries-mcp add-item --list-id LIST_ID --value "olives"
npx -y @sergib/ourgroceries-mcp uncross-item --list-id LIST_ID --item-id ITEM_ID

Other useful commands:

npx -y @sergib/ourgroceries-mcp get-categories
npx -y @sergib/ourgroceries-mcp get-settings
npx -y @sergib/ourgroceries-mcp update-item --list-id LIST_ID --item-id ITEM_ID --new-value "whole milk"
npx -y @sergib/ourgroceries-mcp cross-off-item --list-id LIST_ID --item-id ITEM_ID
npx -y @sergib/ourgroceries-mcp remove-item --list-id LIST_ID --item-id ITEM_ID

For the full command list and options:

npx -y @sergib/ourgroceries-mcp --help
npx -y @sergib/ourgroceries-mcp get-crossed-off-items --help

MCP Usage

Running the package without a subcommand starts the MCP server over stdio. Add it to an MCP client after logging in.

For Claude Code

claude mcp add ourgroceries npx -y @sergib/ourgroceries-mcp

For Claude Desktop

Add to your configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "ourgroceries": {
      "command": "npx",
      "args": ["-y", "@sergib/ourgroceries-mcp"]
    }
  }
}

Then restart Claude Desktop.

Codex Skill

This repository and npm package include a Codex skill at skills/ourgroceries-cli. Use $ourgroceries-cli when you want Codex to operate OurGroceries through the CLI instead of through MCP.

Credentials

By default, credentials are stored in a local config file:

  • macOS/Linux: ~/.config/ourgroceries-mcp/config.json
  • Windows: %APPDATA%\ourgroceries-mcp\config.json

On macOS and Linux, the config file is written with owner-only 0600 permissions where supported.

To remove saved credentials:

npx -y @sergib/ourgroceries-mcp logout

logout removes the saved config file only. It does not modify environment variables.

Environment-variable fallback

If there is no usable config file, the server can read credentials from environment variables:

  • OURGROCERIES_AUTH_COOKIE
  • OURGROCERIES_TEAM_ID

Both variables must be set. A saved config file takes priority over environment variables. If the saved config file is invalid and both environment variables are set, the server warns and uses the environment variables.

Troubleshooting Credentials

If the CLI or MCP server reports missing or invalid credentials, run:

npx -y @sergib/ourgroceries-mcp login

Then retry your CLI command or restart your MCP client. If you use environment variables instead of the config file, refresh both variables. Login debug output from npx -y @sergib/ourgroceries-mcp login --debug redacts passwords, auth cookies, and cookie headers.

What You Can Do

  • View your lists: See shopping-list IDs and item counts without dumping every item
  • Read items: Get active items or filtered crossed-off history for one list
  • Resolve item names: Turn natural-language or partial item text into known values and likely target lists
  • Add items: Add deterministic item values to any list with optional notes
  • Remove items: Delete items from your lists
  • Update items: Change item names, categories, notes, or star ratings
  • Check off items: Cross items off or uncross previously crossed-off items

Recommended Add Flow

For item add requests, use the resolver before mutating a list, even when the user gives only an item name or partial name:

  1. Call resolve_item_to_add with the user's text and, when known, listId.
  2. Review the top candidate, suggestedTargets, and recommendedAction.
  3. Follow recommendedAction when it is list-specific, even if the resolver inferred the list.
  4. Call add_item only when the recommendation is add_item.
  5. Call uncross_item when the recommendation is uncross_item.
  6. Do not mutate when the recommendation is already_active.
  7. Ask for a list only when the recommendation is choose_list and suggestedTargets are missing or ambiguous.

MCP Example Prompts

Once configured, you can ask Claude:

  • "What's on my grocery list?"
  • "Add milk to my shopping list"
  • "Mark eggs as crossed off"
  • "Remove bread from the list"
  • "Update the note on bananas to say 'organic'"

License

MIT

Developer CLI Usage

Build first, then run the local binary directly:

npm ci
npm run build
node build/cli.js

Running node build/cli.js with no subcommand starts the MCP server over stdio, matching the package's ourgroceries-mcp binary behavior.

For local CLI testing with your own OurGroceries account, authenticate once:

node build/cli.js login

The CLI uses the same credentials as MCP mode: saved config file first, then the OURGROCERIES_AUTH_COOKIE and OURGROCERIES_TEAM_ID environment-variable fallback. logout removes only the saved config file:

node build/cli.js logout

Operational commands print JSON on success and write errors to stderr with a nonzero exit code. They use explicit IDs for mutations. Use focused reads and the resolver before mutating items:

node build/cli.js get-lists
node build/cli.js get-categories
node build/cli.js get-settings
node build/cli.js get-active-items --list-id LIST_ID
node build/cli.js get-crossed-off-items --list-id LIST_ID --search "milk" --limit 20
node build/cli.js resolve-item-to-add --query "add olives" --list-id LIST_ID
node build/cli.js add-item --list-id LIST_ID --value "milk" --note "2%"
node build/cli.js remove-item --list-id LIST_ID --item-id ITEM_ID
node build/cli.js update-item --list-id LIST_ID --item-id ITEM_ID --new-value "whole milk" --star 1
node build/cli.js cross-off-item --list-id LIST_ID --item-id ITEM_ID
node build/cli.js uncross-item --list-id LIST_ID --item-id ITEM_ID

Reference docs for maintainers live in docs/.

Before sending CLI changes, run:

npm run check
npm audit --audit-level=moderate

Publishing to npm

When publishing a new package version, refresh npm authentication and verify the account first:

npm login
npm whoami
npm publish --access public

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选