Inventory MCP Server
An MCP server for inventory management (list, add, delete, comment on items) that demonstrates Auth0 for MCP capabilities including JWT bearer auth, fine-grained authorization with FGA, CIBA step-up approval, and Token Vault integration.
README
Inventory MCP Server
A Next.js web app deployed on Vercel that acts as an MCP (Model Context Protocol) server for inventory management. Demonstrates all Auth0 for MCP capabilities via the @auth0/ai-vercel SDK.
Auth0 for MCP Capabilities
| Capability | Tool | What it does |
|---|---|---|
| JWT Bearer Token | all tools | withMcpAuth + jose JWKS verification validates the Auth0 access token on every request |
| FGA (Fine-Grained Authorization) | addItem |
withFGA checks user:<sub> writer inventory:default before adding items |
| FGA + CIBA Step-up | deleteItem |
withFGA checks user:<sub> owner inventory:<id> AND withAsyncAuthorization sends a CIBA push for out-of-band approval |
| Token Vault | commentItem |
withTokenVault fetches a federated Slack access token stored in Auth0 Token Vault |
MCP Endpoint
POST/GET/DELETE https://<your-app>.vercel.app/api/mcp
All requests require:
Authorization: Bearer <Auth0 access_token>
The access token must have the read:inventory scope (plus write:inventory for mutations).
Tools
listInventory
Returns all inventory items. No extra authorization beyond the bearer token.
addItem
{ "name": "Widget X", "quantity": 50, "price": 12.99 }
Requires FGA relation: user:<sub> writer inventory:default
deleteItem
{ "id": "item-001" }
Requires:
- FGA relation:
user:<sub> owner inventory:item-001 - CIBA approval — the user receives a push notification and must approve
commentItem
{ "id": "item-001", "comment": "Reorder ASAP" }
Saves the comment and posts a Slack message via Auth0 Token Vault (user must have linked Slack account).
Setup
1. Auth0 Tenant
- Create an API in Auth0 with audience matching
AUTH0_AUDIENCE, with scopesread:inventoryandwrite:inventory. - Create an M2M application with Client Credentials grant for CIBA token exchange and Token Vault operations. Note the Client ID and Secret.
- Enable Auth0 Fine Grained Authorization and create a store. Configure tuples for your test users:
user:<sub> writer inventory:default user:<sub> owner inventory:item-001 - Enable CIBA on your tenant (requires a push notification provider).
- Configure a Slack social connection in Auth0 with
chat:writescope and enable Token Vault storage.
2. Environment Variables
Copy .env.example to .env.local and fill in your values:
cp .env.example .env.local
Add the same variables in your Vercel project settings (Settings → Environment Variables).
Optional variable for Slack notifications:
SLACK_CHANNEL_ID=C0123456789
SLACK_REFRESH_TOKEN=xoxe-... # fallback for testing; normally read from JWT claims
3. Deploy to Vercel
npm install
vercel deploy
Or connect your GitHub repo to Vercel for automatic deployments.
4. Connect an MCP Client
{
"mcpServers": {
"inventory": {
"url": "https://<your-app>.vercel.app/api/mcp",
"headers": {
"Authorization": "Bearer <access_token>"
}
}
}
}
Get an access token via the Auth0 Device Flow, Authorization Code flow, or your preferred grant.
FGA Model
Minimum required tuples for testing:
type user
type inventory
relations
define writer: [user]
define owner: [user]
Create tuples:
fga tuple write --store-id $FGA_STORE_ID \
--user user:<your-sub> \
--relation writer \
--object inventory:default
fga tuple write --store-id $FGA_STORE_ID \
--user user:<your-sub> \
--relation owner \
--object inventory:item-001
Known Limitations
- CIBA store: The in-memory
MemoryStore(default inAuth0AI) does not persist across Vercel cold starts. For production, configure a persistent store such as@auth0/ai-redisbacked by Vercel KV or Upstash Redis. - Inventory store: In-memory; resets on cold start. Replace with Vercel Postgres, Neon, or similar for persistence.
Local Development
npm install
cp .env.example .env.local
# fill in .env.local
npm run dev
MCP server will be available at http://localhost:3000/api/mcp.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。