Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/kaminari-ad/mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/kaminari-ad/mcp/mcp-tenant-isolation)<a href="https://agentmods.dev/rules/kaminari-ad/mcp/mcp-tenant-isolation"><img src="https://agentmods.dev/badge/rules/kaminari-ad/mcp/mcp-tenant-isolation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/kaminari-ad/mcp/mcp-tenant-isolation"><img src="https://agentmods.dev/badge/rules/kaminari-ad/mcp/mcp-tenant-isolation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01792 |
| Opus 5.5 | $0.00000 | $0.00717 |
| Sonnet 5.5 | $0.00000 | $0.00358 |
| Haiku 4.5 | $0.00000 | $0.00179 |
Grade A, and why
mcp-tenant-isolation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Tenant Isolation Rules — mcp/ (hosted HTTP mode)
The hosted MCP endpoint at
mcp.kaminari.adserves many organizations from a single process. A bug here = cross-tenant data leak = customer trust event. Read this file before touching any code inmcp/src/presentation/http/,mcp/src/infrastructure/session/, ormcp/src/infrastructure/rate-limit/.
Threat model
The Kaminari Ad API is already secure: middleware resolves the Authorization header into an AuthContext.organization_id, and every use case enforces auth.organization_id == resource.organization_id (see clean-code → "Authorization and org-scoping").
MCP does NOT duplicate those checks. MCP's single job is: the Bearer that came in with request X must reach only the outbound API calls made by request X. Any leak of auth context between concurrent requests = a vulnerability that did not exist at the API.
Hard rules (CI-enforced)
1. No module-level mutable state
let and var are banned at module scope. static class fields must be readonly. ESLint no-restricted-syntax blocks the syntax; mcp/scripts/check-no-shared-state.ts walks the AST as a belt-and-suspenders gate. To bypass either, you must edit BOTH files in the same MR, and reviewers will reject without a multi-tenant safety analysis.
2. No caches indexed by tenant data
Zero caches. No Map<orgId, ...>, no Map<scanId, ...>, no per-Bearer memo, no LRU on tool results. Every tool call is a fresh API request. The performance cost is acceptable; the correctness benefit is non-negotiable.
The two exceptions live in mcp/src/infrastructure/session/ and mcp/src/infrastructure/rate-limit/. They hold only Map<sha256(bearer), {...}> entries, never user data. Both have isolation tests proving they cannot be queried with a different Bearer.
3. ApiGateway per request, never singleton
HttpApiGateway is constructed per incoming HTTP request, from that request's Authorization header. It lives in the request handler's closure and is garbage-collected when the request ends. There is no globalApiGateway.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 108 lines · 0 tokens per session scan A 9dbb0b7bcc4d
mcp-tenant-isolation is a cursor rule published in the GitHub repository kaminari-ad/mcp (0 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,792 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-05.
Other cursor rules, from other repositories
search-routing
Smart Search Routing — always use QMD semantic search when available, never bypass with grep for vault content.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.