@kylewadegrove/cutline-mcp-cli-staging 0.1.0

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.
Files changed (43) hide show
  1. package/Dockerfile +11 -0
  2. package/README.md +243 -0
  3. package/dist/auth/callback.d.ts +6 -0
  4. package/dist/auth/callback.js +97 -0
  5. package/dist/auth/keychain.d.ts +3 -0
  6. package/dist/auth/keychain.js +15 -0
  7. package/dist/commands/init.d.ts +4 -0
  8. package/dist/commands/init.js +315 -0
  9. package/dist/commands/login.d.ts +7 -0
  10. package/dist/commands/login.js +166 -0
  11. package/dist/commands/logout.d.ts +1 -0
  12. package/dist/commands/logout.js +25 -0
  13. package/dist/commands/serve.d.ts +1 -0
  14. package/dist/commands/serve.js +38 -0
  15. package/dist/commands/setup.d.ts +7 -0
  16. package/dist/commands/setup.js +425 -0
  17. package/dist/commands/status.d.ts +3 -0
  18. package/dist/commands/status.js +127 -0
  19. package/dist/commands/upgrade.d.ts +3 -0
  20. package/dist/commands/upgrade.js +112 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +72 -0
  23. package/dist/servers/chunk-DE7R7WKY.js +331 -0
  24. package/dist/servers/chunk-IDSVMCGM.js +948 -0
  25. package/dist/servers/chunk-KMUSQOTJ.js +47 -0
  26. package/dist/servers/chunk-OP4EO6FV.js +454 -0
  27. package/dist/servers/chunk-X2B5QUWO.js +1094 -0
  28. package/dist/servers/cutline-server.js +11199 -0
  29. package/dist/servers/data-client-AQ5DGSAR.js +162 -0
  30. package/dist/servers/exploration-server.js +930 -0
  31. package/dist/servers/graph-metrics-KLHCMDFT.js +12 -0
  32. package/dist/servers/integrations-server.js +107 -0
  33. package/dist/servers/output-server.js +107 -0
  34. package/dist/servers/premortem-server.js +971 -0
  35. package/dist/servers/tools-server.js +287 -0
  36. package/dist/utils/config-store.d.ts +8 -0
  37. package/dist/utils/config-store.js +42 -0
  38. package/dist/utils/config.d.ts +22 -0
  39. package/dist/utils/config.js +48 -0
  40. package/mcpb/manifest.json +77 -0
  41. package/package.json +76 -0
  42. package/server.json +42 -0
  43. package/smithery.yaml +10 -0
