Groupon MCP Server
Provides MCP tools for discovering Groupon-style deals (search, get, compare) for customers, and additionally merchant intelligence tools (category insights, market gaps, price positioning) for logged-in merchants.
README
Groupon MCP Server
A Model Context Protocol server that exposes a Groupon‑style deals catalogue to LLM clients — both consumer deal discovery and merchant deal intelligence — as MCP tools and resources, served over Streamable HTTP behind OAuth 2.1.
1. What is this about
The server turns a deals dataset (deals, options, merchants, categories, locations, reviews) into capabilities an MCP‑aware model can call:
- Customers discover deals — search with filters, inspect a deal, compare several side by side.
- Merchants get everything customers can, plus intelligence — category benchmarking, market‑gap analysis, and price positioning against peers.
A caller's role is fixed by who they log in as. The role is read from the
OAuth access token at session start, so a session only ever sees the tools its
role is allowed to use — customers never even see the merchant tools in
tools/list.
2. Approach
Layered by concern, one organizing principle throughout src/:
| Folder | Responsibility |
|---|---|
models/ |
Zod domain models — the validated shapes everything else speaks in |
repositories/ |
All SQL lives here; repositories return Zod‑validated domain models |
db/ |
Infrastructure — in‑memory SQLite client, schema, fixtures, seed |
mcp/ |
The MCP delivery layer (see below) |
utils/ |
Stateless helpers (console output, password hashing) |
Inside mcp/:
app.ts— builds the Express host: OAuth routes, login, the Bearer‑guarded/mcpendpoint.server.ts—buildMcpServer(role)registers the tools/resources the role may use.controllers.ts— Streamable HTTP transport + per‑session lifecycle.auth-provider.ts— the OAuth 2.1 authorization‑server logic.tools.ts— the tool‑name registry and role rules;results.ts— tool‑result builders.
Key design choices
- SQLite, on purpose. An in‑memory SQLite database keeps the project dependency‑free and trivial to run, so the focus stays on the part that matters — the MCP tools and the deal‑intelligence logic — instead of standing up external infrastructure. It still exercises a real, structured data layer (SQL, joins, FTS5, a proper repository boundary returning validated models), so the architecture is representative rather than a throwaway in‑memory array.
- Ephemeral data. That database is rebuilt + seeded on every launch — great for a deterministic demo, but note every restart invalidates issued OAuth tokens (you re‑authenticate after a restart).
- Per‑session, role‑scoped servers. Each session gets a fresh MCP server; the role comes from the access token, so the tool set is decided once and fixed for the session. Merchants are a superset of customers.
- Repositories own persistence. Tools never touch SQL — they call a repository that returns a fully‑assembled, validated domain model.
- Full‑text search.
search_dealskeyword matching uses SQLite FTS5 (relevance‑ranked), notLIKE. - Self‑contained auth. The server doubles as its own OAuth 2.1 authorization
server (PKCE), verifying credentials against the seeded
userstable; the user's role is carried on the token.
Tech stack: TypeScript · Express 5 · @modelcontextprotocol/sdk ·
better-sqlite3 (in‑memory) · Zod.
3. MCP tools
Tools
| Tool | Role | Input | Returns |
|---|---|---|---|
search_deals |
customer¹ | query?, category?, location?, max_price?, min_discount?, limit? |
Active deals matching the filters (FTS keyword + slug/price/discount). |
get_deal |
customer¹ | deal_id |
Full detail for one deal: options, merchant, location, rating, fine print. |
compare_deals |
customer¹ | deal_ids (2+) |
Side‑by‑side: full deals, an aligned summary row each, and cheapest / biggest‑discount / highest‑rated picks. |
list_all_deals |
merchant | — | Every deal including inactive ones (management view). |
category_insights |
merchant | category, location? |
Deal count, avg/median discount, price range, top merchants. |
find_market_gaps |
merchant | location |
Categories under‑supplied in that location vs other markets, ranked by opportunity (gap_score). |
price_positioning |
merchant | deal_id |
A deal's headline price/discount vs its category peers (peer medians + share it beats). |
¹ Customer tools are also available to merchants.
Resources
Reference data for grounding the category / location filter values:
| Resource | URI | Contents |
|---|---|---|
| Categories | categories://all |
Every category (slug + name). |
| Locations | locations://all |
Every location (slug + region). |
category / location filters take slugs — e.g. categories
restaurants, wellness-beauty, fitness; locations madrid, barcelona,
valencia.
4. How to run
Prerequisites: Node.js 24 and npm. (better-sqlite3 is a native module — if
you switch Node versions, run npm rebuild better-sqlite3.)
npm install
# Development (no build step):
npm run dev # tsx src/index.ts
# Production build:
npm run build # tsc && tsc-alias → dist/
npm start # node dist/index.js
The server listens on http://localhost:3000:
- MCP endpoint —
http://localhost:3000/mcp - Health check —
http://localhost:3000/health
Trying it with the MCP Inspector
npx @modelcontextprotocol/inspector
In the Inspector UI:
- Transport Type:
Streamable HTTP - URL:
http://localhost:3000/mcp - Click Connect → run the Guided OAuth flow and log in with a seeded user.
The /mcp endpoint is OAuth‑protected, so you log in to get a token; the role
you log in as determines which tools you see.
Seeded logins (all use password password123):
| Role | Sees | |
|---|---|---|
| merchant | javier@example.com |
Everything — all 7 tools + both resources |
| customer | laura@example.com |
Discovery only — search_deals, get_deal, compare_deals + resources |
Because the database is in‑memory, restarting the server invalidates all tokens — clear the Inspector's stored auth and log in again after a restart.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。