@nerviq/cli 0.0.1 → 0.9.0-beta.1

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 (148) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/LICENSE +21 -0
  3. package/README.md +447 -0
  4. package/bin/cli.js +749 -0
  5. package/content/case-study-template.md +91 -0
  6. package/content/claims-governance.md +37 -0
  7. package/content/claude-code/audit-repo/SKILL.md +20 -0
  8. package/content/claude-native-integration.md +60 -0
  9. package/content/devto-article.json +9 -0
  10. package/content/launch-posts.md +226 -0
  11. package/content/pilot-rollout-kit.md +30 -0
  12. package/content/release-checklist.md +31 -0
  13. package/package.json +53 -4
  14. package/src/activity.js +529 -0
  15. package/src/aider/activity.js +226 -0
  16. package/src/aider/config-parser.js +166 -0
  17. package/src/aider/context.js +158 -0
  18. package/src/aider/deep-review.js +316 -0
  19. package/src/aider/domain-packs.js +278 -0
  20. package/src/aider/freshness.js +168 -0
  21. package/src/aider/governance.js +253 -0
  22. package/src/aider/interactive.js +334 -0
  23. package/src/aider/mcp-packs.js +98 -0
  24. package/src/aider/patch.js +214 -0
  25. package/src/aider/plans.js +186 -0
  26. package/src/aider/premium.js +360 -0
  27. package/src/aider/setup.js +404 -0
  28. package/src/aider/techniques.js +1323 -0
  29. package/src/analyze.js +821 -0
  30. package/src/audit.js +1003 -0
  31. package/src/badge.js +13 -0
  32. package/src/benchmark.js +339 -0
  33. package/src/claudex-sync.json +7 -0
  34. package/src/codex/activity.js +324 -0
  35. package/src/codex/config-parser.js +183 -0
  36. package/src/codex/context.js +221 -0
  37. package/src/codex/deep-review.js +493 -0
  38. package/src/codex/domain-packs.js +372 -0
  39. package/src/codex/freshness.js +167 -0
  40. package/src/codex/governance.js +192 -0
  41. package/src/codex/interactive.js +618 -0
  42. package/src/codex/mcp-packs.js +660 -0
  43. package/src/codex/patch.js +209 -0
  44. package/src/codex/plans.js +251 -0
  45. package/src/codex/premium.js +614 -0
  46. package/src/codex/setup.js +603 -0
  47. package/src/codex/techniques.js +2649 -0
  48. package/src/context.js +272 -0
  49. package/src/copilot/activity.js +309 -0
  50. package/src/copilot/config-parser.js +226 -0
  51. package/src/copilot/context.js +197 -0
  52. package/src/copilot/deep-review.js +346 -0
  53. package/src/copilot/domain-packs.js +350 -0
  54. package/src/copilot/freshness.js +197 -0
  55. package/src/copilot/governance.js +222 -0
  56. package/src/copilot/interactive.js +406 -0
  57. package/src/copilot/mcp-packs.js +572 -0
  58. package/src/copilot/patch.js +238 -0
  59. package/src/copilot/plans.js +253 -0
  60. package/src/copilot/premium.js +450 -0
  61. package/src/copilot/setup.js +488 -0
  62. package/src/copilot/techniques.js +1822 -0
  63. package/src/cursor/activity.js +301 -0
  64. package/src/cursor/config-parser.js +265 -0
  65. package/src/cursor/context.js +236 -0
  66. package/src/cursor/deep-review.js +334 -0
  67. package/src/cursor/domain-packs.js +346 -0
  68. package/src/cursor/freshness.js +214 -0
  69. package/src/cursor/governance.js +229 -0
  70. package/src/cursor/interactive.js +391 -0
  71. package/src/cursor/mcp-packs.js +571 -0
  72. package/src/cursor/patch.js +243 -0
  73. package/src/cursor/plans.js +254 -0
  74. package/src/cursor/premium.js +468 -0
  75. package/src/cursor/setup.js +488 -0
  76. package/src/cursor/techniques.js +1786 -0
  77. package/src/deep-review.js +345 -0
  78. package/src/domain-packs.js +364 -0
  79. package/src/formatters/sarif.js +115 -0
  80. package/src/gemini/activity.js +402 -0
  81. package/src/gemini/config-parser.js +275 -0
  82. package/src/gemini/context.js +221 -0
  83. package/src/gemini/deep-review.js +559 -0
  84. package/src/gemini/domain-packs.js +371 -0
  85. package/src/gemini/freshness.js +204 -0
  86. package/src/gemini/governance.js +201 -0
  87. package/src/gemini/interactive.js +860 -0
  88. package/src/gemini/mcp-packs.js +658 -0
  89. package/src/gemini/patch.js +229 -0
  90. package/src/gemini/plans.js +269 -0
  91. package/src/gemini/premium.js +759 -0
  92. package/src/gemini/setup.js +692 -0
  93. package/src/gemini/techniques.js +2084 -0
  94. package/src/governance.js +523 -0
  95. package/src/harmony/advisor.js +383 -0
  96. package/src/harmony/audit.js +303 -0
  97. package/src/harmony/canon.js +444 -0
  98. package/src/harmony/cli.js +331 -0
  99. package/src/harmony/drift.js +401 -0
  100. package/src/harmony/governance.js +313 -0
  101. package/src/harmony/memory.js +238 -0
  102. package/src/harmony/sync.js +458 -0
  103. package/src/harmony/watch.js +336 -0
  104. package/src/index.js +256 -0
  105. package/src/insights.js +119 -0
  106. package/src/interactive.js +118 -0
  107. package/src/mcp-packs.js +597 -0
  108. package/src/opencode/activity.js +286 -0
  109. package/src/opencode/config-parser.js +109 -0
  110. package/src/opencode/context.js +247 -0
  111. package/src/opencode/deep-review.js +313 -0
  112. package/src/opencode/domain-packs.js +240 -0
  113. package/src/opencode/freshness.js +158 -0
  114. package/src/opencode/governance.js +159 -0
  115. package/src/opencode/interactive.js +392 -0
  116. package/src/opencode/mcp-packs.js +474 -0
  117. package/src/opencode/patch.js +184 -0
  118. package/src/opencode/plans.js +231 -0
  119. package/src/opencode/premium.js +413 -0
  120. package/src/opencode/setup.js +449 -0
  121. package/src/opencode/techniques.js +1713 -0
  122. package/src/plans.js +655 -0
  123. package/src/secret-patterns.js +30 -0
  124. package/src/setup.js +1274 -0
  125. package/src/synergy/adaptive.js +261 -0
  126. package/src/synergy/compensation.js +156 -0
  127. package/src/synergy/evidence.js +193 -0
  128. package/src/synergy/learning.js +184 -0
  129. package/src/synergy/patterns.js +227 -0
  130. package/src/synergy/ranking.js +83 -0
  131. package/src/synergy/report.js +163 -0
  132. package/src/synergy/routing.js +152 -0
  133. package/src/techniques.js +1354 -0
  134. package/src/watch.js +229 -0
  135. package/src/windsurf/activity.js +302 -0
  136. package/src/windsurf/config-parser.js +267 -0
  137. package/src/windsurf/context.js +249 -0
  138. package/src/windsurf/deep-review.js +337 -0
  139. package/src/windsurf/domain-packs.js +348 -0
  140. package/src/windsurf/freshness.js +215 -0
  141. package/src/windsurf/governance.js +231 -0
  142. package/src/windsurf/interactive.js +388 -0
  143. package/src/windsurf/mcp-packs.js +535 -0
  144. package/src/windsurf/patch.js +231 -0
  145. package/src/windsurf/plans.js +247 -0
  146. package/src/windsurf/premium.js +467 -0
  147. package/src/windsurf/setup.js +471 -0
  148. package/src/windsurf/techniques.js +1758 -0
