PatchLabs MCP server
Commit Nov 15, 2026Performs security leak checks and provides automated fixes for AI-built applications, focusing on RLS, headers, and data exposure.
Also known as manra399/patchlabs
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 3.1.0
- Last commit
- Nov 15, 2026
- License
- —
What is PatchLabs MCP?
PatchLabs performs security leak checks and provides automated fixes for AI-built applications, focusing on RLS, headers, and data exposure.
Summary generated from the project's README
About PatchLabs MCP server
PatchLabs provides security leak detection and automated remediation for applications built with AI. It focuses on identifying vulnerabilities related to Row Level Security (RLS), improper headers, and unintended data exposure. Developers use this service to scan GitHub repositories to ensure personal data is not accessible to unauthorized users.
The system operates by rebuilding a database from a repository's migrations within a controlled lab environment. It utilizes a pipeline involving Docker and Claude Code to find leaks and generate fixes. The service employs different Claude models for this process, starting with Haiku and escalating to Sonnet or Opus if the initial lab proof fails.
Users can interact with the service through the web interface or via the MCP server. The MCP implementation provides specific tools such as rls_check, start_check, get_check, list_apps, and run_check. Integration requires a GitHub repository and email for initial checks, while API access for CI/CD workflows uses X-API-Key authentication.
What you can do with it
- 1Verify Row Level SecurityAn AI client can use the specialized RLS tool to check for database access vulnerabilities.
Written from the project's README. Every use case is checked against a quote from it.
How to install PatchLabs MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall PatchLabs MCP in Claude Code
$ claude mcp add --transport http patchlabs https://api.patchlabs.dev/mcpInstall PatchLabs MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"patchlabs": {
"url": "https://api.patchlabs.dev/mcp"
}
}
}Install PatchLabs MCP in VS Code
.vscode/mcp.json
{
"servers": {
"patchlabs": {
"type": "http",
"url": "https://api.patchlabs.dev/mcp"
}
}
}Install PatchLabs MCP in VS Code CLI
$ code --add-mcp '{"name":"patchlabs","type":"http","url":"https://api.patchlabs.dev/mcp"}'Install PatchLabs MCP in Codex
$ codex mcp add patchlabs --url https://api.patchlabs.dev/mcpInstall PatchLabs MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.patchlabs] url = "https://api.patchlabs.dev/mcp"
Install PatchLabs MCP in Gemini CLI
$ gemini mcp add -s user --transport http patchlabs https://api.patchlabs.dev/mcpInstall PatchLabs MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"patchlabs": {
"url": "https://api.patchlabs.dev/mcp",
"type": "http"
}
}
}Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablemanra399/patchlabs is public and reachablegithub.com/manra399/patchlabs ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-11-15github.com/manra399/patchlabs ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeinitialize answered with protocol 2025-06-18 in 428 msPass
README
View on GitHubPatchLabs
Leak checks and tested fixes for AI-built apps: https://patchlabs.dev
| Part | Where | Runs on |
|---|---|---|
docs/ |
Website: landing page, check status and report page, privacy | GitHub Pages (patchlabs.dev) |
api/ |
FastAPI: checks, accounts, workspaces, monitored apps, receipts, free RLS tool, MCP (see API below) | Azure Container Apps (api.patchlabs.dev) |
db/schema.sql |
Postgres schema, idempotent and additive; applied by the API on start | Azure Database for PostgreSQL, database patchlabs |
worker/ |
Takes verified checks, runs the lab pipeline (Docker + Claude Code), posts reports; deletes run folders older than 30 days | Manraj's Mac, kept alive by launchd |
Flow
- Visitor enters a GitHub repo and email on patchlabs.dev →
POST /checks. - They prove the repo is theirs by committing
patchlabs-verify.txtwith a one-time code →POST /checks/{id}/verify. - The worker claims the check (
POST /worker/claim), rebuilds the database from the repo's migrations in a lab, finds personal data the wrong people can read, has the fix agent write a fix (Haiku first, escalating to Sonnet then Opus only if the lab proof fails), and posts the report (POST /worker/checks/{id}/result). - The check page shows the report, the proof table and the fix, and offers the fix as a download. An email goes out at each step once SMTP is configured.
API
Contract: SPEC.md. JSON everywhere; errors are {"detail": "..."}. Signed-in calls send Authorization: Bearer <session>,
CI calls send X-API-Key: pl_live_..., worker and admin calls send their bearer tokens.
| Module | Endpoints |
|---|---|
app.py |
GET /health, POST /checks, GET /checks/{id}, POST /checks/{id}/verify, POST /worker/heartbeat|claim (claim also runs the scheduler), POST /worker/checks/{id}/result, GET /admin/checks |
accounts.py |
POST /workspaces/{wid}/webhook/rotate-secret, POST /auth/start|finish|logout, POST /invites/accept, GET|PATCH|DELETE /me, GET /me/export, GET /me/checks, GET|PATCH /workspaces/{wid}, POST /workspaces/{wid}/webhook/test, POST /workspaces/{wid}/invites, DELETE /workspaces/{wid}/invites/{id}, PATCH|DELETE /workspaces/{wid}/members/{uid}, GET|POST /workspaces/{wid}/api-keys, DELETE /workspaces/{wid}/api-keys/{kid}, POST /workspaces/{wid}/upgrade-request, GET /admin/workspaces, PATCH /admin/workspaces/{wid}, GET /admin/upgrade-requests |
monitor.py |
GET|POST /workspaces/{wid}/apps, GET|PATCH|DELETE /apps/{aid}, POST /apps/{aid}/verify, POST /apps/{aid}/checks, GET /badge/{aid}.svg, GET /public/apps/{aid}, GET /stats, POST /v1/apps/{aid}/checks, GET /v1/checks/{cid} |
receipts.py |
POST /checks/{id}/decision, POST /checks/{id}/answers, GET /checks/{id}/decisions (members), GET /receipts/{id}, GET /.well-known/patchlabs-receipt-key |
rls.py |
POST /tools/rls-check |
mcp_server.py |
POST /mcp (tools: rls_check, start_check, get_check, list_apps, run_check) |
Env: DATABASE_URL, WORKER_TOKEN, ADMIN_TOKEN, SITE_URL, CORS_ORIGINS, SMTP_*, RECEIPT_PRIVATE_KEY (required: base64
of a 32-byte Ed25519 seed, python3 -c "import os,base64;print(base64.b64encode(os.urandom(32)).decode())"; the API refuses to
start without it unless PATCHLABS_DEV=1), optional GITHUB_TOKEN, FOUNDER_EMAIL. Test hooks: EMAIL_OUTBOX, GITHUB_API,
RAW_GITHUB. Security rules (rate limits, verification, masking): see "Security rules" in SPEC.md.
Webhooks are signed: X-PatchLabs-Signature: v1=<hex HMAC-SHA256 of "<timestamp>.<raw body>"> with the workspace's
whsec_ secret and X-PatchLabs-Timestamp; verification snippet at https://patchlabs.dev/docs/webhooks#security.
Verify a receipt (signed bytes are the receipt as JSON with sorted keys and (",", ":") separators):
import base64, json, urllib.request
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
API, CHECK = "https://api.patchlabs.dev", "<check id>"
r = json.load(urllib.request.urlopen(f"{API}/receipts/{CHECK}"))
k = json.load(urllib.request.urlopen(f"{API}/.well-known/patchlabs-receipt-key"))
assert r["key_id"] == k["key_id"], "signed with a different key"
msg = json.dumps(r["receipt"], sort_keys=True, separators=(",", ":")).encode()
pub = Ed25519PublicKey.from_public_bytes(base64.b64decode(k["public_key"]))
pub.verify(base64.b64decode(r["signature"]), msg) # raises InvalidSignature if anything was changed
print("receipt is genuine:", r["receipt"]["status"], r["receipt"]["tables_leaking"])
Tests: tools/test-api.sh runs the whole suite in Docker (throwaway postgres:17 + python:3.13-slim) and cleans up after
itself; extra arguments go to pytest, e.g. tools/test-api.sh -k webhook -x.
Deploy the API
TAG=$(date +%Y%m%d%H%M)
az acr build -r sponsorjobsregistry -t patchlabs-api:$TAG -f api/Dockerfile .
az containerapp update -g ics-rg -n patchlabs-api --image sponsorjobsregistry.azurecr.io/patchlabs-api:$TAG
Before the first v2 deploy, set RECEIPT_PRIVATE_KEY as a secret on the container app: without it the new image won't start.
PatchLabs MCP questions
How do I add PatchLabs MCP to Claude Code?
Run claude mcp add --transport http patchlabs https://api.patchlabs.dev/mcp in your terminal. Add --scope user to make it available in every project.
How do I add PatchLabs MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How do I verify that I own a GitHub repository for a check?
You must prove ownership by committing a file named patchlabs-verify.txt containing a one-time code to the repository.
What tools are available through the MCP server?
The MCP server provides tools for RLS checks, starting a check, getting a check, listing apps, and running a check.