Gamito

Gamito

Enables AI agents to generate budget-disciplined, allergy-safe weekly meal plans, shopping lists, and meal swaps using a fully local deterministic engine.

Category
访问服务器

README

Gamito Local

Gamito Local is a fully local, deterministic meal-planning engine exposed to AI agents through the Model Context Protocol (MCP). It turns a household's profile, budget, pantry, and taste history into budget-disciplined, allergy-safe weekly meal plans, shopping lists, and meal swaps — entirely on your own machine, with no cloud calls.

The system ships in two halves that are designed to work together:

  • The MCP server (gamito-mcp) — 20 deterministic tools backed by a local recipe index and a local SQLite store. All math (budgeting, pricing, rescaling, hard allergy filters) is plain Python; nothing is left to a model.
  • The Agent Skill (skills/gamito/SKILL.md) — the judgment layer that teaches an orchestrating assistant (e.g. Hermes) when to call which tool, in what order, and how to recover from errors. The server enforces safety; the skill supplies the workflow.

Design principle: Language understanding happens in the agent. Gamito's tools never parse free-form intent — the agent translates a request into a structured tool call, and the server returns deterministic, chat-forwardable results. The SQLite store (not conversation memory) is the single source of truth for every safety constraint.

Why MCP + Skill?

An MCP server alone exposes tool schemas, but a model still has to guess how to sequence them safely. The paired skill closes that gap:

Layer Responsibility
MCP server Deterministic execution, hard allergy/diet filters, pricing, persistence
Skill Identity rules, onboarding interview, tool ordering, error recovery

This separation means allergies and dietary restrictions are enforced as hard filters in code — never as a polite request to the model — while the skill keeps the conversation coherent across planning, edits, feedback, and the household cookbook.

Use Cases

What the MCP + skill pairing is built to do:

  • Plan a week of meals — "Plan 5 dinners for 2 people on a 60 EUR budget." Generates a full plan, shopping list, and budget check in one call.
  • Stay allergy- and diet-safe — allergies, dislikes, and dietary preferences are stored per profile and applied as hard filters to every plan and swap.
  • Respect a food budget — every plan is cost-checked against the stated budget, and assignment actively targets useful budget utilization instead of simply picking the cheapest matching recipes.
  • Swap, rescale, and refine meals — "Make Tuesday dinner cheaper / vegan / faster" or "scale Friday up to 4 servings" without rebuilding the plan.
  • Generate shopping lists with pantry awareness — items are split into "need to buy" vs. "already have" using the household pantry.
  • Track the pantry from a photo — the agent reads long-shelf-life staples off a shelf/fridge photo; the server canonicalises and stores them.
  • Learn household tastes — numeric ratings and soft feedback ("less spicy next time") bias future plans toward liked recipes and away from disliked ones.
  • Improve a previous plan — regenerate from a source plan, automatically keeping highly-rated slots and avoiding poorly-rated ones.
  • Keep a household cookbook — save "mama's recipe" from text or a photo as a custom recipe that competes for slots alongside the base dataset.
  • Save and favourite plans — label plans ("Cheap weeknights"), mark favourites, and list them later.
  • Automate recurring plans — e.g. "Every Sunday 18:00, generate next week's plan and send the text to the family group."

The 20 tools span six namespaces: Profiles, Planning, Plan Lifecycle, Edits, Shopping & Pantry, Feedback, and Recipes. See skills/gamito/references/tool-index.md for the full signatures and error contract.

Architecture

Household / Hermes agent
        │  natural language
        ▼
  skills/gamito/SKILL.md      ← judgment: when/which tool, ordering, recovery
        │  structured tool calls (gamito:<tool>)
        ▼
  gamito-mcp (FastMCP, stdio) ← 20 deterministic tools
        │
        ├── retrieval/   fastembed + brute-force vector index (data/index/)
        ├── planning/    LangGraph pipeline: assign → budget → shopping → render
        ├── pricing/     canonical ingredient pricing
        ├── pantry/      canonicalisation
        └── db/          SQLite store (profiles, plans, ratings, pantry, recipes)

Installation

Requirements: Python 3.12+ and uv.

# 1. Clone
git clone https://github.com/nerkyzas157/gamito.git
cd gamito

# 2. Install dependencies into a local virtualenv
uv sync