package/Dockerfile ADDED
@@ -0,0 +1,11 @@
1
+ FROM node:20-slim AS base
2
+
3
+ WORKDIR /app
4
+
5
+ # Install the CLI globally from npm (includes bundled servers)
6
+ RUN npm install -g @vibekiln/cutline-mcp-cli@latest
7
+
8
+ # Default to the main constraints server (cutline-server.js)
9
+ # Override with: docker run ... cutline-mcp serve premortem
10
+ ENTRYPOINT ["cutline-mcp"]
11
+ CMD ["serve", "constraints"]
package/README.md ADDED
@@ -0,0 +1,243 @@
1
+ # Cutline MCP — Engineering Guardrails for Vibecoding
2
+
3
+ **Security, reliability, and scalability constraints for your coding agent.** Free code audits, 9 compliance frameworks, pre-mortem analysis, and a Red-Green-Refactor workflow — all injected directly into Cursor, Claude, Windsurf, or any MCP client.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@vibekiln/cutline-mcp-cli)](https://www.npmjs.com/package/@vibekiln/cutline-mcp-cli)
6
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-ai.thecutline-blue)](https://registry.modelcontextprotocol.io)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Install
10
+
11
+ ### npm (Recommended)
12
+
13
+ ```bash
14
+ npm install -g @vibekiln/cutline-mcp-cli@latest
15
+ ```
16
+
17
+ ### Docker
18
+
19
+ ```bash
20
+ docker run -i ghcr.io/kylewadegrove/cutline-mcp serve constraints
21
+ ```
22
+
23
+ ### Claude Desktop (.mcpb)
24
+
25
+ Download `cutline-mcp.mcpb` from the [latest release](https://github.com/kylewadegrove/cutline/releases) and double-click to install.
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ # 1. Install and run setup (does login + IDE config + rules)
31
+ cd /path/to/your/project
32
+ npm install -g @vibekiln/cutline-mcp-cli@latest
33
+ cutline-mcp setup
34
+ ```
35
+
36
+ Then ask your AI agent: **"use cutline"**
37
+
38
+ Cutline interprets intent and tier:
39
+ - Natural variants also work: `use cutline to ...`, `using cutline, ...`, `with cutline ...`
40
+ - Free/default: runs `code_audit` (generic codebase scan)
41
+ - Premium product-linked: runs `engineering_audit` (deep analysis + RGR)
42
+
43
+ ## What It Does
44
+
45
+ | Capability | Free | Premium |
46
+ |---|---|---|
47
+ | **Code Audit** — security, reliability, scalability scan | 3/month | Unlimited |
48
+ | **9 Compliance Frameworks** — SOC 2, PCI-DSS, HIPAA, GDPR, OWASP LLM, FedRAMP, GLBA, FERPA/COPPA | Auto-loaded | Auto-loaded |
49
+ | **Engineering Audit** — deep product-linked scan + RGR remediation plan | — | Unlimited |
50
+ | **Pre-Mortem Analysis** — risks, assumptions, competitive threats | — | Unlimited |
51
+ | **Constraint Graph** — product-specific NFR routing | — | Full access |
52
+ | **AI Personas** — stakeholder feedback on features | — | Full access |
53
+ | **Idea Validation** — fast-track from free web validation | — | Included |
54
+
55
+ ## 54 MCP Tools
56
+
57
+ ### Free Tier
58
+
59
+ | Tool | Description |
60
+ |---|---|
61
+ | `code_audit` | Security, reliability, and scalability scan (3/month) |
62
+ | `exploration_start` | Start a guided product idea exploration |
63
+ | `exploration_chat` | Continue an exploration conversation |
64
+ | `exploration_graduate` | Graduate top idea (teaser for free, full for premium) |
65
+ | `llm_status` | Check AI/LLM provider health |
66
+ | `perf_status` | Check MCP server performance metrics |
67
+
68
+ ### Premium Tier (50+ tools)
69
+
70
+ **Pre-Mortem & Deep Dive:** `premortem_run`, `premortem_from_idea`, `premortem_queue`, `premortem_status`, `premortem_kick`, `premortem_list`, `premortem_render_pdf`, `premortem_qa`, `premortem_regen_assumptions`, `premortem_regen_experiments`
71
+
72
+ **Personas:** `personas_list`, `personas_get`, `personas_chat`
73
+
74
+ **Constraint Graph:** `constraints_query`, `constraints_auto`, `constraints_ingest`, `constraints_list`, `constraints_learn`, `constraints_embed`, `constraints_semantic_query`, `constraints_ingest_persona`, `constraints_ingest_wiki`, `constraints_ingest_doc`, `constraints_heal`
75
+
76
+ **Graph Operations:** `graph_ingest_requirements`, `graph_get_boundaries`, `graph_bind_codebase`, `graph_bind_confirm`, `graph_view`, `graph_conflicts`, `graph_metrics`
77
+
78
+ **Code & RGR:** `engineering_audit`, `rgr_plan`, `rgr_complete_phase`, `export_readiness_badge`
79
+
80
+ **Wiki & Integrations:** `wiki_load`, `wiki_save`, `wiki_apply_edits`, `agent_chat`, `integrations_create_issues`
81
+
82
+ **Templates:** `template_list`, `template_get`, `template_create`, `template_discover`
83
+
84
+ **Config:** `generate_cutline_md`
85
+
86
+ ## Commands
87
+
88
+ ### `login`
89
+
90
+ Authenticate with Cutline. Opens your browser for a quick email-only signup (no password needed). Stores credentials in your system keychain.
91
+
92
+ ```bash
93
+ cutline-mcp login
94
+ cutline-mcp login --staging # Use staging environment
95
+ cutline-mcp login --signup # Full sign-up page (email + password)
96
+ ```
97
+
98
+ ### `init`
99
+
100
+ Generate IDE-specific config files for your project. Adapts to your tier:
101
+
102
+ ```bash
103
+ cutline-mcp init
104
+ cutline-mcp init --project-root /path/to/project
105
+ ```
106
+
107
+ **Free tier writes:**
108
+ - `.cursor/rules/rgr-workflow.mdc` — RGR cycle with `code_audit`
109
+ - `.cursor/rules/ambient-constraints.mdc` — Constraint checking guidance
110
+ - `CLAUDE.local.md` — Same instructions for Claude Code
111
+
112
+ **Premium tier adds:**
113
+ - `.cursor/rules/cutline.mdc` — Points agent to `.cutline.md`
114
+
115
+ All files are gitignored automatically.
116
+
117
+ ### `setup`
118
+
119
+ Print the MCP server configuration to add to your IDE.
120
+
121
+ ```bash
122
+ cutline-mcp setup
123
+ ```
124
+
125
+ ### `serve <server>`
126
+
127
+ Start an MCP server (used by IDE MCP configs).
128
+
129
+ ```bash
130
+ cutline-mcp serve constraints # Main server (engineering audit, constraints, graph)
131
+ cutline-mcp serve premortem # Pre-mortem and deep dive
132
+ cutline-mcp serve exploration # Idea exploration
133
+ cutline-mcp serve tools # Utility tools
134
+ cutline-mcp serve output # Export and rendering
135
+ cutline-mcp serve integrations # External integrations
136
+ ```
137
+
138
+ ### `upgrade`
139
+
140
+ Open the upgrade page and refresh your session.
141
+
142
+ ```bash
143
+ cutline-mcp upgrade
144
+ ```
145
+
146
+ ### `status` / `logout`
147
+
148
+ ```bash
149
+ cutline-mcp status # Check auth and subscription
150
+ cutline-mcp logout # Remove stored credentials
151
+ ```
152
+
153
+ ## How It Works
154
+
155
+ ### Authentication
156
+
157
+ ```
158
+ 1. cutline-mcp login
159
+ 2. CLI starts local callback server on localhost:8765
160
+ 3. Browser opens — enter email, receive magic link, click it
161
+ 4. CLI receives token and stores it in your OS keychain
162
+ ```
163
+
164
+ Existing users who are already signed in complete automatically. Password sign-in is also available.
165
+
166
+ ### RGR Workflow
167
+
168
+ The `init` command creates rules that make your AI coding agent follow the Red-Green-Refactor cycle automatically:
169
+
170
+ 1. **Plan** — Check constraints before implementing
171
+ 2. **Implement** — Write code addressing the constraints
172
+ 3. **Verify** — Run a code audit to check coverage
173
+ 4. **Complete** — Mark the phase done to update readiness scores
174
+
175
+ ### Compliance Frameworks
176
+
177
+ Cutline auto-detects your stack and loads the appropriate compliance constraints:
178
+
179
+ | Framework | Triggers |
180
+ |---|---|
181
+ | SOC 2 | Always loaded |
182
+ | Security Baseline | Always loaded |
183
+ | PCI-DSS | Stripe, payment libs |
184
+ | HIPAA | Health/FHIR/HL7 libs |
185
+ | GDPR / CCPA | Analytics, auth libs |
186
+ | OWASP LLM Top 10 | OpenAI, LangChain, RAG |
187
+ | FedRAMP | GovCloud, FIPS |
188
+ | GLBA | Plaid, banking SDKs |
189
+ | FERPA / COPPA | Clever, Canvas, EdTech |
190
+
191
+ ## Registry Listings
192
+
193
+ ### Official MCP Registry
194
+
195
+ ```bash
196
+ # Verify namespace
197
+ mcp-publisher login dns --domain thecutline.ai
198
+
199
+ # Publish
200
+ mcp-publisher publish
201
+ ```
202
+
203
+ Config: [`server.json`](./server.json)
204
+
205
+ ### Smithery
206
+
207
+ Config: [`smithery.yaml`](./smithery.yaml) with [`Dockerfile`](./Dockerfile)
208
+
209
+ ### Claude Desktop Extension
210
+
211
+ ```bash
212
+ npm run build:mcpb
213
+ # → cutline-mcp.mcpb (drag into Claude Desktop)
214
+ ```
215
+
216
+ Config: [`mcpb/manifest.json`](./mcpb/manifest.json)
217
+
218
+ ## Troubleshooting
219
+
220
+ ### Port 8765 in use
221
+
222
+ ```bash
223
+ lsof -i :8765
224
+ kill -9 <PID>
225
+ ```
226
+
227
+ ### Authentication timeout
228
+
229
+ The browser didn't complete within 10 minutes. Run `cutline-mcp login` again.
230
+
231
+ ### Failed to refresh token
232
+
233
+ ```bash
234
+ cutline-mcp logout
235
+ cutline-mcp login
236
+ ```
237
+
238
+ ### Keychain Access Denied (macOS)
239
+
240
+ 1. Open Keychain Access
241
+ 2. Find "cutline-mcp" entry
242
+ 3. Right-click → Get Info → Access Control
243
+ 4. Add your Terminal/IDE to allowed applications
@@ -0,0 +1,6 @@
1
+ export interface CallbackResult {
2
+ token: string;
3
+ email?: string;
4
+ }
5
+ export type CallbackSource = 'login' | 'setup' | 'upgrade';
6
+ export declare function startCallbackServer(source?: CallbackSource): Promise<CallbackResult>;
@@ -0,0 +1,97 @@
1
+ import express from 'express';
2
+ const CALLBACK_PORT = 8765;
3
+ const TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes (allows time for email magic link)
4
+ export async function startCallbackServer(source = 'login') {
5
+ return new Promise((resolve, reject) => {
6
+ const app = express();
7
+ let server;
8
+ // Timeout handler
9
+ const timeout = setTimeout(() => {
10
+ server?.close();
11
+ reject(new Error('Authentication timeout - no callback received'));
12
+ }, TIMEOUT_MS);
13
+ // Callback endpoint
14
+ app.get('/', (req, res) => {
15
+ const token = req.query.token;
16
+ const email = req.query.email;
17
+ if (!token) {
18
+ res.status(400).send('Missing token parameter');
19
+ return;
20
+ }
21
+ res.send(`
22
+ <!DOCTYPE html>
23
+ <html>
24
+ <head>
25
+ <title>Cutline MCP - Authentication Successful</title>
26
+ <style>
27
+ body {
28
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ height: 100vh;
33
+ margin: 0;
34
+ background: #0a0a0a;
35
+ color: #fff;
36
+ }
37
+ .container {
38
+ background: #111;
39
+ padding: 2.5rem;
40
+ border-radius: 1rem;
41
+ border: 1px solid rgba(0, 255, 65, 0.2);
42
+ text-align: center;
43
+ max-width: 420px;
44
+ }
45
+ .checkmark { font-size: 3rem; margin-bottom: 0.5rem; }
46
+ h1 { color: #00ff41; font-size: 1.4rem; margin-bottom: 0.5rem; }
47
+ .email { color: #888; font-size: 0.9rem; margin-bottom: 1.5rem; }
48
+ .steps { text-align: left; margin: 1.5rem 0; padding: 1rem 1.2rem; background: rgba(0,255,65,0.05); border: 1px solid rgba(0,255,65,0.15); border-radius: 0.5rem; }
49
+ .steps h3 { font-size: 0.8rem; color: #888; margin: 0 0 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
50
+ .step { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.6rem; font-size: 0.85rem; color: #ccc; }
51
+ .step:last-child { margin-bottom: 0; }
52
+ .num { color: #00ff41; font-weight: 600; min-width: 1.2rem; }
53
+ code { background: rgba(255,255,255,0.1); padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.8rem; }
54
+ .close { color: #666; font-size: 0.8rem; margin-top: 1rem; }
55
+ </style>
56
+ </head>
57
+ <body>
58
+ <div class="container">
59
+ <div class="checkmark">&#10003;</div>
60
+ <h1>You're in!</h1>
61
+ ${email ? `<p class="email">${email}</p>` : ''}
62
+ ${source === 'login' ? `
63
+ <div class="steps">
64
+ <h3>Next in your terminal</h3>
65
+ <div class="step"><span class="num">1</span><span>Run <code>cutline-mcp init</code> to generate IDE rules</span></div>
66
+ <div class="step"><span class="num">2</span><span>Run <code>cutline-mcp setup</code> to connect MCP servers</span></div>
67
+ <div class="step"><span class="num">3</span><span>Ask your agent: <em>"Run an engineering audit"</em></span></div>
68
+ </div>` : `
69
+ <div class="steps">
70
+ <h3>Go back to your terminal</h3>
71
+ <div class="step"><span class="num">&#10003;</span><span>Setup is finishing automatically — check your terminal for next steps.</span></div>
72
+ </div>`}
73
+ <p class="close">You can close this tab.</p>
74
+ </div>
75
+ </body>
76
+ </html>
77
+ `);
78
+ // Clean up and resolve
79
+ clearTimeout(timeout);
80
+ server.close();
81
+ resolve({ token, email });
82
+ });
83
+ // Start server
84
+ server = app.listen(CALLBACK_PORT, () => {
85
+ console.log(`Callback server listening on http://localhost:${CALLBACK_PORT}`);
86
+ });
87
+ server.on('error', (err) => {
88
+ clearTimeout(timeout);
89
+ if (err.code === 'EADDRINUSE') {
90
+ reject(new Error(`Port ${CALLBACK_PORT} is already in use. Please close other applications and try again.`));
91
+ }
92
+ else {
93
+ reject(err);
94
+ }
95
+ });
96
+ });
97
+ }
@@ -0,0 +1,3 @@
1
+ export declare function storeRefreshToken(token: string): Promise<void>;
2
+ export declare function getRefreshToken(): Promise<string | null>;
3
+ export declare function deleteRefreshToken(): Promise<boolean>;
@@ -0,0 +1,15 @@
1
+ import { saveConfig, loadConfig } from '../utils/config-store.js';
2
+ export async function storeRefreshToken(token) {
3
+ saveConfig({ refreshToken: token });
4
+ }
5
+ export async function getRefreshToken() {
6
+ const config = loadConfig();
7
+ return config.refreshToken || null;
8
+ }
9
+ export async function deleteRefreshToken() {
10
+ const config = loadConfig();
11
+ if (!config.refreshToken)
12
+ return false;
13
+ saveConfig({ ...config, refreshToken: undefined });
14
+ return true;
15
+ }
@@ -0,0 +1,4 @@
1
+ export declare function initCommand(options: {
2
+ projectRoot?: string;
3
+ staging?: boolean;
4
+ }): Promise<void>;