---
title: "MCP Tenant Context · Tenant + actor context propagation for"
description: "Tenant + actor context propagation for MCP servers. AsyncLocalStorage-based tenant + actor context propagation for MCP servers. Zero runtime dependencies,"
canonical: "https://matthiasmeyer.tech/repos/mcp-tenant-context"
language: "en"
last_updated: "2026-08-21"
markdown_versions: ["https://matthiasmeyer.tech/repos/mcp-tenant-context.md", "https://matthiasmeyer.tech/de/repos/mcp-tenant-context.md", "https://matthiasmeyer.tech/es/repos/mcp-tenant-context.md"]
image: "https://matthiasmeyer.tech/api/og/repo/mcp-tenant-context?lang=en"
publisher: "Matthias Meyer, https://matthiasmeyer.tech (llms.txt: https://matthiasmeyer.tech/llms.txt)"
---

factory alpha TypeScript

# MCP Tenant Context

Tenant + actor context propagation for MCP servers

AsyncLocalStorage-based tenant + actor context propagation for MCP servers. Zero runtime dependencies, ESM-only. MCP Factory foundation pillar.

[View on GitHub →](https://github.com/studiomeyer-io/mcp-tenant-context)[npm](https://www.npmjs.com/package/mcp-tenant-context)

## What it solves

Every multi-tenant server has to carry two pieces of identity through its handler stack: which tenant the request belongs to, because that drives every scoped database query and is the whole of cross-tenant isolation, and who triggered it, whether that is an OAuth user or a service principal. Threading both through every function signature is how they end up forgotten in the one query that matters.

## How it works

It uses the Node async local storage to carry tenant and actor per request, so they stay out of the signatures and are still available wherever you need them. Zero runtime dependencies, only the Node standard library, Node 22 or newer. It is a library and nothing else: no server, no command line tool.

## When to use it

Take it when you are writing a multi-tenant MCP server and you can already feel the tenant argument spreading through the codebase. It is a small library that removes a whole class of parameter passing, and it is the right moment to adopt it early rather than after the signatures have set.

## When not to use it

It carries the identity, it does not enforce anything with it. Your queries still have to use the tenant they are handed, and nothing here notices if one of them does not. If you want that enforced, that belongs in the data layer, not in the transport of the value.

Stars

★ 1

installs

↓ 377

Clones (14d)

⊟ 31

Language

TypeScript

Updated

2026-08-21

## Install

```
npx -y mcp-tenant-context
```

## Sitemap

Every page of this site as Markdown: [sitemap](https://matthiasmeyer.tech/sitemap.md). Curated entry point: [llms.txt](https://matthiasmeyer.tech/llms.txt).
