shipready-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipmate (https://shipmate.agency)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: shipready-mcp
3
+ Version: 0.1.0
4
+ Summary: Zero-dependency MCP server by Shipmate for local Next.js, Supabase, and Stripe pre-launch security checks.
5
+ Author-email: Shipmate <hello@shipmate.agency>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://shipmate.agency
8
+ Project-URL: Rules, https://shipmate.agency/rules/
9
+ Keywords: mcp,security,supabase,nextjs,stripe,cursor,claude
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ <p align="center">
16
+ <a href="https://shipmate.agency/rules/">
17
+ <img src="./assets/banner.png" alt="ShipReady MCP Server by Shipmate — Local security scanner for Cursor, Claude Code & Windsurf" width="840" />
18
+ </a>
19
+ </p>
20
+
21
+ # ShipReady MCP Server — Local Security Checks for Cursor & Claude Code
22
+
23
+ <!-- mcp-name: agency.shipmate/shipready-mcp -->
24
+
25
+ [![Shipmate](https://img.shields.io/badge/Shipmate-shipmate.agency-1E57A8?style=flat-square)](https://shipmate.agency)
26
+ [![MCP Protocol](https://img.shields.io/badge/MCP-stdio_JSON--RPC-11141C?style=flat-square)](./server.json)
27
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-0_(Python_3.10+)-11141C?style=flat-square)](./server.py)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-11141C?style=flat-square)](./LICENSE)
29
+
30
+ **ShipReady MCP** runs [Shipmate's](https://shipmate.agency) pre-launch security checks directly inside **Cursor**, **Claude Code**, and **Windsurf**. It scans local repositories for the vulnerabilities most frequently shipped in AI-built **Next.js, Supabase, and Stripe** apps — 100% locally with zero dependencies and zero code leaving your machine.
31
+
32
+ ## What `shipready_scan_repo` Detects
33
+ | Rule ID | Severity | What It Catches | Docs |
34
+ |---|---|---|---|
35
+ | `SR-SUPA-001` | Medium | SQL table created without `ENABLE ROW LEVEL SECURITY` | [Fix guide](https://shipmate.agency/rules/supabase-missing-rls/) |
36
+ | `SR-SUPA-002` | Medium | Write RLS policy using `USING (true)` | [Fix guide](https://shipmate.agency/rules/supabase-policy-using-true/) |
37
+ | `SR-SUPA-003` | High | Supabase `service_role` key exposed in source | [Fix guide](https://shipmate.agency/rules/supabase-service-role-key-exposed/) |
38
+ | `SR-SEC-001` | High | Server secret in `NEXT_PUBLIC_` / `VITE_` env var | [Fix guide](https://shipmate.agency/rules/secret-in-public-env-var/) |
39
+ | `SR-SEC-002` | High | Hardcoded live Stripe, OpenAI, Anthropic, or GitHub key | [Fix guide](https://shipmate.agency/rules/hardcoded-api-key/) |
40
+ | `SR-SEC-003` | Medium | `.env` file present and not in `.gitignore` | [Fix guide](https://shipmate.agency/rules/env-file-not-gitignored/) |
41
+ | `SR-PAY-001` | Medium | Stripe webhook handler missing `constructEvent` | [Fix guide](https://shipmate.agency/rules/stripe-webhook-no-signature-check/) |
42
+
43
+ ## Quick Install
44
+
45
+ ShipReady MCP is not published on PyPI or npm yet, so install it from this repository. Needs Python 3.10+.
46
+
47
+ ```bash
48
+ git clone https://github.com/Shipmate-agency/shipready-mcp
49
+ ```
50
+
51
+ Then point your client at the absolute path of `server.py` in that clone (replace `/path/to/shipready-mcp` below). With [uv](https://docs.astral.sh/uv/) you can skip the clone and use `"command": "uvx", "args": ["--from", "git+https://github.com/Shipmate-agency/shipready-mcp", "shipready-mcp"]` instead.
52
+
53
+ ### Cursor (`.cursor/mcp.json` in your project, or `~/.cursor/mcp.json`)
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "shipready": {
58
+ "command": "python3",
59
+ "args": ["/path/to/shipready-mcp/server.py"]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Claude Code
66
+ ```bash
67
+ claude mcp add shipready -- python3 /path/to/shipready-mcp/server.py
68
+ ```
69
+
70
+ ### Windsurf (`~/.codeium/windsurf/mcp_config.json`)
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "shipready": {
75
+ "command": "python3",
76
+ "args": ["/path/to/shipready-mcp/server.py"]
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ Then ask the agent to run `shipready_scan_repo` on your project directory. The scanner checks the seven rules in the table above; `shipready_list_rules` lists all 14 ShipReady rules; the other seven (HTTP headers, exposed dotfiles, public schema) need a live deployment and are not checked locally.
83
+
84
+ ### Included IDE Guardrails
85
+ - [`rules/shipmate-security.mdc`](./rules/shipmate-security.mdc) — Cursor rule; copy it into your project's `.cursor/rules/`
86
+ - [`cursorrules.txt`](./cursorrules.txt) — Drop-in `.cursorrules` security invariants
87
+ - [`CLAUDE.security.md`](./CLAUDE.security.md) — Drop-in Claude Code security section
88
+
89
+ ## Static Scan vs. Human Security Review
90
+ Automated checks catch known patterns, not business-logic IDOR, multi-tenant authorization bypasses, or billing edge cases.
91
+ - **Free passive surface check ($0, no card):** https://shipmate.agency/check
92
+ - **Launch Lockdown ($950 once, 1 PR) · Pentest + Letter ($2,950 once):** https://shipmate.agency
93
+ - **Related:** [`shipready` CLI & GitHub Action](https://github.com/Shipmate-agency/shipready) · [`awesome-vibe-code-security`](https://github.com/Shipmate-agency/awesome-vibe-code-security)
@@ -0,0 +1,79 @@
1
+ <p align="center">
2
+ <a href="https://shipmate.agency/rules/">
3
+ <img src="./assets/banner.png" alt="ShipReady MCP Server by Shipmate — Local security scanner for Cursor, Claude Code & Windsurf" width="840" />
4
+ </a>
5
+ </p>
6
+
7
+ # ShipReady MCP Server — Local Security Checks for Cursor & Claude Code
8
+
9
+ <!-- mcp-name: agency.shipmate/shipready-mcp -->
10
+
11
+ [![Shipmate](https://img.shields.io/badge/Shipmate-shipmate.agency-1E57A8?style=flat-square)](https://shipmate.agency)
12
+ [![MCP Protocol](https://img.shields.io/badge/MCP-stdio_JSON--RPC-11141C?style=flat-square)](./server.json)
13
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-0_(Python_3.10+)-11141C?style=flat-square)](./server.py)
14
+ [![License: MIT](https://img.shields.io/badge/License-MIT-11141C?style=flat-square)](./LICENSE)
15
+
16
+ **ShipReady MCP** runs [Shipmate's](https://shipmate.agency) pre-launch security checks directly inside **Cursor**, **Claude Code**, and **Windsurf**. It scans local repositories for the vulnerabilities most frequently shipped in AI-built **Next.js, Supabase, and Stripe** apps — 100% locally with zero dependencies and zero code leaving your machine.
17
+
18
+ ## What `shipready_scan_repo` Detects
19
+ | Rule ID | Severity | What It Catches | Docs |
20
+ |---|---|---|---|
21
+ | `SR-SUPA-001` | Medium | SQL table created without `ENABLE ROW LEVEL SECURITY` | [Fix guide](https://shipmate.agency/rules/supabase-missing-rls/) |
22
+ | `SR-SUPA-002` | Medium | Write RLS policy using `USING (true)` | [Fix guide](https://shipmate.agency/rules/supabase-policy-using-true/) |
23
+ | `SR-SUPA-003` | High | Supabase `service_role` key exposed in source | [Fix guide](https://shipmate.agency/rules/supabase-service-role-key-exposed/) |
24
+ | `SR-SEC-001` | High | Server secret in `NEXT_PUBLIC_` / `VITE_` env var | [Fix guide](https://shipmate.agency/rules/secret-in-public-env-var/) |
25
+ | `SR-SEC-002` | High | Hardcoded live Stripe, OpenAI, Anthropic, or GitHub key | [Fix guide](https://shipmate.agency/rules/hardcoded-api-key/) |
26
+ | `SR-SEC-003` | Medium | `.env` file present and not in `.gitignore` | [Fix guide](https://shipmate.agency/rules/env-file-not-gitignored/) |
27
+ | `SR-PAY-001` | Medium | Stripe webhook handler missing `constructEvent` | [Fix guide](https://shipmate.agency/rules/stripe-webhook-no-signature-check/) |
28
+
29
+ ## Quick Install
30
+
31
+ ShipReady MCP is not published on PyPI or npm yet, so install it from this repository. Needs Python 3.10+.
32
+
33
+ ```bash
34
+ git clone https://github.com/Shipmate-agency/shipready-mcp
35
+ ```
36
+
37
+ Then point your client at the absolute path of `server.py` in that clone (replace `/path/to/shipready-mcp` below). With [uv](https://docs.astral.sh/uv/) you can skip the clone and use `"command": "uvx", "args": ["--from", "git+https://github.com/Shipmate-agency/shipready-mcp", "shipready-mcp"]` instead.
38
+
39
+ ### Cursor (`.cursor/mcp.json` in your project, or `~/.cursor/mcp.json`)
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "shipready": {
44
+ "command": "python3",
45
+ "args": ["/path/to/shipready-mcp/server.py"]
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ ### Claude Code
52
+ ```bash
53
+ claude mcp add shipready -- python3 /path/to/shipready-mcp/server.py
54
+ ```
55
+
56
+ ### Windsurf (`~/.codeium/windsurf/mcp_config.json`)
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "shipready": {
61
+ "command": "python3",
62
+ "args": ["/path/to/shipready-mcp/server.py"]
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ Then ask the agent to run `shipready_scan_repo` on your project directory. The scanner checks the seven rules in the table above; `shipready_list_rules` lists all 14 ShipReady rules; the other seven (HTTP headers, exposed dotfiles, public schema) need a live deployment and are not checked locally.
69
+
70
+ ### Included IDE Guardrails
71
+ - [`rules/shipmate-security.mdc`](./rules/shipmate-security.mdc) — Cursor rule; copy it into your project's `.cursor/rules/`
72
+ - [`cursorrules.txt`](./cursorrules.txt) — Drop-in `.cursorrules` security invariants
73
+ - [`CLAUDE.security.md`](./CLAUDE.security.md) — Drop-in Claude Code security section
74
+
75
+ ## Static Scan vs. Human Security Review
76
+ Automated checks catch known patterns, not business-logic IDOR, multi-tenant authorization bypasses, or billing edge cases.
77
+ - **Free passive surface check ($0, no card):** https://shipmate.agency/check
78
+ - **Launch Lockdown ($950 once, 1 PR) · Pentest + Letter ($2,950 once):** https://shipmate.agency
79
+ - **Related:** [`shipready` CLI & GitHub Action](https://github.com/Shipmate-agency/shipready) · [`awesome-vibe-code-security`](https://github.com/Shipmate-agency/awesome-vibe-code-security)
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "shipready-mcp"
7
+ version = "0.1.0"
8
+ description = "Zero-dependency MCP server by Shipmate for local Next.js, Supabase, and Stripe pre-launch security checks."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{ name = "Shipmate", email = "hello@shipmate.agency" }]
13
+ keywords = ["mcp", "security", "supabase", "nextjs", "stripe", "cursor", "claude"]
14
+
15
+ [project.urls]
16
+ Homepage = "https://shipmate.agency"
17
+ Rules = "https://shipmate.agency/rules/"
18
+
19
+ [project.scripts]
20
+ shipready-mcp = "server:main"
21
+
22
+ [tool.setuptools]
23
+ py-modules = ["server"]
@@ -0,0 +1,339 @@
1
+ #!/usr/bin/env python3
2
+ """ShipReady MCP Server (zero-dependency Python 3 stdio JSON-RPC 2.0).
3
+
4
+ Exposes ShipReady static pre-launch security checks inside Cursor, Claude Code,
5
+ and Windsurf so AI coding agents can check repos for Supabase RLS, exposed
6
+ secrets, and unsigned Stripe webhooks locally.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import base64
12
+ import fnmatch
13
+ import importlib.util
14
+ import json
15
+ import os
16
+ import re
17
+ import sys
18
+ from pathlib import Path
19
+ from typing import Any
20
+
21
+ SERVER_INFO = {"name": "shipready-mcp", "version": "0.1.0"}
22
+ # Handshake-era revisions this server implements (2025-03-26 omitted: it requires JSON-RPC batches).
23
+ SUPPORTED_PROTOCOL_VERSIONS = ("2025-11-25", "2025-06-18", "2024-11-05")
24
+ RULES_BASE = "https://shipmate.agency/rules/"
25
+ LOCKDOWN_NOTE = (
26
+ "Automated static checks cannot verify business-logic IDOR, multi-tenant edge cases, "
27
+ "or payment flows. Want a person to test your app and ship fixes in one PR? "
28
+ "https://shipmate.agency/lockdown"
29
+ )
30
+
31
+ FALLBACK_RULES = [
32
+ {"id": "SR-SUPA-001", "slug": "supabase-missing-rls", "severity": "medium", "title": "SQL table created without Row Level Security"},
33
+ {"id": "SR-SUPA-002", "slug": "supabase-policy-using-true", "severity": "medium", "title": "Write policy allows everyone with USING (true)"},
34
+ {"id": "SR-SUPA-003", "slug": "supabase-service-role-key-exposed", "severity": "high", "title": "Supabase service_role key in source code"},
35
+ {"id": "SR-SUPA-004", "slug": "supabase-public-schema-exposed", "severity": "medium", "title": "Tables listed to the anon key in the public schema"},
36
+ {"id": "SR-SEC-001", "slug": "secret-in-public-env-var", "severity": "high", "title": "Server secret in a client-exposed env var"},
37
+ {"id": "SR-SEC-002", "slug": "hardcoded-api-key", "severity": "high", "title": "API key or private key hardcoded in source"},
38
+ {"id": "SR-SEC-003", "slug": "env-file-not-gitignored", "severity": "medium", "title": "Env file present and not in .gitignore"},
39
+ {"id": "SR-PAY-001", "slug": "stripe-webhook-no-signature-check", "severity": "medium", "title": "Stripe webhook handler without signature check"},
40
+ {"id": "SR-WEB-001", "slug": "missing-csp", "severity": "medium", "title": "Content-Security-Policy header missing"},
41
+ {"id": "SR-WEB-002", "slug": "missing-hsts", "severity": "medium", "title": "Strict-Transport-Security header missing"},
42
+ {"id": "SR-WEB-003", "slug": "missing-x-frame-options", "severity": "low", "title": "Clickjacking protection missing"},
43
+ {"id": "SR-WEB-004", "slug": "missing-nosniff", "severity": "low", "title": "X-Content-Type-Options: nosniff missing"},
44
+ {"id": "SR-WEB-005", "slug": "missing-referrer-policy", "severity": "low", "title": "Referrer-Policy header missing"},
45
+ {"id": "SR-WEB-007", "slug": "exposed-dotfile", "severity": "high", "title": "Env or git file served publicly"},
46
+ ]
47
+ RULE_BY_ID = {r["id"]: r for r in FALLBACK_RULES}
48
+
49
+ SKIP_DIRS = {".git", "node_modules", ".next", "dist", "build", ".venv", "venv", "__pycache__"}
50
+ PUBLIC_SECRET_RE = re.compile(
51
+ r"\b(?:NEXT_PUBLIC_|VITE_|PUBLIC_)[A-Z0-9_]*(?:SECRET|SERVICE_ROLE|PRIVATE|API_KEY|TOKEN)[A-Z0-9_]*\s*=",
52
+ re.IGNORECASE,
53
+ )
54
+ HARDCODED_KEY_RE = re.compile(r"\b(?:[sr]k_live_[A-Za-z0-9]{16,}|sk-(?:proj-|ant-)?[A-Za-z0-9_-]{24,}|ghp_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{60,})\b")
55
+ # The service_role key is a JWT whose payload says role=service_role; the literal word is not in it.
56
+ JWT_RE = re.compile(r"\beyJ[A-Za-z0-9_-]+\.(eyJ[A-Za-z0-9_-]+)\.[A-Za-z0-9_-]+")
57
+ SB_SECRET_RE = re.compile(r"\bsb_secret_[A-Za-z0-9_-]{20,}")
58
+ CREATE_TABLE_RE =re.compile(r"create\s+table\s+(?:if\s+not\s+exists\s+)?([a-zA-Z0-9_.\"]+)", re.IGNORECASE)
59
+ ENABLE_RLS_RE = re.compile(
60
+ r"alter\s+table\s+(?:if\s+exists\s+)?(?:only\s+)?([a-zA-Z0-9_.\"]+)\s+enable\s+row\s+level\s+security", re.IGNORECASE
61
+ )
62
+ POLICY_RE = re.compile(r"create\s+policy[^;]*", re.IGNORECASE) # one statement, so checks cannot bleed into the next policy
63
+ FOR_SELECT_RE = re.compile(r"\bfor\s+select\b", re.IGNORECASE) # no FOR clause means FOR ALL
64
+ ALLOW_ALL_RE = re.compile(r"\b(?:using|with\s+check)\s*\(\s*true\s*\)", re.IGNORECASE)
65
+ # service_role bypasses RLS anyway, so a policy granted only TO service_role opens nothing
66
+ SERVICE_ROLE_ONLY_RE = re.compile(r"\bto\s+service_role\b(?!\s*,)", re.IGNORECASE)
67
+
68
+
69
+ def _load_shipready_module() -> Any | None:
70
+ candidates = []
71
+ env_path = os.environ.get("SHIPREADY_CHECK_PY")
72
+ if env_path:
73
+ candidates.append(Path(env_path))
74
+ candidates.append(Path(__file__).resolve().parent / "check.py")
75
+ for cand in candidates:
76
+ if cand.is_file():
77
+ spec = importlib.util.spec_from_file_location("shipready_check", cand)
78
+ if spec and spec.loader:
79
+ mod = importlib.util.module_from_spec(spec)
80
+ spec.loader.exec_module(mod)
81
+ return mod
82
+ return None
83
+
84
+
85
+ def _jwt_role(payload: str) -> Any:
86
+ try:
87
+ return json.loads(base64.urlsafe_b64decode(payload + "=" * (-len(payload) % 4))).get("role")
88
+ except (ValueError, AttributeError):
89
+ return None
90
+
91
+
92
+ def _line_no(text: str, pos: int) -> int:
93
+ return text.count("\n", 0, pos) + 1
94
+
95
+
96
+ def _fallback_scan(root: Path) -> list[dict[str, Any]]:
97
+ findings: list[dict[str, Any]] = []
98
+
99
+ def add(rule_id: str, rel: str, line: int, detail: str) -> None:
100
+ r = RULE_BY_ID[rule_id]
101
+ findings.append({
102
+ "rule_id": rule_id,
103
+ "severity": r["severity"],
104
+ "title": r["title"],
105
+ "file": rel,
106
+ "line": line,
107
+ "detail": detail,
108
+ "fix_url": f"{RULES_BASE}{r['slug']}/",
109
+ })
110
+
111
+ gitignore = (root / ".gitignore").read_text(encoding="utf-8", errors="ignore") if (root / ".gitignore").is_file() else ""
112
+ # shortcut: root .gitignore only, negations ignored; use `git check-ignore` if this misfires.
113
+ ignore_patterns = [p.strip().lstrip("/") for p in gitignore.splitlines() if p.strip() and p.strip()[0] not in "#!"]
114
+
115
+ def gitignored(name: str) -> bool:
116
+ return any(fnmatch.fnmatch(name, p) for p in ignore_patterns)
117
+
118
+ if (root / ".env").is_file() and not gitignored(".env"):
119
+ add("SR-SEC-003", ".env", 1, ".env file exists and is not listed in .gitignore")
120
+
121
+ created: list[tuple[str, str, int]] = []
122
+ rls_enabled: set[str] = set()
123
+ for dirpath, dirnames, filenames in os.walk(root):
124
+ dirnames[:] = [d for d in dirnames if d not in SKIP_DIRS]
125
+ for fname in filenames:
126
+ fpath = Path(dirpath) / fname
127
+ if fpath.is_symlink():
128
+ continue
129
+ try:
130
+ if fpath.stat().st_size > 512_000:
131
+ continue
132
+ text = fpath.read_text(encoding="utf-8", errors="ignore")
133
+ except OSError:
134
+ continue
135
+ rel = str(fpath.relative_to(root))
136
+
137
+ if fname.endswith(".sql"):
138
+ for m in CREATE_TABLE_RE.finditer(text):
139
+ created.append((m.group(1).replace('"', ""), rel, _line_no(text, m.start())))
140
+ rls_enabled.update(m.group(1).replace('"', "").split(".")[-1].lower() for m in ENABLE_RLS_RE.finditer(text))
141
+ for m in POLICY_RE.finditer(text):
142
+ if not FOR_SELECT_RE.search(m.group(0)) and ALLOW_ALL_RE.search(m.group(0)) and not SERVICE_ROLE_ONLY_RE.search(m.group(0)):
143
+ add("SR-SUPA-002", rel, _line_no(text, m.start()), "Write policy uses USING (true) or WITH CHECK (true)")
144
+
145
+ for m in PUBLIC_SECRET_RE.finditer(text):
146
+ add("SR-SEC-001", rel, _line_no(text, m.start()), f"Client-exposed secret env var: {m.group(0).split('=')[0].strip()}")
147
+
148
+ # Keys in a gitignored .env are where they belong; only committed files count.
149
+ for m in ([] if fname.startswith(".env") and gitignored(fname) else HARDCODED_KEY_RE.finditer(text)):
150
+ add("SR-SEC-002", rel, _line_no(text, m.start()), "Hardcoded live API key detected")
151
+
152
+ for m in ([] if fname.startswith(".env") and gitignored(fname) else JWT_RE.finditer(text)):
153
+ if _jwt_role(m.group(1)) == "service_role":
154
+ add("SR-SUPA-003", rel, _line_no(text, m.start()), "Hardcoded Supabase service_role JWT")
155
+ for m in ([] if fname.startswith(".env") and gitignored(fname) else SB_SECRET_RE.finditer(text)):
156
+ add("SR-SUPA-003", rel, _line_no(text, m.start()), "Hardcoded Supabase secret key (sb_secret_)")
157
+
158
+ # An unsigned handler often never imports stripe, so the path or event names count too.
159
+ is_stripe = "stripe" in rel.lower() or "stripe" in text.lower() or "checkout.session" in text
160
+ if "webhook" in rel.lower() and is_stripe and "constructEvent" not in text:
161
+ add("SR-PAY-001", rel, 1, "Stripe webhook handler does not call stripe.webhooks.constructEvent")
162
+
163
+ # RLS is often enabled in a later migration, so match tables across all .sql files.
164
+ for tbl, rel, line in created:
165
+ if tbl.split(".")[-1].lower() not in rls_enabled:
166
+ add("SR-SUPA-001", rel, line, f"Table {tbl} created without ENABLE ROW LEVEL SECURITY")
167
+ return findings
168
+
169
+
170
+ def scan_repo(path_str: str) -> dict[str, Any]:
171
+ target = Path(path_str).expanduser().resolve()
172
+ if not target.exists() or not target.is_dir():
173
+ raise ValueError(f"Directory does not exist: {path_str}")
174
+
175
+ mod = _load_shipready_module()
176
+ if mod is not None and hasattr(mod, "check_repo"):
177
+ raw = mod.check_repo(target)
178
+ findings = []
179
+ for f in raw:
180
+ if getattr(f, "status", "") == "PASS":
181
+ continue
182
+ rid = getattr(f, "rule", "") or ""
183
+ if not rid:
184
+ continue
185
+ r = RULE_BY_ID.get(rid, {"severity": "medium", "title": rid, "slug": ""})
186
+ findings.append({
187
+ "rule_id": rid,
188
+ "severity": r["severity"],
189
+ "title": str(getattr(f, "title", r["title"])),
190
+ "file": str(getattr(f, "location", "")),
191
+ "line": int(getattr(f, "line", 1) or 1),
192
+ "detail": str(getattr(f, "detail", r["title"])),
193
+ "fix_url": f"{RULES_BASE}{r['slug']}/" if r["slug"] else RULES_BASE,
194
+ })
195
+ engine = "shipready-check.py"
196
+ else:
197
+ findings = _fallback_scan(target)
198
+ engine = "shipready-mcp-standalone"
199
+
200
+ return {
201
+ "engine": engine,
202
+ "scanned_path": str(target),
203
+ "finding_count": len(findings),
204
+ "findings": findings,
205
+ "next_step": LOCKDOWN_NOTE,
206
+ }
207
+
208
+
209
+ def list_rules() -> dict[str, Any]:
210
+ return {
211
+ "count": len(FALLBACK_RULES),
212
+ "rules": [{**r, "url": f"{RULES_BASE}{r['slug']}/"} for r in FALLBACK_RULES],
213
+ }
214
+
215
+
216
+ TOOLS = [
217
+ {
218
+ "name": "shipready_scan_repo",
219
+ "description": "Scan a local app repository for common vibe-coded / Next.js / Supabase / Stripe security issues (missing RLS, USING true, exposed secrets, unsigned Stripe webhooks) and return exact rule fix URLs.",
220
+ "inputSchema": {
221
+ "type": "object",
222
+ "properties": {
223
+ "path": {"type": "string", "description": "Absolute or relative path to the local repository directory."}
224
+ },
225
+ "required": ["path"],
226
+ },
227
+ },
228
+ {
229
+ "name": "shipready_list_rules",
230
+ "description": "List all 14 ShipReady security rules with severity and documentation URLs on shipmate.agency/rules/.",
231
+ "inputSchema": {"type": "object", "properties": {}},
232
+ },
233
+ ]
234
+
235
+
236
+ def handle_request(msg: Any) -> dict[str, Any] | None:
237
+ if not isinstance(msg, dict) or not isinstance(msg.get("method"), str):
238
+ req_id = msg.get("id") if isinstance(msg, dict) else None
239
+ return {"jsonrpc": "2.0", "id": req_id, "error": {"code": -32600, "message": "Invalid Request"}}
240
+ method = msg.get("method")
241
+ req_id = msg.get("id")
242
+
243
+ if method == "notifications/initialized" or req_id is None:
244
+ return None
245
+ if method == "ping":
246
+ return {"jsonrpc": "2.0", "id": req_id, "result": {}}
247
+ if method == "initialize":
248
+ requested = (msg.get("params") or {}).get("protocolVersion")
249
+ return {
250
+ "jsonrpc": "2.0",
251
+ "id": req_id,
252
+ "result": {
253
+ "protocolVersion": requested if requested in SUPPORTED_PROTOCOL_VERSIONS else SUPPORTED_PROTOCOL_VERSIONS[0],
254
+ "capabilities": {"tools": {}},
255
+ "serverInfo": SERVER_INFO,
256
+ },
257
+ }
258
+ if method == "tools/list":
259
+ return {"jsonrpc": "2.0", "id": req_id, "result": {"tools": TOOLS}}
260
+ if method == "tools/call":
261
+ params = msg.get("params") or {}
262
+ name = params.get("name")
263
+ args = params.get("arguments") or {}
264
+ if name not in {t["name"] for t in TOOLS}:
265
+ return {"jsonrpc": "2.0", "id": req_id, "error": {"code": -32602, "message": f"Unknown tool: {name}"}}
266
+ try:
267
+ if not isinstance(args, dict):
268
+ raise ValueError("arguments must be an object")
269
+ if name == "shipready_list_rules":
270
+ data = list_rules()
271
+ elif name == "shipready_scan_repo":
272
+ if not isinstance(args.get("path"), str) or not args["path"].strip():
273
+ raise ValueError("Missing required string argument: path")
274
+ data = scan_repo(args["path"])
275
+ return {
276
+ "jsonrpc": "2.0",
277
+ "id": req_id,
278
+ "result": {"content": [{"type": "text", "text": json.dumps(data, indent=2)}]},
279
+ }
280
+ except Exception as exc:
281
+ return {
282
+ "jsonrpc": "2.0",
283
+ "id": req_id,
284
+ "result": {"isError": True, "content": [{"type": "text", "text": str(exc)}]},
285
+ }
286
+ return {"jsonrpc": "2.0", "id": req_id, "error": {"code": -32601, "message": f"Method not found: {method}"}}
287
+
288
+
289
+ def read_message(stream: Any) -> tuple[dict[str, Any] | None, bool]:
290
+ """Read either Content-Length framed or newline-delimited JSON-RPC from stdin."""
291
+ while True:
292
+ line = stream.readline()
293
+ if not line:
294
+ return None, False
295
+ stripped = line.strip()
296
+ if not stripped:
297
+ continue
298
+ if stripped.lower().startswith(b"content-length:"):
299
+ length = int(stripped.split(b":", 1)[1].strip())
300
+ while True:
301
+ hdr = stream.readline()
302
+ if not hdr or hdr in (b"\r\n", b"\n"):
303
+ break
304
+ body = stream.read(length)
305
+ return json.loads(body.decode("utf-8")), True
306
+ return json.loads(stripped.decode("utf-8")), False
307
+
308
+
309
+ def write_message(stream: Any, payload: dict[str, Any], framed: bool) -> None:
310
+ raw = json.dumps(payload, separators=(",", ":")).encode("utf-8")
311
+ if framed:
312
+ stream.write(f"Content-Length: {len(raw)}\r\n\r\n".encode("ascii") + raw)
313
+ else:
314
+ stream.write(raw + b"\n")
315
+ stream.flush()
316
+
317
+
318
+ def main() -> int:
319
+ stdin = sys.stdin.buffer
320
+ stdout = sys.stdout.buffer
321
+ while True:
322
+ try:
323
+ msg, framed = read_message(stdin)
324
+ except ValueError: # bad JSON, bad UTF-8 or bad Content-Length: report and keep serving
325
+ write_message(stdout, {"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": "Parse error"}}, False)
326
+ continue
327
+ if msg is None:
328
+ break
329
+ try:
330
+ resp = handle_request(msg)
331
+ except Exception: # e.g. params of the wrong type; one bad request must not end the session
332
+ resp = {"jsonrpc": "2.0", "id": msg.get("id"), "error": {"code": -32603, "message": "Internal error"}}
333
+ if resp is not None:
334
+ write_message(stdout, resp, framed)
335
+ return 0
336
+
337
+
338
+ if __name__ == "__main__":
339
+ raise SystemExit(main())
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: shipready-mcp
3
+ Version: 0.1.0
4
+ Summary: Zero-dependency MCP server by Shipmate for local Next.js, Supabase, and Stripe pre-launch security checks.
5
+ Author-email: Shipmate <hello@shipmate.agency>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://shipmate.agency
8
+ Project-URL: Rules, https://shipmate.agency/rules/
9
+ Keywords: mcp,security,supabase,nextjs,stripe,cursor,claude
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ <p align="center">
16
+ <a href="https://shipmate.agency/rules/">
17
+ <img src="./assets/banner.png" alt="ShipReady MCP Server by Shipmate — Local security scanner for Cursor, Claude Code & Windsurf" width="840" />
18
+ </a>
19
+ </p>
20
+
21
+ # ShipReady MCP Server — Local Security Checks for Cursor & Claude Code
22
+
23
+ <!-- mcp-name: agency.shipmate/shipready-mcp -->
24
+
25
+ [![Shipmate](https://img.shields.io/badge/Shipmate-shipmate.agency-1E57A8?style=flat-square)](https://shipmate.agency)
26
+ [![MCP Protocol](https://img.shields.io/badge/MCP-stdio_JSON--RPC-11141C?style=flat-square)](./server.json)
27
+ [![Zero Dependencies](https://img.shields.io/badge/Dependencies-0_(Python_3.10+)-11141C?style=flat-square)](./server.py)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-11141C?style=flat-square)](./LICENSE)
29
+
30
+ **ShipReady MCP** runs [Shipmate's](https://shipmate.agency) pre-launch security checks directly inside **Cursor**, **Claude Code**, and **Windsurf**. It scans local repositories for the vulnerabilities most frequently shipped in AI-built **Next.js, Supabase, and Stripe** apps — 100% locally with zero dependencies and zero code leaving your machine.
31
+
32
+ ## What `shipready_scan_repo` Detects
33
+ | Rule ID | Severity | What It Catches | Docs |
34
+ |---|---|---|---|
35
+ | `SR-SUPA-001` | Medium | SQL table created without `ENABLE ROW LEVEL SECURITY` | [Fix guide](https://shipmate.agency/rules/supabase-missing-rls/) |
36
+ | `SR-SUPA-002` | Medium | Write RLS policy using `USING (true)` | [Fix guide](https://shipmate.agency/rules/supabase-policy-using-true/) |
37
+ | `SR-SUPA-003` | High | Supabase `service_role` key exposed in source | [Fix guide](https://shipmate.agency/rules/supabase-service-role-key-exposed/) |
38
+ | `SR-SEC-001` | High | Server secret in `NEXT_PUBLIC_` / `VITE_` env var | [Fix guide](https://shipmate.agency/rules/secret-in-public-env-var/) |
39
+ | `SR-SEC-002` | High | Hardcoded live Stripe, OpenAI, Anthropic, or GitHub key | [Fix guide](https://shipmate.agency/rules/hardcoded-api-key/) |
40
+ | `SR-SEC-003` | Medium | `.env` file present and not in `.gitignore` | [Fix guide](https://shipmate.agency/rules/env-file-not-gitignored/) |
41
+ | `SR-PAY-001` | Medium | Stripe webhook handler missing `constructEvent` | [Fix guide](https://shipmate.agency/rules/stripe-webhook-no-signature-check/) |
42
+
43
+ ## Quick Install
44
+
45
+ ShipReady MCP is not published on PyPI or npm yet, so install it from this repository. Needs Python 3.10+.
46
+
47
+ ```bash
48
+ git clone https://github.com/Shipmate-agency/shipready-mcp
49
+ ```
50
+
51
+ Then point your client at the absolute path of `server.py` in that clone (replace `/path/to/shipready-mcp` below). With [uv](https://docs.astral.sh/uv/) you can skip the clone and use `"command": "uvx", "args": ["--from", "git+https://github.com/Shipmate-agency/shipready-mcp", "shipready-mcp"]` instead.
52
+
53
+ ### Cursor (`.cursor/mcp.json` in your project, or `~/.cursor/mcp.json`)
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "shipready": {
58
+ "command": "python3",
59
+ "args": ["/path/to/shipready-mcp/server.py"]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Claude Code
66
+ ```bash
67
+ claude mcp add shipready -- python3 /path/to/shipready-mcp/server.py
68
+ ```
69
+
70
+ ### Windsurf (`~/.codeium/windsurf/mcp_config.json`)
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "shipready": {
75
+ "command": "python3",
76
+ "args": ["/path/to/shipready-mcp/server.py"]
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ Then ask the agent to run `shipready_scan_repo` on your project directory. The scanner checks the seven rules in the table above; `shipready_list_rules` lists all 14 ShipReady rules; the other seven (HTTP headers, exposed dotfiles, public schema) need a live deployment and are not checked locally.
83
+
84
+ ### Included IDE Guardrails
85
+ - [`rules/shipmate-security.mdc`](./rules/shipmate-security.mdc) — Cursor rule; copy it into your project's `.cursor/rules/`
86
+ - [`cursorrules.txt`](./cursorrules.txt) — Drop-in `.cursorrules` security invariants
87
+ - [`CLAUDE.security.md`](./CLAUDE.security.md) — Drop-in Claude Code security section
88
+
89
+ ## Static Scan vs. Human Security Review
90
+ Automated checks catch known patterns, not business-logic IDOR, multi-tenant authorization bypasses, or billing edge cases.
91
+ - **Free passive surface check ($0, no card):** https://shipmate.agency/check
92
+ - **Launch Lockdown ($950 once, 1 PR) · Pentest + Letter ($2,950 once):** https://shipmate.agency
93
+ - **Related:** [`shipready` CLI & GitHub Action](https://github.com/Shipmate-agency/shipready) · [`awesome-vibe-code-security`](https://github.com/Shipmate-agency/awesome-vibe-code-security)
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ server.py
5
+ shipready_mcp.egg-info/PKG-INFO
6
+ shipready_mcp.egg-info/SOURCES.txt
7
+ shipready_mcp.egg-info/dependency_links.txt
8
+ shipready_mcp.egg-info/entry_points.txt
9
+ shipready_mcp.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ shipready-mcp = server:main