02 / case studies
Three problems, solved in production
Not a project grid — the reasoning behind the three systems that matter most.
Everything below runs in production today.
case 01 — security & scale
The Gateway
NestJS · MCP SDK · OAuth 2.1 · MongoDB · Redis · Kubernetes — 25K+ LOC, 547 commits
- Problem
- Hotels want AI agents to reach their systems — availability, bookings, guest data.
But you cannot hand every agent every tool. Enterprise adoption dies without
fine-grained, auditable access control.
- Constraints
- Multi-team tenancy, zero-downtime operations, per-user permissions, and compliance with an
MCP spec that was changing under our feet.
- Architecture
- A decorator-based provider framework — 57 tools across 7 providers behind one
Streamable HTTP endpoint. Auto-generated per-tool scopes
(read / write / readAll / writeAll), four composable guards
(JWT · scope · CIDR IP · rate limit), audit logging, and MongoDB-backed
session & tool-call metrics across 58 REST endpoints.
// every tool declares its own permission surface — scopes are generated, never hand-listed
@Tool({
name: "get-availability",
parameters: AvailabilitySchema, // Zod, validated at the edge
permissions: ["read", "readAll"], // → get-availability:read / :readAll
annotations: { readOnlyHint: true },
})
Decision: provider registry in MongoDB, not static config.
Tools can be enabled, disabled, or re-scoped per environment with zero redeploys.
The registry version-stamps every change to invalidate scope caches — operations
teams change AI capability without touching code.
Outcome 500-session pool · 3-tier inactivity cleanup
100 req/min throttling prod + staging on k8s stdio transport for Claude Desktop
case 02 — product & performance
The Concierge
Next.js 15 · React 19 · Vercel AI SDK · Azure OpenAI / Gemini / Groq · Redis · MongoDB
- Problem
- A hotel website visitor should book a room by talking. Two things kill conversational booking:
latency and amnesia.
- Constraints
- One script tag to embed. Sub-second perceived response. Memory across visits without a vector
database to operate. LLM costs visible per request.
- Architecture
- Multi-provider LLM routing (GPT-4o, Gemini, Groq Llama + Whisper voice) orchestrating
18+ tools — availability, booking, hotel info, weather, discovery. A two-tier memory
system: Redis rolling summaries for the conversation, MongoDB profiles for the guest.
Langfuse/OpenTelemetry tracing on every request.
Decision: rolling summaries over a vector store.
For bounded hotel conversations, a summarize-and-persist loop beats RAG —
no embedding infra to run, no retrieval misses to debug, and memory costs are
a single Redis key per session. Boring architecture, measured win:
<5 ms warm pre-stream latency.
Outcome <5 ms warm / ~17 ms cold pre-stream
single-tag embed on hotel sites per-request token cost tracing
case 03 — the frontier
MCP Apps: real UI inside the agent
MCP Apps SDK · ui:// resources · React 19 · Vite single-file · Apaleo PMS · Leaflet / Overpass
- Problem
- Chat text is a terrible interface for choosing a room. If agents are the new browser,
they need real UI — rendered inside Claude and ChatGPT themselves.
- Constraints
- A months-old spec, strict CSP sandboxes, app-store review rules, and live PMS bookings —
mistakes cost real money.
- Architecture
- Tools return self-contained React UIs (Vite single-file bundles) via ui:// resources,
talking to the host over the postMessage bridge. Live Apaleo booking flow
(search → book → reservation lookup) with OAuth2 token caching and MCP session pooling.
A MongoDB hotel registry onboards new hotels with zero redeploys.
// the LLM sees semantics; the widget sees pixels — never confuse the two audiences
return {
structuredContent: { offers }, // model-visible: prices, policies
_meta: { widgetData: { images, mapPins } }, // display-only: never burns context
};
Decision: split structuredContent from widget data.
Room photos and map tiles in the model's context would burn tokens and invite hallucination.
The split keeps reasoning clean and rendering rich — and it's what app-store compliance review
wants to see.
Outcome live hotel bookings inside Claude & ChatGPT
131 POI categories on OpenStreetMap geohash Redis caching, pre-warmed
Platform work — five more systems that matter
Less narrative, same production weight.
console-v3
q-channel / mcpNext.js 14 Turborepo · OAuth2 · RS256/JWKS
Built the console's OAuth2 server for MCP clients — RFC 7591 dynamic client registration, PKCE, RS256 JWTs with JWKS publication, OIDC discovery, and a 12-scope MCP permission model — plus the Q-MCP management dashboard: one-click client configs for Claude Desktop, Claude.ai, ChatGPT, Cursor and VS Code, a per-user / per-tool permission drawer (read · readAll · write · writeAll), and token-lifetime controls. 175 commits across a 16-app monorepo.
be-serviceNestJS · REST / SOAP · OAuth-signed APIs
The booking-engine middleware: normalizes 100+ hotel booking providers (Siteminder, Synxis, Mews, Accor, IHG…) behind one availability API, with UTM conversion tracking and multi-team room aggregation with deduplication. 183 commits.
media-storageNestJS · PostgreSQL · Azure Blob · MCP
Object-storage service with bucket quotas, perceptual image hashing for dedup, EXIF extraction & sanitization, JWT multi-tenancy — and an MCP module exposing hotel media directly to AI agents.
kpiNestJS · Elasticsearch · Bull · GA4
The analytics engine: email pixel tracking for campaign attribution, Google Analytics 4 direct-booking revenue tracking with currency exchange, queue-based async processing, Mongo↔Elasticsearch reservation migrations. 89 commits.
bot-configNestJS · MongoDB · Bull · Socket.io
The configuration backbone every bot instance reads from: 257+ dialog templates, per-scope configs (team / group / default), Q-Task integration, safe schema migrations, and a global property-prefetch interceptor. 72 commits.
Also shipped
oauth servers ×2standalone OAuth 2.0/2.1 + PKCE authorization servers for MCP clients, with Microsoft Entra ID & Google SSO
be-mcp-serverbooking-engine MCP server with three transports (Streamable HTTP / SSE / stdio) and a live metrics dashboard
rtreal-time messaging server — MCP live-chat channel, Booking.com flows, WhatsApp opt-in/out, HTML sanitization
booking-messaging-apiBooking.com gateway — OAuth 2.0 bearer auth, Redis-backed duplicate-message detection
exporter / q-connectJsReport + headless-Chrome PDF pipeline · weather & points-of-interest aggregation service
weather-mcp / mcp-clientstandalone weather MCP provider · NestJS MCP client running an agent loop over 7 connected servers
04 / proof of work
Don't read my portfolio. Interview it.
This site is also an MCP server — built with the same SDK I use in production.
Add it to Claude and ask my career anything: it exposes my case studies, evidence, and CV as tools.
claude — connect this portfolio
# requires Node 20+ · runs straight from the GitHub repo, nothing to install
claude mcp add walid-slim -- npx -y github:slim00walid-prog/portfolio
# then, inside Claude:
› what did walid build, and what's the evidence?
› get_case_study gateway
› get_evidence "oauth"
tools: about · list_projects · get_case_study · get_evidence · get_cv · contact — all annotated readOnlyHint: true, naturally.