Maintenance in progress: we are indexing a large batch of new skills. Some pages may load slowly or briefly show no results. Nothing is lost, and everything is back to normal within the hour.

Multi Tenant Patterns

> Header-based multi-tenant authentication patterns.

majiayu000 54c67b1 2 files · 1.4 KB Updated 567 repo stars

File contents

Multi-Tenant Patterns Skill

Header-based multi-tenant authentication patterns.


Request Headers

x-n8n-url: https://n8n.example.com
x-n8n-key: n8n_api_key_here
x-instance-id: optional-instance-id
x-session-id: optional-session-id

Auth Flow

1. Request arrives with headers
2. Extract n8n credentials from headers
3. Validate credentials against n8n instance
4. Create or resume session
5. Execute MCP tool with tenant context
6. Return response

Session Management

interface Session {
  id: string;
  n8nUrl: string;
  n8nApiKey: string;
  instanceId?: string;
  createdAt: Date;
  lastUsedAt: Date;
}

Rate Limiting Per Tenant

const key = `rate:${apiKey}:${hour}`;
const count = await kv.get(key) || 0;
if (count >= limit) {
  throw new RateLimitError();
}
await kv.put(key, count + 1, { expirationTtl: 3600 });

majiayu000/claude-skill-registry-data/tree/main/domains/multi-tenant-patterns commit 54c67b1556

Frequently asked questions

npx skillmds add majiayu000/multi-tenant-patterns