Inventory MCP Server

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.

Category
Visit Server

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:

  1. FGA relation: user:<sub> owner inventory:item-001
  2. 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

  1. Create an API in Auth0 with audience matching AUTH0_AUDIENCE, with scopes read:inventory and write:inventory.
  2. Create an M2M application with Client Credentials grant for CIBA token exchange and Token Vault operations. Note the Client ID and Secret.
  3. 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
    
  4. Enable CIBA on your tenant (requires a push notification provider).
  5. Configure a Slack social connection in Auth0 with chat:write scope 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 in Auth0AI) does not persist across Vercel cold starts. For production, configure a persistent store such as @auth0/ai-redis backed 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured