
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
mcp-tenant-isolation
Advanced tools
Static analysis scanner for MCP server code and multi-tenant SaaS applications. 57 deterministic rules covering tenant isolation, tool visibility, cache key scoping, RLS, IDOR, and credential vault isolation. MCP server for AI agent integration.
Static analysis scanner for multi-tenant SaaS and MCP server code. Catches cross-tenant data leakage before it reaches production.
57 deterministic rules covering tenant isolation, database query filters, IDOR, cache key scoping, RLS, schema gaps, and MCP-specific risks (tool visibility, cache prefix, session binding, credential vault). Works with Prisma, Drizzle, raw SQL, Next.js, Express, and Fastify. Includes an MCP server for Claude Desktop and Cursor integration.
General-purpose security scanners (Snyk, Semgrep, CodeQL) do not understand tenant isolation patterns or MCP server architecture. Cross-tenant data leakage goes undetected. This tool fills that gap with 57 purpose-built deterministic rules.
Every rule is deterministic and reproducible. No machine learning, no false guesses. Each rule checks for specific code patterns, guard presence, and data flow paths. You get the same results every run.
npm install -g mcp-tenant-isolation
# or use npx (no install needed)
npx mcp-tenant-isolation scan ./src
# or use Docker (no Node.js needed)
docker run --rm -v $(pwd):/code subodhkc/mcp-tenant-isolation scan /code/src
mti scan ./src
mti scan ./src --format sarif --output results.sarif
mti scan ./src --format markdown --output TENANT-ISOLATION-REPORT.md
mti scan ./src --format ai --output findings.json
mti scan ./src --severity HIGH
mti init
| Prefix | Category | Count | Severity | Description |
|---|---|---|---|---|
| TCM | Tenant Context Management | 6 | Critical | Tenant ID from sessions, not client input. Context propagation across async boundaries. |
| DBQ | Database Query Isolation | 10 | Critical | Every query touching tenant-scoped data must include a tenant filter. |
| IDOR | IDOR Prevention | 5 | Critical | ID-based lookups must verify tenant ownership. |
| CSI | Cache and Session Isolation | 4 | High | Cache keys and session data must be tenant-scoped. |
| API | API Security | 3 | High | Tenant-aware rate limiting and response scoping. |
| FSI | File Storage Isolation | 4 | High | S3, Blob, and filesystem access must be tenant-scoped. |
| LOG | Logging and Audit | 4 | Medium | Audit logs must include tenant context. |
| SCH | Schema and Migration | 6 | High | Prisma models and SQL migrations must include tenant columns. |
| ID | Title | Severity | Description |
|---|---|---|---|
| MCP-001 | Tool Visibility Scoping | Critical | Tool handler has no tenant-based allow/deny filter. |
| MCP-002 | Cache Key Tenant Prefix | Critical | Tool results cached without tenant prefix. |
| MCP-003 | Session Binding to User+Tenant | Critical | Session ID used as sole authorization. |
| MCP-004 | Token Exchange (RFC 8693) | High | Original token forwarded instead of token exchange. |
| MCP-005 | Per-Tenant Rate Limiting | Medium | No per-tenant rate limiting on tool calls. |
| MCP-006 | Vector Store Tenant Namespace | High | Shared vector store without tenant namespaces. |
| MCP-007 | Tool Description Injection | Medium | Tool description could bypass isolation. |
| MCP-008 | Credential Vault Tenant Scoping | Critical | Credential vault stores tokens without tenant scoping. |
| MCP-009 | Shared Service Account | High | Single shared API key for all tenant API calls. |
| MCP-010 | Session Cleanup on Disconnect | Medium | No deterministic session cleanup. |
| MCP-011 | Telemetry Tenant Identifier | Low | Telemetry strips tenant identifier. |
| MCP-012 | Local Bind (127.0.0.1) | High | MCP server binds to 0.0.0.0 instead of 127.0.0.1. |
| MCP-013 | Filesystem Tenant Root | High | Tool handler accesses filesystem without tenant root. |
| MCP-014 | Cross-Tenant Artifact Leakage | High | Artifact storage without tenant prefix. |
| MCP-015 | Dynamic Tool Namespace | Medium | Tools registered without tenant namespace. |
The scanner pipeline works in six stages:
mti CLI with scan/init/rules/suppress/baseline/mcp commands. MCP server exposes 4 toolsThe package includes an MCP server for AI agent integration. It runs locally via stdio transport (no hosting required):
{
"mcpServers": {
"tenant-isolation": {
"command": "npx",
"args": ["-y", "mcp-tenant-isolation", "mcp"]
}
}
}
Add this to your Claude Desktop, Cursor, or other MCP client config to let your AI agent scan code for tenant isolation issues on demand.
| Tool | Description |
|---|---|
scan_tenant_isolation | Scan a file path or inline code. Returns structured findings. |
list_tenant_isolation_rules | Returns all 57 rules with metadata. Filterable by category. |
explain_tenant_isolation_rule | Returns rule details, OWASP mapping, CWE IDs, fix suggestions. |
suppress_tenant_isolation_finding | Add a suppression with reason and expiration. |
Add this to .github/workflows/tenant-isolation.yml:
name: Tenant Isolation Scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: subodhkc/mcp-tenant-isolation@v1
with:
path: ./src
severity: HIGH
fail-on: HIGH
Runs the scan, uploads SARIF to GitHub Code Scanning, generates a Markdown report artifact, and fails the workflow if HIGH or CRITICAL findings are detected.
# .github/workflows/tenant-isolation.yml
name: Tenant Isolation Scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npx mcp-tenant-isolation scan ./src --format sarif --output results.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
| Code | Meaning |
|---|---|
| 0 | No findings |
| 1 | Findings found |
| 2 | Error (config invalid, parse failure, etc.) |
When you upload SARIF output using github/codeql-action/upload-sarif@v3, findings appear in your repository's Security > Code scanning alerts tab. This works with both free and Advanced Security-enabled repos.
What happens:
mti scan --format sarif --output results.sarif generates a SARIF 2.1.0 fileupload-sarif action sends it to GitHub's code scanning APIRequirements:
permissions: security-events: write in your workflowCreate .mtirc.json in your project root:
{
"rules": {
"severity": {
"DBQ-001": "HIGH",
"MCP-001": "CRITICAL"
},
"exclude": ["DBQ-010"]
},
"paths": {
"include": ["src/**/*"],
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
},
"suppressions": ".mti-suppressions.json",
"baseline": ".mti-baseline.json"
}
{
"rules": {
"severity": { "DBQ-001": "HIGH" },
"exclude": ["DBQ-010"]
},
"paths": {
"include": ["src/**/*"],
"exclude": ["**/*.test.ts"]
},
"output": "terminal",
"framework": "nextjs-app-router",
"authHelpers": ["requireAuth", "getServerSession", "withAuth"],
"tenantGuards": ["organizationId", "tenantId", "workspaceId"],
"modelScopes": {
"userScoped": ["User", "UserSession"],
"global": ["Tenant", "AuditLog"]
},
"rulePacks": ["./custom-rules.json"],
"suppressions": ".mti-suppressions.json",
"baseline": ".mti-baseline.json"
}
| Field | Description |
|---|---|
output | Default output format: terminal, json, sarif, ai, markdown |
framework | Framework hint: nextjs-app-router, nextjs-pages, express, fastify, auto |
authHelpers | Custom auth function names to detect (reduces false positives) |
tenantGuards | Custom tenant guard variable names beyond the defaults |
modelScopes | Override model scope classification (userScoped, global, tenantScoped) |
rulePacks | Paths to custom rule pack JSON files |
| Format | Flag | Use Case |
|---|---|---|
| Terminal | --format terminal (default) | Developer console with pass/fail verdict |
| JSON | --format json | Programmatic consumption, piping to other tools |
| SARIF | --format sarif | GitHub Code Scanning, Azure DevOps |
| AI JSON | --format ai | AI agent consumption with remediation hints and context |
| Markdown | --format markdown | Shareable report for PRs, team review, documentation |
# Generate a Markdown report for a PR
mti scan ./src --format markdown --output TENANT-ISOLATION-REPORT.md
# Upload SARIF to GitHub Code Scanning
mti scan ./src --format sarif --output results.sarif
MIT. Free and open source.
FAQs
Static analysis scanner for MCP server code and multi-tenant SaaS applications. 57 deterministic rules covering tenant isolation, tool visibility, cache key scoping, RLS, IDOR, and credential vault isolation. MCP server for AI agent integration.
The npm package mcp-tenant-isolation receives a total of 457 weekly downloads. As such, mcp-tenant-isolation popularity was classified as not popular.
We found that mcp-tenant-isolation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.