MCP Tenant Pair MCP Server
Multi-user tenancy library for MCP servers. Pairs, groups, bi-temporal shared state, DSGVO erasure.
MCP Tenant Pair scores 65 (Good), licensed MIT and written in TypeScript. It installs as a local process. It declares 13 tools. Filed under Databases, AI and memory. GitHub shows 0 stars. Package registries report about 55 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
65 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
72/100 for listing completeness. Lost points: 12 of 13 tools barely described, short summary, no docs link.
How quality is graded
Where the 65 comes from
22 + 20 + 0 + 10 + 10 + 3 = 65. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 0 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 10 of 10 points.A real summary, a README with depth, listed tools.
Docs: 3 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "studiomeyer-io-mcp-tenant-pair": { "command": "npx", "args": [ "-y", "mcp-tenant-pair-demo@0.1.3" ] } }}
Environment variables
This server does not declare environment variables.
Tools13Tool docs quality grade F
All capabilitiesManualResolvertoolreturns no resolutions; conflicts stay pending until a human resolves them externally.
accept_invitetoolfalse
create_pairtoolfalse
forget_membertoolfalse
true
get_shared_statetooltrue
invite_membertoolfalse
kick_membertoolfalse
leave_pairtoolfalse
list_memberstooltrue
false
false
About
Part of the StudioMeyer MCP Stack โ Built in Mallorca ๐ด ยท โญ if you use it
mcp-tenant-pair
Spec: MCP 2025-06-18 License: MIT Repo layout: monorepo (npm workspaces)
packages/
lib/ mcp-tenant-pair (TypeScript library)
cli/ mcp-tenant-pair-cli (commander CLI)
demo/ mcp-tenant-pair-demo (reference Low-Level MCP server, stdio)
A note from us
We have been building tools and systems for ourselves for the past two years. The fact that this repo is small and has few stars is not because it is new. It is because we only just decided to share what we have built. It is not a fresh experiment, it is a long story with a recent commit.
We love building things and sharing them. We do not love social media tactics, growth hacks, or chasing stars and followers. So this repo is small. The code is real, it gets used, issues get answered. Judge for yourself.
If it helps you, sharing, testing, and feedback help us. If it could be better, an issue is more useful. If you build something with it, tell us at hello@studiomeyer.io. That genuinely makes our day.
From a small studio in Palma de Mallorca.
Why this exists
Most MCP servers today are single-user. The moment you want to share state across two or more humans (couples, families, small groups) you hit the same five sub-problems each time: pair creation, invite flow, identity-separated state, conflict resolution, voluntary leave / kick. This library solves them once, so downstream MCP servers (Pet-Platform, recipe-sharing, household, calendar) do not re-invent them.
5-Minute Quickstart
Library
import { TenantPair, SqliteTenantStore, LWWResolver } from "mcp-tenant-pair";
const tp = new TenantPair({
store: new SqliteTenantStore({ path: "./tenant-pair.sqlite" }),
resolver: new LWWResolver(),
});
const { pairId, inviteToken } = await tp.createPair({ creatorMemberId: "alice" });
await tp.acceptInvite({ inviteToken, memberId: "bob" });
await tp.setMemberPreference(pairId, "alice", "allergy", ["nuts"]);
await tp.setSharedState(pairId, "alice", "tonight", "pizza");
const aliceConstraints = await tp.getMemberConstraints(pairId, "alice");
const shared = await tp.getSharedState(pairId);
CLI
npx mcp-tenant-pair-cli pair create --member-id alice
npx mcp-tenant-pair-cli pair invite --pair-id <id> --member-id alice
npx mcp-tenant-pair-cli state set --pair-id <id> --member-id alice --key tonight --value pizza
npx mcp-tenant-pair-cli state get --pair-id <id>
Demo MCP server
node packages/demo/dist/server.js
# or via stdio in your MCP client config
Reads MCP_TENANT_PAIR_DB env (default :memory:).
Tools (12)
| Tool | readOnlyHint | destructiveHint |
|---|---|---|
| create_pair | false | false |
| invite_member | false | false |
| accept_invite | false | false |
| list_members | true | false |
| set_member_preferences | false | false |
| get_member_constraints | true | false |
| get_shared_state | true | false |
| set_shared_state | false | false |
| resolve_conflicts | false | true |
| kick_member | false | true |
| leave_pair | false | true |
| forget_member | false | true |
Compatibility Matrix
| Concern | Supported |
|---|---|
| MCP Spec | 2025-06-18 |
| Node | >= 20.0.0 to use it. Building this repo needs 20.19+ or 22.12+ (Vite 8). |
| Storage | SQLite (default), Postgres (peer-dep) |
| Conflict Resolver | LWWResolver (default), ManualResolver, custom (interface) |
| Transport | stdio (demo), library is transport-free |
Storage adapters
- SqliteTenantStore โ default, embedded, single-process. Uses
better-sqlite3with WAL mode. Pass{ path: "./pair.sqlite" }or:memory:. - PostgresTenantStore โ multi-process, multi-tenant. Accepts any
pg.Pool-shaped client ({ query<R>(text, params): Promise<{rows: R[]}>, end?(): Promise<void> }).pgis a peer dependency.
Conflict resolution
ConflictResolver is an interface. Two implementations ship:
LWWResolverโ picks the row with the latestvalidFrom, ties broken by highestversion. Throws on empty candidate list.ManualResolverโ returns no resolutions; conflicts stay pending until a human resolves them externally.
Inject your own by implementing { name: string; resolve(conflicts: Conflict[]): Resolution[] }.
Bi-temporal model
Every overwrite of a (pairId, namespace, key) triple sets valid_to on the previous active row and inserts a new row with a fresh valid_from. version is monotonic per key. This lets you replay history (getPairStateHistory) and detect concurrent writes deterministically.
Identity separation
member_state is per-member (only readable by that member via get_member_constraints).
pair_state is shared (all active members can read via get_shared_state).
Writes by a member who later leaves or is kicked stay visible in shared state.
Security notes
- Invite tokens are
<uuid v4>.<XXXX-XXXX>โ uuid v4 (122 bits CSPRNG entropy vianode:crypto) plus a voice-readable base32 short-code (default RNG isnode:crypto.randomInt, injectable for tests). - Per-pair pending-invite cap (default 25, configurable via
maxPendingInvites). - Owner-only kick. Owner cannot kick themselves; use leave instead.
- DSGVO Art. 17 erasure path:
forgetMember(pairId, memberId)hard-deletes the member'smember_staterows (allergies, dietary preferences) and nullsdisplay_name. Membership trace (left_at) is retained for audit. - Postgres adapter rejects schema names that don't match
/^[a-z_][a-z0-9_]{0,62}$/at construction time (defense against SQL injection via integrator-supplied schema strings). acceptInviteis race-safe โ both adapters use atomic transactions (better-sqlite3 immediate transaction; pgBEGIN+SELECT ... FOR UPDATE).- Time is injectable (
now: () => Date) for deterministic tests.
Development
npm install
npm run build
npm test
Tests cover (142 + 1 conditional):
- Pair creation (8)
- Invite flow (10)
- Invite expiry boundary (6) โ accept/pending agree at the exact
expires_atinstant, both adapters - Member preferences (8)
- Shared state (8)
- Conflict resolution (13)
- Resolvers (11)
- Error handling (17) โ exhaustive
TenantPairErrorcode coverage - Store adapters (6)
- Postgres adapter (26) โ schema-identifier validation, atomic transaction, fallback paths (mock pool, no live DB)
- Adapter parity (6 + 1) โ same operations against SQLite and Postgres produce identical results; the Postgres leg runs only when
TENANT_PAIR_TEST_PG_URL/DATABASE_URLpoints at a reachable database and is skipped otherwise (never false-fails) - Demo server integration (9)
- Round-1 regression fixes (14) โ SQL-injection schema-validation, TOCTOU acceptInvite race, conflict-resolved winner-marker, asOf-clock, DSGVO erasure, CSPRNG-default
Run the cross-adapter parity suite against a real Postgres:
TENANT_PAIR_TEST_PG_URL=postgres://user:pass@host:5432/db npm test
Status
Foundation build. Reviewed (Cold-Cross-Review + MCP Factory Reviewer + Tester) โ all HIGH/MEDIUM findings fixed. tsc clean (strict), 142 tests green (+1 Postgres-conditional skip). Prod dependency tree carries 0 known advisories (npm audit --omit=dev).
About StudioMeyer
StudioMeyer is an AI and design studio based in Palma de Mallorca, working with clients worldwide. We build custom websites and AI infrastructure for small and medium businesses. Production stack on Claude Agent SDK, MCP and n8n, with Sentry, Langfuse and LangGraph for observability and an in-house guard layer.
Frequently asked questions
What is MCP Tenant Pair MCP Server?
Multi-user tenancy library for MCP servers. Pairs, groups, bi-temporal shared state, DSGVO erasure.
How do I install MCP Tenant Pair MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. MCP Tenant Pair MCP Server runs locally from the npm package mcp-tenant-pair-demo with the command npx -y mcp-tenant-pair-demo@0.1.3.
Is MCP Tenant Pair MCP Server free and open source?
Yes. MCP Tenant Pair MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does MCP Tenant Pair MCP Server support remote (HTTP) connections?
No remote endpoint is listed for MCP Tenant Pair MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does MCP Tenant Pair MCP Server provide?
MCP Tenant Pair MCP Server provides 13 tools, including ManualResolver, accept_invite, create_pair, and forget_member. See the full tool list for descriptions and parameters.
How is MCP Tenant Pair MCP Server's trust score calculated?
MCP Tenant Pair MCP Server scores 65 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yetโBe the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.