feat: MCP server pro AI agenty (čtení menu)

POST /mcp (bezstavový Streamable HTTP) s nástroji list_restaurants
a get_menus. Agent je samostatný klient: ověřuje se jen tokenem
MCP_TOKEN, ne webovým JWT ani hlavičkou z proxy; token nefunguje na /api.
Bez MCP_TOKEN je MCP vypnuté, kratší token než 32 znaků = server nenaběhne.
This commit is contained in:
batmanisko committed 2026-11-12 10:27:48 +01:00
1 parent 3c08f71f63
commit ccc19e5ff4
9 files changed
+575 -5

No files matched your search

+1
View File
@@ -90,6 +90,7 @@ Prettier is installed in `client/` (devDependency only, no script or config) —
- **Services:** domain logic files at root level (`service.ts`, `pizza.ts`, `restaurants.ts`, `chefie.ts`, `voting.ts`, `stats.ts`, `qr.ts`, `notifikace.ts`)
- **Helpers:** `mock.ts` (fake menu data for `MOCK_DATA=true`), `pushReminder.ts` (push notification reminders), `utils.ts` (shared utilities)
- **Auth:** `auth.ts` — JWT + optional trusted-header authentication
- **MCP:** `mcp.ts` — read-only MCP server for AI agents on `POST /mcp` (stateless Streamable HTTP), mounted before the `/api` JWT middleware; authenticates only via its own `MCP_TOKEN` Bearer token (never the web JWT or proxy headers). Not part of `types/api.yml`.
- **Storage:** `storage/index.ts` factory selects implementation; backends: `json.ts` (file-based, dev), `redis.ts` (production), `memory.ts` (tests). Data keyed by date (YYYY-MM-DD).
- **Restaurant scrapers:** Cheerio-based HTML parsing for daily menus from multiple restaurants
- **Pizza Chefie integration:** `chefie.ts` scrapes pizzachefie.cz for Pizza day menus and salads (only active when a Pizza day is open)