# 3. Initialise the SQLite store (profiles, plans, pantry, recipes)
uv run gamito db init

# 4. Ensure data/index exists before serving requests.
# Prefer copying a prebuilt data/ directory from a workstation:
rsync -az --delete /path/to/prebuilt/gamito/data/ ./data/

The index build encodes the bundled data/recipes_dataset.csv with the BAAI/bge-small-en-v1.5 model into data/index/ (embeddings, metadata, and a manifest). It is resumable — re-run the command to continue an interrupted build — but it is CPU/RAM intensive enough to overwhelm a small VPS. For low-memory hosts, build once on a stronger machine and copy the whole data/ folder to the deploy checkout instead of running the builder in production.

If you do need to rebuild locally:

uv run python scripts/build_local_index.py

Optional: seed a demo profile and plan

uv run python scripts/seed_demo.py

Configuration

Paths are overridable via environment variables:

Variable Default Purpose
GAMITO_DATA_DIR ./data Dataset and index root
GAMITO_INDEX_DIR ./data/index Prebuilt retrieval index
GAMITO_DB ./gamito.db SQLite store path

Running the MCP server

The server speaks MCP over stdio:

uv run gamito-mcp

To register it with an MCP client (e.g. Claude Desktop, Cursor, or Hermes), add an entry like:

{
  "mcpServers": {
    "gamito": {
      "command": "uv",
      "args": ["run", "gamito-mcp"],
      "cwd": "/absolute/path/to/gamito"
    }
  }
}

Then make the skill available to the orchestrating agent by pointing it at skills/gamito/SKILL.md. The agent calls tools by their fully-qualified name, e.g. gamito:generate_meal_plan.

Data origins

The bundled recipe corpus is derived from the public Kaggle dataset:

data/recipes_dataset.csv is a salvaged, normalised subset of that source (currently 14,619 recipes across 36 columns). At index-build time the retrieval pipeline normalises fields (e.g. total_timetotal_time_min, list-like columns → JSON) before embedding. The committed index manifest records the source dataset's SHA-256 for reproducibility.

Please refer to the original Kaggle dataset page for its license and terms of use. Pricing and pantry canonicalisation rely on local lookup tables; see data/README.md for the provenance and current status of those auxiliary assets.

Repository layout

src/gamito/
  retrieval/    fastembed encoder + brute-force vector index + hard filters
  planning/     LangGraph plan pipeline and nodes
  pricing/      canonical ingredient pricing
  pantry/       ingredient canonicalisation
  db/           SQLite schema, connection, and data access
  models/       Pydantic models (profile, pantry, planning, meal)
  rendering/    chat-forwardable text rendering (compact / full / labels)
  mcp/          FastMCP app, server entry point, and the 20 tools
  cli.py        dev CLI (db init, custom-recipe import/list/re-embed)
skills/gamito/  Agent Skill (SKILL.md) + tool-index reference
scripts/        index build, retrieval eval, demo seed, test runner
data/           recipe dataset, prebuilt index, lookups
docs/           retrieval eval baseline
tests/          local unittest suite

Budget And Pricing Behavior

Gamito allocates the requested budget across meal slots before recipe assignment. Each non-leftover slot targets roughly 80% of its allocation, then combines semantic relevance with price fit so the plan stays realistic for the requested budget. To avoid cheap recipes dominating higher-budget plans, the assignment node supplements semantic retrieval results with filtered recipes ranked by closeness to the slot's target cost.

Shopping totals are estimated from canonical ingredient pricing when the local lookup tables in data/lookups/ are available. If those lookup tables are missing or empty, Gamito falls back to the selected recipes' estimated_cost_total_eur values whenever ingredient-level pricing would undercount the plan. This keeps budget summaries useful on small deploys that ship only data/index/.

Development

Run the local test suite:

scripts/test          # or: make test
uv run python -m unittest discover -s tests

Evaluate retrieval quality against the golden set:

uv run python scripts/eval_retrieval.py

The current retrieval baseline (12-query golden set) is recorded in docs/eval_baseline.md: 100% hard-filter integrity, ~17 ms warm p95 latency per query, and a manual precision@5 floor of 0.60.

Versioning

This project follows Semantic Versioning and Keep a Changelog; releases are managed with Commitizen. See CHANGELOG.md for the release history.

推荐服务器

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

官方
精选