@@ -0,0 +1,571 @@
1
+ /**
2
+ * Cursor MCP Pack System
3
+ *
4
+ * 26 MCP packs with JSON-aware projection, detection,
5
+ * recommendation, merge logic, and trust preflight.
6
+ *
7
+ * KEY DIFFERENCE: Cursor MCP uses .cursor/mcp.json format with
8
+ * "mcpServers" wrapper (different from VS Code's .vscode/mcp.json "servers" wrapper).
9
+ * Tool approval/auto-run model. Hard limit ~40 tools across all servers.
10
+ *
11
+ * .cursor/mcp.json format:
12
+ * {
13
+ * "mcpServers": {
14
+ * "server-name": {
15
+ * "command": "npx",
16
+ * "args": [...],
17
+ * "env": { "KEY": "${env:MY_KEY}" }
18
+ * }
19
+ * }
20
+ * }
21
+ */
22
+
23
+ const CURSOR_MCP_PACKS = [
24
+ {
25
+ key: 'context7-docs',
26
+ label: 'Context7 Docs',
27
+ description: 'Live, current framework and library documentation during Cursor sessions.',
28
+ useWhen: 'Repos that use any framework, library, or SDK and benefit from up-to-date docs.',
29
+ adoption: 'Safe default docs pack for most application repos. No auth required.',
30
+ trustLevel: 'high',
31
+ transport: 'stdio',
32
+ requiredAuth: [],
33
+ serverName: 'context7',
34
+ jsonProjection: { command: 'npx', args: ['-y', '@upstash/context7-mcp@latest'] },
35
+ excludeTools: [],
36
+ backgroundAgentCompatible: true,
37
+ },
38
+ {
39
+ key: 'github-mcp',
40
+ label: 'GitHub',
41
+ description: 'Issue, PR, and repository context during Cursor sessions.',
42
+ useWhen: 'Repos hosted on GitHub that benefit from issue, PR, and repo context.',
43
+ adoption: 'Recommended for any GitHub-hosted project. Requires GITHUB_PERSONAL_ACCESS_TOKEN.',
44
+ trustLevel: 'medium',
45
+ transport: 'stdio',
46
+ requiredAuth: ['GITHUB_PERSONAL_ACCESS_TOKEN'],
47
+ serverName: 'github',
48
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-github'], env: { GITHUB_PERSONAL_ACCESS_TOKEN: '${env:GITHUB_PERSONAL_ACCESS_TOKEN}' } },
49
+ excludeTools: ['create_repository', 'delete_file', 'push_files'],
50
+ backgroundAgentCompatible: true,
51
+ },
52
+ {
53
+ key: 'playwright-mcp',
54
+ label: 'Playwright Browser',
55
+ description: 'Browser automation, E2E testing, and visual QA.',
56
+ useWhen: 'Frontend repos with E2E tests or browser-based workflows.',
57
+ adoption: 'Recommended for frontend-ui repos with E2E tests. No auth required.',
58
+ trustLevel: 'medium',
59
+ transport: 'stdio',
60
+ requiredAuth: [],
61
+ serverName: 'playwright',
62
+ jsonProjection: { command: 'npx', args: ['-y', '@playwright/mcp@latest'] },
63
+ excludeTools: [],
64
+ backgroundAgentCompatible: false, // Requires browser
65
+ },
66
+ {
67
+ key: 'postgres-mcp',
68
+ label: 'PostgreSQL',
69
+ description: 'Schema inspection and query assistance for PostgreSQL databases.',
70
+ useWhen: 'Repos with PostgreSQL databases that benefit from schema and query context.',
71
+ adoption: 'Useful for backend-api and data-pipeline repos. Requires DATABASE_URL.',
72
+ trustLevel: 'low',
73
+ transport: 'stdio',
74
+ requiredAuth: ['DATABASE_URL'],
75
+ serverName: 'postgres',
76
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-postgres', '${env:DATABASE_URL}'] },
77
+ excludeTools: ['execute_sql'],
78
+ backgroundAgentCompatible: false, // Requires local DB
79
+ },
80
+ {
81
+ key: 'memory-mcp',
82
+ label: 'Memory / Knowledge Graph',
83
+ description: 'Persistent entity and relationship tracking across Cursor sessions.',
84
+ useWhen: 'Long-running or complex projects with many interconnected concepts.',
85
+ adoption: 'Safe for any repo. Stores data locally. No auth required.',
86
+ trustLevel: 'high',
87
+ transport: 'stdio',
88
+ requiredAuth: [],
89
+ serverName: 'memory',
90
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-memory'] },
91
+ excludeTools: [],
92
+ backgroundAgentCompatible: false, // Ephemeral VM
93
+ },
94
+ {
95
+ key: 'sequential-thinking',
96
+ label: 'Sequential Thinking',
97
+ description: 'Structured step-by-step reasoning for complex problem-solving.',
98
+ useWhen: 'Complex problem-solving sessions that benefit from structured reasoning.',
99
+ adoption: 'Safe default for any repo. No auth required.',
100
+ trustLevel: 'high',
101
+ transport: 'stdio',
102
+ requiredAuth: [],
103
+ serverName: 'sequential-thinking',
104
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-sequential-thinking'] },
105
+ excludeTools: [],
106
+ backgroundAgentCompatible: true,
107
+ },
108
+ {
109
+ key: 'filesystem-mcp',
110
+ label: 'Filesystem',
111
+ description: 'Read-only filesystem access for documentation and reference files.',
112
+ useWhen: 'Repos with reference files, docs, or config that Cursor needs to read.',
113
+ adoption: 'Read-only default. Pass allowed directories as args.',
114
+ trustLevel: 'medium',
115
+ transport: 'stdio',
116
+ requiredAuth: [],
117
+ serverName: 'filesystem',
118
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '.'] },
119
+ excludeTools: ['write_file', 'create_directory', 'move_file'],
120
+ backgroundAgentCompatible: true,
121
+ },
122
+ {
123
+ key: 'fetch-mcp',
124
+ label: 'Fetch / HTTP',
125
+ description: 'HTTP access for fetching web pages, APIs, and documentation.',
126
+ useWhen: 'Repos that need HTTP access to external APIs or documentation sources.',
127
+ adoption: 'Useful for repos integrating external services. No auth required.',
128
+ trustLevel: 'medium',
129
+ transport: 'stdio',
130
+ requiredAuth: [],
131
+ serverName: 'fetch',
132
+ jsonProjection: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-fetch'] },
133
+ excludeTools: [],
134
+ backgroundAgentCompatible: true,
135
+ },
136
+ {
137
+ key: 'next-devtools',
138
+ label: 'Next.js Devtools',
139
+ description: 'Runtime-aware debugging and framework-specific tooling for Next.js.',
140
+ useWhen: 'Next.js repos that need runtime-aware debugging.',
141
+ adoption: 'Useful companion for frontend-ui repos running Next.js.',
142
+ trustLevel: 'medium',
143
+ transport: 'stdio',
144
+ requiredAuth: [],
145
+ serverName: 'next-devtools',
146
+ jsonProjection: { command: 'npx', args: ['-y', 'next-devtools-mcp@latest'] },
147
+ excludeTools: [],
148
+ backgroundAgentCompatible: false, // Requires local dev server
149
+ },
150
+ {
151
+ key: 'docker-mcp',
152
+ label: 'Docker',
153
+ description: 'Container management during Cursor sessions.',
154
+ useWhen: 'Repos with containerized workflows.',
155
+ adoption: 'Requires Docker running locally.',
156
+ trustLevel: 'medium',
157
+ transport: 'stdio',
158
+ requiredAuth: [],
159
+ serverName: 'docker',
160
+ jsonProjection: { command: 'npx', args: ['-y', '@hypnosis/docker-mcp-server'] },
161
+ excludeTools: ['remove_container', 'remove_image'],
162
+ backgroundAgentCompatible: false, // Requires local Docker
163
+ },
164
+ {
165
+ key: 'notion-mcp',
166
+ label: 'Notion',
167
+ description: 'Access Notion documentation and wikis.',
168
+ useWhen: 'Teams using Notion for docs or knowledge bases.',
169
+ adoption: 'Requires NOTION_API_KEY.',
170
+ trustLevel: 'medium',
171
+ transport: 'stdio',
172
+ requiredAuth: ['NOTION_API_KEY'],
173
+ serverName: 'notion',
174
+ jsonProjection: { command: 'npx', args: ['-y', '@notionhq/notion-mcp-server'], env: { NOTION_API_KEY: '${env:NOTION_API_KEY}' } },
175
+ excludeTools: [],
176
+ backgroundAgentCompatible: true,
177
+ },
178
+ {
179
+ key: 'linear-mcp',
180
+ label: 'Linear',
181
+ description: 'Issue tracking and sprint context.',
182
+ useWhen: 'Teams using Linear for issue tracking.',
183
+ adoption: 'Requires LINEAR_API_KEY.',
184
+ trustLevel: 'medium',
185
+ transport: 'stdio',
186
+ requiredAuth: ['LINEAR_API_KEY'],
187
+ serverName: 'linear',
188
+ jsonProjection: { command: 'npx', args: ['-y', '@mseep/linear-mcp'], env: { LINEAR_API_KEY: '${env:LINEAR_API_KEY}' } },
189
+ excludeTools: [],
190
+ backgroundAgentCompatible: true,
191
+ },
192
+ {
193
+ key: 'sentry-mcp',
194
+ label: 'Sentry',
195
+ description: 'Error tracking and debugging context.',
196
+ useWhen: 'Repos with Sentry error tracking.',
197
+ adoption: 'Requires SENTRY_AUTH_TOKEN.',
198
+ trustLevel: 'medium',
199
+ transport: 'stdio',
200
+ requiredAuth: ['SENTRY_AUTH_TOKEN'],
201
+ serverName: 'sentry',
202
+ jsonProjection: { command: 'npx', args: ['-y', '@sentry/mcp-server'], env: { SENTRY_AUTH_TOKEN: '${env:SENTRY_AUTH_TOKEN}' } },
203
+ excludeTools: [],
204
+ backgroundAgentCompatible: true,
205
+ },
206
+ {
207
+ key: 'slack-mcp',
208
+ label: 'Slack',
209
+ description: 'Draft and preview Slack messages.',
210
+ useWhen: 'Teams using Slack for communication.',
211
+ adoption: 'Requires SLACK_BOT_TOKEN.',
212
+ trustLevel: 'low',
213
+ transport: 'stdio',
214
+ requiredAuth: ['SLACK_BOT_TOKEN'],
215
+ serverName: 'slack',
216
+ jsonProjection: { command: 'npx', args: ['-y', 'slack-mcp-server'], env: { SLACK_BOT_TOKEN: '${env:SLACK_BOT_TOKEN}' } },
217
+ excludeTools: ['delete_message'],
218
+ backgroundAgentCompatible: true,
219
+ },
220
+ {
221
+ key: 'stripe-mcp',
222
+ label: 'Stripe',
223
+ description: 'Payment and billing workflow context.',
224
+ useWhen: 'Repos with Stripe integration.',
225
+ adoption: 'Requires STRIPE_API_KEY.',
226
+ trustLevel: 'low',
227
+ transport: 'stdio',
228
+ requiredAuth: ['STRIPE_API_KEY'],
229
+ serverName: 'stripe',
230
+ jsonProjection: { command: 'npx', args: ['-y', '@stripe/mcp'], env: { STRIPE_API_KEY: '${env:STRIPE_API_KEY}' } },
231
+ excludeTools: ['create_charge', 'delete_customer'],
232
+ backgroundAgentCompatible: true,
233
+ },
234
+ {
235
+ key: 'figma-mcp',
236
+ label: 'Figma',
237
+ description: 'Design file access and component inspection.',
238
+ useWhen: 'Design-heavy repos needing Figma access.',
239
+ adoption: 'Requires FIGMA_ACCESS_TOKEN.',
240
+ trustLevel: 'medium',
241
+ transport: 'stdio',
242
+ requiredAuth: ['FIGMA_ACCESS_TOKEN'],
243
+ serverName: 'figma',
244
+ jsonProjection: { command: 'npx', args: ['-y', 'claude-talk-to-figma-mcp'], env: { FIGMA_ACCESS_TOKEN: '${env:FIGMA_ACCESS_TOKEN}' } },
245
+ excludeTools: [],
246
+ backgroundAgentCompatible: false, // Requires OAuth
247
+ },
248
+ {
249
+ key: 'mcp-security',
250
+ label: 'MCP Security Scanner',
251
+ description: 'Scan MCP servers for tool poisoning and prompt injection.',
252
+ useWhen: 'Any repo with 2+ MCP servers.',
253
+ adoption: 'Safety companion for multi-MCP setups. Critical given Cursor CVE history.',
254
+ trustLevel: 'high',
255
+ transport: 'stdio',
256
+ requiredAuth: [],
257
+ serverName: 'mcp-scan',
258
+ jsonProjection: { command: 'npx', args: ['-y', 'mcp-scan@latest'] },
259
+ excludeTools: [],
260
+ backgroundAgentCompatible: true,
261
+ },
262
+ {
263
+ key: 'composio-mcp',
264
+ label: 'Composio Universal',
265
+ description: '500+ integrations through a single MCP gateway.',
266
+ useWhen: 'Enterprise or integration-heavy repos.',
267
+ adoption: 'Requires COMPOSIO_API_KEY.',
268
+ trustLevel: 'medium',
269
+ transport: 'stdio',
270
+ requiredAuth: ['COMPOSIO_API_KEY'],
271
+ serverName: 'composio',
272
+ jsonProjection: { command: 'npx', args: ['-y', '@composio/mcp'], env: { COMPOSIO_API_KEY: '${env:COMPOSIO_API_KEY}' } },
273
+ excludeTools: [],
274
+ backgroundAgentCompatible: true,
275
+ },
276
+ {
277
+ key: 'jira-confluence',
278
+ label: 'Jira',
279
+ description: 'Issue tracking and project management.',
280
+ useWhen: 'Teams using Atlassian Jira.',
281
+ adoption: 'Requires ATLASSIAN_API_TOKEN and ATLASSIAN_EMAIL.',
282
+ trustLevel: 'medium',
283
+ transport: 'stdio',
284
+ requiredAuth: ['ATLASSIAN_API_TOKEN', 'ATLASSIAN_EMAIL'],
285
+ serverName: 'jira',
286
+ jsonProjection: { command: 'npx', args: ['-y', 'jira-mcp'], env: { ATLASSIAN_API_TOKEN: '${env:ATLASSIAN_API_TOKEN}', ATLASSIAN_EMAIL: '${env:ATLASSIAN_EMAIL}' } },
287
+ excludeTools: [],
288
+ backgroundAgentCompatible: true,
289
+ },
290
+ {
291
+ key: 'ga4-analytics',
292
+ label: 'Google Analytics 4',
293
+ description: 'Live GA4 data, attribution, and audience insights.',
294
+ useWhen: 'Repos with web analytics needs.',
295
+ adoption: 'Requires GA4_PROPERTY_ID and GOOGLE_APPLICATION_CREDENTIALS.',
296
+ trustLevel: 'medium',
297
+ transport: 'stdio',
298
+ requiredAuth: ['GA4_PROPERTY_ID', 'GOOGLE_APPLICATION_CREDENTIALS'],
299
+ serverName: 'ga4',
300
+ jsonProjection: { command: 'npx', args: ['-y', 'mcp-server-ga4'], env: { GA4_PROPERTY_ID: '${env:GA4_PROPERTY_ID}', GOOGLE_APPLICATION_CREDENTIALS: '${env:GOOGLE_APPLICATION_CREDENTIALS}' } },
301
+ excludeTools: [],
302
+ backgroundAgentCompatible: false, // Requires OAuth
303
+ },
304
+ {
305
+ key: 'search-console',
306
+ label: 'Google Search Console',
307
+ description: 'Search performance and indexing data.',
308
+ useWhen: 'SEO-focused repos.',
309
+ adoption: 'Requires Google OAuth credentials.',
310
+ trustLevel: 'medium',
311
+ transport: 'stdio',
312
+ requiredAuth: ['GOOGLE_CLIENT_ID', 'GOOGLE_CLIENT_SECRET'],
313
+ serverName: 'gsc',
314
+ jsonProjection: { command: 'npx', args: ['-y', 'mcp-gsc@latest'], env: { GOOGLE_CLIENT_ID: '${env:GOOGLE_CLIENT_ID}', GOOGLE_CLIENT_SECRET: '${env:GOOGLE_CLIENT_SECRET}' } },
315
+ excludeTools: [],
316
+ backgroundAgentCompatible: false, // Requires OAuth
317
+ },
318
+ {
319
+ key: 'n8n-workflows',
320
+ label: 'n8n Workflow Automation',
321
+ description: 'Workflow automation with 1,396 integration nodes.',
322
+ useWhen: 'Teams using n8n for workflow automation.',
323
+ adoption: 'Requires N8N_URL and N8N_API_KEY.',
324
+ trustLevel: 'medium',
325
+ transport: 'stdio',
326
+ requiredAuth: ['N8N_URL', 'N8N_API_KEY'],
327
+ serverName: 'n8n',
328
+ jsonProjection: { command: 'npx', args: ['-y', 'n8n-mcp-server@latest'], env: { N8N_URL: '${env:N8N_URL}', N8N_API_KEY: '${env:N8N_API_KEY}' } },
329
+ excludeTools: [],
330
+ backgroundAgentCompatible: true,
331
+ },
332
+ {
333
+ key: 'zendesk-mcp',
334
+ label: 'Zendesk',
335
+ description: 'Ticket management and help center content.',
336
+ useWhen: 'Support teams using Zendesk.',
337
+ adoption: 'Requires ZENDESK_API_TOKEN and ZENDESK_SUBDOMAIN.',
338
+ trustLevel: 'medium',
339
+ transport: 'stdio',
340
+ requiredAuth: ['ZENDESK_API_TOKEN', 'ZENDESK_SUBDOMAIN'],
341
+ serverName: 'zendesk',
342
+ jsonProjection: { command: 'npx', args: ['-y', 'zendesk-mcp'], env: { ZENDESK_API_TOKEN: '${env:ZENDESK_API_TOKEN}', ZENDESK_SUBDOMAIN: '${env:ZENDESK_SUBDOMAIN}' } },
343
+ excludeTools: [],
344
+ backgroundAgentCompatible: true,
345
+ },
346
+ {
347
+ key: 'infisical-secrets',
348
+ label: 'Infisical Secrets',
349
+ description: 'Secrets management with auto-rotation.',
350
+ useWhen: 'Repos using Infisical for secrets.',
351
+ adoption: 'Requires INFISICAL_TOKEN.',
352
+ trustLevel: 'low',
353
+ transport: 'stdio',
354
+ requiredAuth: ['INFISICAL_TOKEN'],
355
+ serverName: 'infisical',
356
+ jsonProjection: { command: 'npx', args: ['-y', '@infisical/mcp'], env: { INFISICAL_TOKEN: '${env:INFISICAL_TOKEN}' } },
357
+ excludeTools: ['delete_secret', 'update_secret'],
358
+ backgroundAgentCompatible: true,
359
+ },
360
+ {
361
+ key: 'shopify-mcp',
362
+ label: 'Shopify',
363
+ description: 'Shopify API and deployment tooling.',
364
+ useWhen: 'Shopify stores and apps.',
365
+ adoption: 'Requires SHOPIFY_ACCESS_TOKEN.',
366
+ trustLevel: 'medium',
367
+ transport: 'stdio',
368
+ requiredAuth: ['SHOPIFY_ACCESS_TOKEN'],
369
+ serverName: 'shopify',
370
+ jsonProjection: { command: 'npx', args: ['-y', 'shopify-mcp'], env: { SHOPIFY_ACCESS_TOKEN: '${env:SHOPIFY_ACCESS_TOKEN}' } },
371
+ excludeTools: [],
372
+ backgroundAgentCompatible: true,
373
+ },
374
+ {
375
+ key: 'huggingface-mcp',
376
+ label: 'Hugging Face',
377
+ description: 'Model search, dataset discovery, and Spaces.',
378
+ useWhen: 'AI/ML repos needing model registry access.',
379
+ adoption: 'Requires HF_TOKEN.',
380
+ trustLevel: 'medium',
381
+ transport: 'stdio',
382
+ requiredAuth: ['HF_TOKEN'],
383
+ serverName: 'huggingface',
384
+ jsonProjection: { command: 'npx', args: ['-y', 'huggingface-mcp-server'], env: { HF_TOKEN: '${env:HF_TOKEN}' } },
385
+ excludeTools: [],
386
+ backgroundAgentCompatible: true,
387
+ },
388
+ ];
389
+
390
+ // --- Helpers ---
391
+
392
+ function clone(value) {
393
+ return JSON.parse(JSON.stringify(value));
394
+ }
395
+
396
+ function hasDependency(deps, name) {
397
+ return Object.prototype.hasOwnProperty.call(deps || {}, name);
398
+ }
399
+
400
+ function hasFileContentMatch(ctx, filePath, pattern) {
401
+ if (!ctx) return false;
402
+ const content = ctx.fileContent(filePath);
403
+ return !!(content && pattern.test(content));
404
+ }
405
+
406
+ function getProjectDependencies(ctx) {
407
+ if (!ctx) return {};
408
+ if (typeof ctx.projectDependencies === 'function') return ctx.projectDependencies();
409
+ const pkg = ctx.jsonFile('package.json') || {};
410
+ return { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
411
+ }
412
+
413
+ function hasPostgresSignals(ctx, deps) {
414
+ if (hasDependency(deps, 'pg') || hasDependency(deps, 'postgres') || hasDependency(deps, 'pg-promise') ||
415
+ hasDependency(deps, 'slonik') || hasDependency(deps, '@neondatabase/serverless') || hasDependency(deps, '@vercel/postgres')) {
416
+ return true;
417
+ }
418
+ return (
419
+ hasFileContentMatch(ctx, 'prisma/schema.prisma', /provider\s*=\s*["']postgresql["']/i) ||
420
+ hasFileContentMatch(ctx, 'docker-compose.yml', /\bpostgres\b/i) ||
421
+ hasFileContentMatch(ctx, 'docker-compose.yaml', /\bpostgres\b/i)
422
+ );
423
+ }
424
+
425
+ // --- Core Functions ---
426
+
427
+ function getCursorMcpPack(key) {
428
+ return CURSOR_MCP_PACKS.find(pack => pack.key === key) || null;
429
+ }
430
+
431
+ function normalizeCursorMcpPackKeys(keys = []) {
432
+ return [...new Set((Array.isArray(keys) ? keys : [])
433
+ .map(key => `${key}`.trim())
434
+ .filter(Boolean))]
435
+ .filter(key => !!getCursorMcpPack(key));
436
+ }
437
+
438
+ /**
439
+ * Generate .cursor/mcp.json entry for a single MCP pack.
440
+ * Cursor uses .cursor/mcp.json with "mcpServers" wrapper.
441
+ */
442
+ function packToJson(pack) {
443
+ const entry = {};
444
+ const proj = pack.jsonProjection;
445
+
446
+ if (proj.command) entry.command = proj.command;
447
+ if (proj.url) entry.url = proj.url;
448
+ if (proj.args && proj.args.length > 0) entry.args = [...proj.args];
449
+ if (proj.env && Object.keys(proj.env).length > 0) entry.env = { ...proj.env };
450
+
451
+ return { [pack.serverName]: entry };
452
+ }
453
+
454
+ /**
455
+ * Detect which MCP packs to recommend for a Cursor project.
456
+ */
457
+ function recommendCursorMcpPacks(stacks = [], domainPacks = [], options = {}) {
458
+ const recommended = new Set();
459
+ const stackKeys = new Set(stacks.map(s => s.key));
460
+ const ctx = options.ctx || null;
461
+ const deps = getProjectDependencies(ctx);
462
+ const domainKeys = new Set(domainPacks.map(p => p.key));
463
+ const backgroundOnly = options.backgroundOnly === true;
464
+
465
+ if (stackKeys.size > 0) recommended.add('context7-docs');
466
+ if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo')) recommended.add('github-mcp');
467
+
468
+ if (domainKeys.has('frontend-ui') || stackKeys.has('react') || stackKeys.has('nextjs') ||
469
+ stackKeys.has('vue') || stackKeys.has('angular') || stackKeys.has('svelte')) {
470
+ recommended.add('playwright-mcp');
471
+ }
472
+
473
+ if (stackKeys.has('nextjs') || hasDependency(deps, 'next')) recommended.add('next-devtools');
474
+
475
+ if ((domainKeys.has('backend-api') || domainKeys.has('infra-platform')) && hasPostgresSignals(ctx, deps)) {
476
+ recommended.add('postgres-mcp');
477
+ }
478
+
479
+ if (domainKeys.has('monorepo') || domainKeys.has('enterprise-governed')) recommended.add('memory-mcp');
480
+ if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo') || domainKeys.has('infra-platform')) recommended.add('sequential-thinking');
481
+ if (domainKeys.has('infra-platform')) recommended.add('filesystem-mcp');
482
+
483
+ if (domainKeys.has('backend-api') && ctx && (hasDependency(deps, 'axios') || hasDependency(deps, 'node-fetch') || hasDependency(deps, 'got'))) {
484
+ recommended.add('fetch-mcp');
485
+ }
486
+
487
+ if (domainKeys.has('infra-platform') || domainKeys.has('devops-cicd')) recommended.add('docker-mcp');
488
+ if (domainKeys.has('ecommerce') && (hasDependency(deps, 'stripe') || hasDependency(deps, '@stripe/stripe-js'))) recommended.add('stripe-mcp');
489
+ if (domainKeys.has('ecommerce') && (hasDependency(deps, 'shopify') || hasDependency(deps, '@shopify/shopify-api'))) recommended.add('shopify-mcp');
490
+ if (domainKeys.has('ai-ml')) recommended.add('huggingface-mcp');
491
+ if (domainKeys.has('design-system')) recommended.add('figma-mcp');
492
+ if (recommended.size >= 2) recommended.add('mcp-security');
493
+ if (recommended.size === 0) recommended.add('context7-docs');
494
+
495
+ let result = CURSOR_MCP_PACKS.filter(pack => recommended.has(pack.key)).map(pack => clone(pack));
496
+
497
+ // Filter out background-incompatible packs if targeting background agents
498
+ if (backgroundOnly) {
499
+ result = result.filter(pack => pack.backgroundAgentCompatible !== false);
500
+ }
501
+
502
+ return result;
503
+ }
504
+
505
+ /**
506
+ * Trust preflight: check if packs are safe to install.
507
+ */
508
+ function getCursorMcpPreflight(packKeys = [], env = process.env) {
509
+ return normalizeCursorMcpPackKeys(packKeys)
510
+ .map(key => {
511
+ const pack = getCursorMcpPack(key);
512
+ if (!pack) return null;
513
+ const missingEnvVars = pack.requiredAuth.filter(envKey => {
514
+ const value = env && Object.prototype.hasOwnProperty.call(env, envKey) ? env[envKey] : '';
515
+ return !`${value || ''}`.trim();
516
+ });
517
+ return {
518
+ key,
519
+ label: pack.label,
520
+ trustLevel: pack.trustLevel,
521
+ transport: pack.transport,
522
+ requiredAuth: pack.requiredAuth,
523
+ missingEnvVars,
524
+ safe: missingEnvVars.length === 0,
525
+ backgroundAgentCompatible: pack.backgroundAgentCompatible,
526
+ warning: missingEnvVars.length > 0
527
+ ? `Missing env vars: ${missingEnvVars.join(', ')}. Pack will be included but may fail at runtime.`
528
+ : null,
529
+ };
530
+ })
531
+ .filter(Boolean);
532
+ }
533
+
534
+ /**
535
+ * Merge MCP packs into existing .cursor/mcp.json content.
536
+ * Uses "mcpServers" wrapper format (Cursor-specific).
537
+ */
538
+ function mergeCursorMcpJson(existingContent = {}, packKeys = []) {
539
+ let settings;
540
+ if (typeof existingContent === 'string') {
541
+ try { settings = JSON.parse(existingContent); } catch { settings = {}; }
542
+ } else {
543
+ settings = clone(existingContent);
544
+ }
545
+
546
+ if (!settings.mcpServers || typeof settings.mcpServers !== 'object') {
547
+ settings.mcpServers = {};
548
+ }
549
+
550
+ const existingServers = new Set(Object.keys(settings.mcpServers));
551
+ const newPacks = normalizeCursorMcpPackKeys(packKeys)
552
+ .map(key => getCursorMcpPack(key))
553
+ .filter(pack => pack && !existingServers.has(pack.serverName));
554
+
555
+ for (const pack of newPacks) {
556
+ const entry = packToJson(pack);
557
+ const serverName = Object.keys(entry)[0];
558
+ settings.mcpServers[serverName] = entry[serverName];
559
+ }
560
+
561
+ return settings;
562
+ }
563
+
564
+ module.exports = {
565
+ CURSOR_MCP_PACKS,
566
+ getCursorMcpPack,
567
+ recommendCursorMcpPacks,
568
+ getCursorMcpPreflight,
569
+ mergeCursorMcpJson,
570
+ packToJson,
571
+ };