@nerviq/cli 1.17.3 → 1.19.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 (190) hide show
  1. package/LICENSE +23 -23
  2. package/README.md +4 -4
  3. package/bin/cli.js +61 -274
  4. package/package.json +60 -60
  5. package/src/activity.js +1039 -1039
  6. package/src/adoption-advisor.js +299 -299
  7. package/src/aider/config-parser.js +166 -166
  8. package/src/aider/context.js +158 -158
  9. package/src/aider/deep-review.js +316 -316
  10. package/src/aider/domain-packs.js +303 -303
  11. package/src/aider/freshness.js +93 -93
  12. package/src/aider/governance.js +253 -253
  13. package/src/aider/interactive.js +334 -334
  14. package/src/aider/mcp-packs.js +329 -329
  15. package/src/aider/patch.js +214 -214
  16. package/src/aider/plans.js +186 -186
  17. package/src/aider/premium.js +360 -360
  18. package/src/aider/setup.js +404 -404
  19. package/src/aider/techniques.js +16 -16
  20. package/src/analyze.js +951 -951
  21. package/src/anti-patterns.js +485 -485
  22. package/src/audit/instruction-files.js +180 -180
  23. package/src/audit/recommendations.js +577 -577
  24. package/src/auto-suggest.js +154 -154
  25. package/src/badge.js +13 -13
  26. package/src/behavioral-drift.js +801 -801
  27. package/src/benchmark.js +67 -67
  28. package/src/catalog.js +103 -103
  29. package/src/certification.js +128 -128
  30. package/src/codex/config-parser.js +183 -183
  31. package/src/codex/context.js +223 -223
  32. package/src/codex/deep-review.js +493 -493
  33. package/src/codex/domain-packs.js +394 -394
  34. package/src/codex/freshness.js +84 -84
  35. package/src/codex/governance.js +192 -192
  36. package/src/codex/interactive.js +618 -618
  37. package/src/codex/mcp-packs.js +914 -914
  38. package/src/codex/patch.js +209 -209
  39. package/src/codex/plans.js +251 -251
  40. package/src/codex/premium.js +614 -614
  41. package/src/codex/setup.js +591 -591
  42. package/src/context.js +320 -320
  43. package/src/continuous-ops.js +681 -681
  44. package/src/copilot/activity.js +309 -309
  45. package/src/copilot/config-parser.js +280 -226
  46. package/src/copilot/context.js +218 -197
  47. package/src/copilot/deep-review.js +346 -346
  48. package/src/copilot/domain-packs.js +372 -372
  49. package/src/copilot/freshness.js +57 -57
  50. package/src/copilot/governance.js +222 -222
  51. package/src/copilot/interactive.js +406 -406
  52. package/src/copilot/mcp-packs.js +826 -826
  53. package/src/copilot/plans.js +253 -253
  54. package/src/copilot/premium.js +451 -451
  55. package/src/copilot/setup.js +488 -488
  56. package/src/copilot/techniques.js +219 -78
  57. package/src/cost-tracking.js +61 -61
  58. package/src/cursor/activity.js +301 -301
  59. package/src/cursor/config-parser.js +265 -265
  60. package/src/cursor/context.js +256 -256
  61. package/src/cursor/deep-review.js +334 -334
  62. package/src/cursor/domain-packs.js +368 -368
  63. package/src/cursor/freshness.js +65 -65
  64. package/src/cursor/governance.js +229 -229
  65. package/src/cursor/interactive.js +391 -391
  66. package/src/cursor/mcp-packs.js +828 -828
  67. package/src/cursor/plans.js +254 -254
  68. package/src/cursor/premium.js +469 -469
  69. package/src/cursor/setup.js +488 -488
  70. package/src/dashboard.js +493 -493
  71. package/src/deep-review.js +428 -428
  72. package/src/deprecation.js +98 -98
  73. package/src/diff-only.js +280 -280
  74. package/src/doctor.js +119 -119
  75. package/src/domain-pack-expansion.js +1033 -1033
  76. package/src/domain-packs.js +387 -387
  77. package/src/feedback.js +178 -178
  78. package/src/fix-engine.js +783 -0
  79. package/src/fix-prompts.js +122 -122
  80. package/src/formatters/sarif.js +115 -115
  81. package/src/freshness.js +74 -74
  82. package/src/gemini/config-parser.js +275 -275
  83. package/src/gemini/context.js +221 -221
  84. package/src/gemini/deep-review.js +559 -559
  85. package/src/gemini/domain-packs.js +393 -393
  86. package/src/gemini/freshness.js +66 -66
  87. package/src/gemini/governance.js +201 -201
  88. package/src/gemini/interactive.js +860 -860
  89. package/src/gemini/mcp-packs.js +915 -915
  90. package/src/gemini/plans.js +269 -269
  91. package/src/gemini/premium.js +760 -760
  92. package/src/gemini/setup.js +692 -692
  93. package/src/gemini/techniques.js +14 -14
  94. package/src/governance.js +72 -72
  95. package/src/harmony/add.js +68 -68
  96. package/src/harmony/advisor.js +333 -333
  97. package/src/harmony/canon.js +565 -565
  98. package/src/harmony/cli.js +591 -591
  99. package/src/harmony/drift.js +401 -401
  100. package/src/harmony/governance.js +313 -313
  101. package/src/harmony/memory.js +239 -239
  102. package/src/harmony/sync.js +475 -475
  103. package/src/harmony/watch.js +370 -370
  104. package/src/hook-validation.js +342 -342
  105. package/src/index.js +271 -271
  106. package/src/init.js +184 -184
  107. package/src/instruction-surfaces.js +185 -185
  108. package/src/integrations.js +144 -144
  109. package/src/interactive.js +118 -118
  110. package/src/locales/en.json +1 -1
  111. package/src/locales/es.json +1 -1
  112. package/src/mcp-packs.js +830 -830
  113. package/src/mcp-server.js +726 -726
  114. package/src/mcp-validation.js +337 -337
  115. package/src/nerviq-sync.json +7 -7
  116. package/src/opencode/config-parser.js +109 -109
  117. package/src/opencode/context.js +247 -247
  118. package/src/opencode/deep-review.js +313 -313
  119. package/src/opencode/domain-packs.js +262 -262
  120. package/src/opencode/freshness.js +66 -66
  121. package/src/opencode/governance.js +159 -159
  122. package/src/opencode/interactive.js +392 -392
  123. package/src/opencode/mcp-packs.js +705 -705
  124. package/src/opencode/patch.js +184 -184
  125. package/src/opencode/plans.js +231 -231
  126. package/src/opencode/premium.js +413 -413
  127. package/src/opencode/setup.js +449 -449
  128. package/src/opencode/techniques.js +27 -27
  129. package/src/operating-profile.js +574 -574
  130. package/src/org.js +152 -152
  131. package/src/permission-rules.js +218 -218
  132. package/src/plans.js +839 -839
  133. package/src/platform-change-manifest.js +86 -86
  134. package/src/plugins.js +110 -110
  135. package/src/policy-layers.js +210 -210
  136. package/src/profiles.js +124 -124
  137. package/src/prompt-injection.js +74 -74
  138. package/src/public-api.js +173 -173
  139. package/src/recommendation-rules.js +84 -84
  140. package/src/repo-archetype.js +386 -386
  141. package/src/secret-patterns.js +39 -39
  142. package/src/server.js +527 -527
  143. package/src/setup/analysis.js +607 -607
  144. package/src/setup/runtime.js +172 -172
  145. package/src/setup.js +677 -677
  146. package/src/shared/capabilities.js +194 -194
  147. package/src/source-urls.js +132 -132
  148. package/src/stack-checks.js +565 -565
  149. package/src/supplemental-checks.js +13 -13
  150. package/src/synergy/adaptive.js +261 -261
  151. package/src/synergy/compensation.js +137 -137
  152. package/src/synergy/evidence.js +193 -193
  153. package/src/synergy/learning.js +199 -199
  154. package/src/synergy/patterns.js +227 -227
  155. package/src/synergy/ranking.js +83 -83
  156. package/src/synergy/report.js +165 -165
  157. package/src/synergy/routing.js +146 -146
  158. package/src/techniques/api.js +407 -407
  159. package/src/techniques/automation.js +316 -316
  160. package/src/techniques/compliance.js +257 -257
  161. package/src/techniques/hygiene.js +294 -294
  162. package/src/techniques/instructions.js +243 -243
  163. package/src/techniques/observability.js +226 -226
  164. package/src/techniques/optimization.js +142 -142
  165. package/src/techniques/quality.js +318 -318
  166. package/src/techniques/security.js +237 -237
  167. package/src/techniques/shared.js +443 -443
  168. package/src/techniques/stacks.js +2294 -2294
  169. package/src/techniques/tools.js +106 -106
  170. package/src/techniques/workflow.js +413 -413
  171. package/src/techniques.js +81 -81
  172. package/src/terminology.js +73 -73
  173. package/src/token-estimate.js +35 -35
  174. package/src/usage-patterns.js +99 -99
  175. package/src/verification-metadata.js +145 -145
  176. package/src/watch.js +247 -247
  177. package/src/windsurf/activity.js +302 -302
  178. package/src/windsurf/config-parser.js +267 -267
  179. package/src/windsurf/context.js +249 -249
  180. package/src/windsurf/deep-review.js +337 -337
  181. package/src/windsurf/domain-packs.js +370 -370
  182. package/src/windsurf/freshness.js +36 -36
  183. package/src/windsurf/governance.js +231 -231
  184. package/src/windsurf/interactive.js +388 -388
  185. package/src/windsurf/mcp-packs.js +792 -792
  186. package/src/windsurf/plans.js +247 -247
  187. package/src/windsurf/premium.js +468 -468
  188. package/src/windsurf/setup.js +471 -471
  189. package/src/windsurf/techniques.js +17 -17
  190. package/src/workspace.js +375 -375
@@ -1,826 +1,826 @@
1
- /**
2
- * Copilot MCP Pack System
3
- *
4
- * 26 MCP packs with JSON-aware projection, detection,
5
- * recommendation, merge logic, and trust preflight.
6
- *
7
- * KEY DIFFERENCE: Copilot MCP uses .vscode/mcp.json format,
8
- * which is a separate file from .vscode/settings.json.
9
- * The cloud agent has MCP limitations (no OAuth remote servers).
10
- *
11
- * .vscode/mcp.json format:
12
- * {
13
- * "servers": {
14
- * "server-name": {
15
- * "command": "npx",
16
- * "args": [...],
17
- * "env": {...}
18
- * }
19
- * }
20
- * }
21
- */
22
-
23
- const COPILOT_MCP_PACKS = [
24
- {
25
- key: 'context7-docs',
26
- label: 'Context7 Docs',
27
- description: 'Live, current framework and library documentation during Copilot 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
- cloudAgentCompatible: true,
37
- },
38
- {
39
- key: 'github-mcp',
40
- label: 'GitHub',
41
- description: 'Issue, PR, and repository context during Copilot 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: '${GITHUB_PERSONAL_ACCESS_TOKEN}' } },
49
- excludeTools: ['create_repository', 'delete_file', 'push_files'],
50
- cloudAgentCompatible: 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
- cloudAgentCompatible: true,
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', '${DATABASE_URL}'] },
77
- excludeTools: ['execute_sql'],
78
- cloudAgentCompatible: false, // Requires local DB access
79
- },
80
- {
81
- key: 'memory-mcp',
82
- label: 'Memory / Knowledge Graph',
83
- description: 'Persistent entity and relationship tracking across Copilot 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
- cloudAgentCompatible: false, // Ephemeral VM = no persistence
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
- cloudAgentCompatible: 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 Copilot 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
- cloudAgentCompatible: 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
- cloudAgentCompatible: 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
- cloudAgentCompatible: false, // Requires local dev server
149
- },
150
- {
151
- key: 'docker-mcp',
152
- label: 'Docker',
153
- description: 'Container management during Copilot 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
- cloudAgentCompatible: 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: '${NOTION_API_KEY}' } },
175
- excludeTools: [],
176
- cloudAgentCompatible: 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: '${LINEAR_API_KEY}' } },
189
- excludeTools: [],
190
- cloudAgentCompatible: 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: '${SENTRY_AUTH_TOKEN}' } },
203
- excludeTools: [],
204
- cloudAgentCompatible: 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: '${SLACK_BOT_TOKEN}' } },
217
- excludeTools: ['delete_message'],
218
- cloudAgentCompatible: 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: '${STRIPE_API_KEY}' } },
231
- excludeTools: ['create_charge', 'delete_customer'],
232
- cloudAgentCompatible: 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: '${FIGMA_ACCESS_TOKEN}' } },
245
- excludeTools: [],
246
- cloudAgentCompatible: 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.',
254
- trustLevel: 'high',
255
- transport: 'stdio',
256
- requiredAuth: [],
257
- serverName: 'mcp-scan',
258
- jsonProjection: { command: 'npx', args: ['-y', 'mcp-scan@latest'] },
259
- excludeTools: [],
260
- cloudAgentCompatible: 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: '${COMPOSIO_API_KEY}' } },
273
- excludeTools: [],
274
- cloudAgentCompatible: 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: '${ATLASSIAN_API_TOKEN}', ATLASSIAN_EMAIL: '${ATLASSIAN_EMAIL}' } },
287
- excludeTools: [],
288
- cloudAgentCompatible: 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: '${GA4_PROPERTY_ID}', GOOGLE_APPLICATION_CREDENTIALS: '${GOOGLE_APPLICATION_CREDENTIALS}' } },
301
- excludeTools: [],
302
- cloudAgentCompatible: false, // Requires OAuth credentials
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: '${GOOGLE_CLIENT_ID}', GOOGLE_CLIENT_SECRET: '${GOOGLE_CLIENT_SECRET}' } },
315
- excludeTools: [],
316
- cloudAgentCompatible: 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: '${N8N_URL}', N8N_API_KEY: '${N8N_API_KEY}' } },
329
- excludeTools: [],
330
- cloudAgentCompatible: 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: '${ZENDESK_API_TOKEN}', ZENDESK_SUBDOMAIN: '${ZENDESK_SUBDOMAIN}' } },
343
- excludeTools: [],
344
- cloudAgentCompatible: 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: '${INFISICAL_TOKEN}' } },
357
- excludeTools: ['delete_secret', 'update_secret'],
358
- cloudAgentCompatible: 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: '${SHOPIFY_ACCESS_TOKEN}' } },
371
- excludeTools: [],
372
- cloudAgentCompatible: 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: '${HF_TOKEN}' } },
385
- excludeTools: [],
386
- cloudAgentCompatible: true,
387
- },
388
- // ── 23 new packs ─────────────────────────────────────────────────────────
389
- {
390
- key: 'supabase-mcp', label: 'Supabase',
391
- description: 'Database, auth, and storage for Supabase.',
392
- useWhen: 'Repos using Supabase.',
393
- adoption: 'Requires: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY.',
394
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['SUPABASE_URL', 'SUPABASE_SERVICE_ROLE_KEY'],
395
- serverName: 'supabase',
396
- jsonProjection: { command: 'npx', args: ['-y', '@supabase/mcp-server-supabase@latest'], env: { SUPABASE_URL: '${env:SUPABASE_URL}', SUPABASE_SERVICE_ROLE_KEY: '${env:SUPABASE_SERVICE_ROLE_KEY}' } },
397
- excludeTools: ['delete_project', 'drop_table'],
398
- cloudAgentCompatible: true,
399
- },
400
- {
401
- key: 'prisma-mcp', label: 'Prisma ORM',
402
- description: 'Schema inspection and migrations via Prisma.',
403
- useWhen: 'Repos with a Prisma schema.',
404
- adoption: 'Requires: DATABASE_URL.',
405
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['DATABASE_URL'],
406
- serverName: 'prisma',
407
- jsonProjection: { command: 'npx', args: ['-y', 'prisma-mcp-server@latest'], env: { DATABASE_URL: '${env:DATABASE_URL}' } },
408
- excludeTools: ['drop_database'],
409
- cloudAgentCompatible: true,
410
- },
411
- {
412
- key: 'vercel-mcp', label: 'Vercel',
413
- description: 'Deployment management via Vercel.',
414
- useWhen: 'Repos deployed on Vercel.',
415
- adoption: 'Requires: VERCEL_TOKEN.',
416
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['VERCEL_TOKEN'],
417
- serverName: 'vercel',
418
- jsonProjection: { command: 'npx', args: ['-y', '@vercel/mcp-server@latest'], env: { VERCEL_TOKEN: '${env:VERCEL_TOKEN}' } },
419
- excludeTools: ['delete_project', 'delete_deployment'],
420
- cloudAgentCompatible: true,
421
- },
422
- {
423
- key: 'cloudflare-mcp', label: 'Cloudflare',
424
- description: 'Workers, KV, R2, and D1 management.',
425
- useWhen: 'Repos using Cloudflare edge.',
426
- adoption: 'Requires: CLOUDFLARE_API_TOKEN.',
427
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CLOUDFLARE_API_TOKEN'],
428
- serverName: 'cloudflare',
429
- jsonProjection: { command: 'npx', args: ['-y', '@cloudflare/mcp-server-cloudflare@latest'], env: { CLOUDFLARE_API_TOKEN: '${env:CLOUDFLARE_API_TOKEN}' } },
430
- excludeTools: ['delete_worker', 'purge_cache'],
431
- cloudAgentCompatible: true,
432
- },
433
- {
434
- key: 'aws-mcp', label: 'AWS',
435
- description: 'S3, Lambda, DynamoDB access.',
436
- useWhen: 'Repos using AWS.',
437
- adoption: 'Requires: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION.',
438
- trustLevel: 'low', transport: 'stdio', requiredAuth: ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION'],
439
- serverName: 'aws',
440
- jsonProjection: { command: 'npx', args: ['-y', '@aws-samples/mcp-server-aws@latest'], env: { AWS_ACCESS_KEY_ID: '${env:AWS_ACCESS_KEY_ID}', AWS_SECRET_ACCESS_KEY: '${env:AWS_SECRET_ACCESS_KEY}', AWS_REGION: '${env:AWS_REGION}' } },
441
- excludeTools: ['delete_stack', 'terminate_instances', 'delete_bucket'],
442
- cloudAgentCompatible: true,
443
- },
444
- {
445
- key: 'redis-mcp', label: 'Redis',
446
- description: 'Cache and session management.',
447
- useWhen: 'Repos using Redis.',
448
- adoption: 'Requires: REDIS_URL.',
449
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['REDIS_URL'],
450
- serverName: 'redis',
451
- jsonProjection: { command: 'npx', args: ['-y', 'redis-mcp-server@latest'], env: { REDIS_URL: '${env:REDIS_URL}' } },
452
- excludeTools: ['flushall', 'flushdb'],
453
- cloudAgentCompatible: true,
454
- },
455
- {
456
- key: 'mongodb-mcp', label: 'MongoDB',
457
- description: 'Document database access.',
458
- useWhen: 'Repos using MongoDB.',
459
- adoption: 'Requires: MONGODB_URI.',
460
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['MONGODB_URI'],
461
- serverName: 'mongodb',
462
- jsonProjection: { command: 'npx', args: ['-y', '@mongodb-js/mongodb-mcp-server@latest'], env: { MONGODB_URI: '${env:MONGODB_URI}' } },
463
- excludeTools: ['drop_collection', 'drop_database'],
464
- cloudAgentCompatible: true,
465
- },
466
- {
467
- key: 'twilio-mcp', label: 'Twilio',
468
- description: 'SMS, voice, and messaging.',
469
- useWhen: 'Repos using Twilio.',
470
- adoption: 'Requires: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN.',
471
- trustLevel: 'low', transport: 'stdio', requiredAuth: ['TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN'],
472
- serverName: 'twilio',
473
- jsonProjection: { command: 'npx', args: ['-y', 'twilio-mcp-server@latest'], env: { TWILIO_ACCOUNT_SID: '${env:TWILIO_ACCOUNT_SID}', TWILIO_AUTH_TOKEN: '${env:TWILIO_AUTH_TOKEN}' } },
474
- excludeTools: ['delete_message'],
475
- cloudAgentCompatible: true,
476
- },
477
- {
478
- key: 'sendgrid-mcp', label: 'SendGrid',
479
- description: 'Transactional email delivery.',
480
- useWhen: 'Repos using SendGrid.',
481
- adoption: 'Requires: SENDGRID_API_KEY.',
482
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['SENDGRID_API_KEY'],
483
- serverName: 'sendgrid',
484
- jsonProjection: { command: 'npx', args: ['-y', 'sendgrid-mcp-server@latest'], env: { SENDGRID_API_KEY: '${env:SENDGRID_API_KEY}' } },
485
- excludeTools: [],
486
- cloudAgentCompatible: true,
487
- },
488
- {
489
- key: 'algolia-mcp', label: 'Algolia Search',
490
- description: 'Search indexing via Algolia.',
491
- useWhen: 'Repos using Algolia.',
492
- adoption: 'Requires: ALGOLIA_APP_ID, ALGOLIA_API_KEY.',
493
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['ALGOLIA_APP_ID', 'ALGOLIA_API_KEY'],
494
- serverName: 'algolia',
495
- jsonProjection: { command: 'npx', args: ['-y', 'algolia-mcp-server@latest'], env: { ALGOLIA_APP_ID: '${env:ALGOLIA_APP_ID}', ALGOLIA_API_KEY: '${env:ALGOLIA_API_KEY}' } },
496
- excludeTools: ['delete_index'],
497
- cloudAgentCompatible: true,
498
- },
499
- {
500
- key: 'planetscale-mcp', label: 'PlanetScale',
501
- description: 'Serverless MySQL via PlanetScale.',
502
- useWhen: 'Repos on PlanetScale.',
503
- adoption: 'Requires: PLANETSCALE_TOKEN.',
504
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['PLANETSCALE_TOKEN'],
505
- serverName: 'planetscale',
506
- jsonProjection: { command: 'npx', args: ['-y', 'planetscale-mcp-server@latest'], env: { PLANETSCALE_TOKEN: '${env:PLANETSCALE_TOKEN}' } },
507
- excludeTools: ['delete_database'],
508
- cloudAgentCompatible: true,
509
- },
510
- {
511
- key: 'neon-mcp', label: 'Neon Serverless Postgres',
512
- description: 'Serverless Postgres via Neon.',
513
- useWhen: 'Repos using Neon.',
514
- adoption: 'Requires: NEON_API_KEY.',
515
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['NEON_API_KEY'],
516
- serverName: 'neon',
517
- jsonProjection: { command: 'npx', args: ['-y', '@neondatabase/mcp-server-neon@latest'], env: { NEON_API_KEY: '${env:NEON_API_KEY}' } },
518
- excludeTools: ['delete_project'],
519
- cloudAgentCompatible: true,
520
- },
521
- {
522
- key: 'turso-mcp', label: 'Turso Edge SQLite',
523
- description: 'Edge SQLite via Turso.',
524
- useWhen: 'Repos using Turso.',
525
- adoption: 'Requires: TURSO_DATABASE_URL, TURSO_AUTH_TOKEN.',
526
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['TURSO_DATABASE_URL', 'TURSO_AUTH_TOKEN'],
527
- serverName: 'turso',
528
- jsonProjection: { command: 'npx', args: ['-y', 'turso-mcp-server@latest'], env: { TURSO_DATABASE_URL: '${env:TURSO_DATABASE_URL}', TURSO_AUTH_TOKEN: '${env:TURSO_AUTH_TOKEN}' } },
529
- excludeTools: ['destroy_database'],
530
- cloudAgentCompatible: true,
531
- },
532
- {
533
- key: 'upstash-mcp', label: 'Upstash Redis+Kafka',
534
- description: 'Serverless Redis and Kafka.',
535
- useWhen: 'Repos using Upstash.',
536
- adoption: 'Requires: UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN.',
537
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['UPSTASH_REDIS_REST_URL', 'UPSTASH_REDIS_REST_TOKEN'],
538
- serverName: 'upstash',
539
- jsonProjection: { command: 'npx', args: ['-y', '@upstash/mcp-server@latest'], env: { UPSTASH_REDIS_REST_URL: '${env:UPSTASH_REDIS_REST_URL}', UPSTASH_REDIS_REST_TOKEN: '${env:UPSTASH_REDIS_REST_TOKEN}' } },
540
- excludeTools: [],
541
- cloudAgentCompatible: true,
542
- },
543
- {
544
- key: 'convex-mcp', label: 'Convex',
545
- description: 'Reactive backend via Convex.',
546
- useWhen: 'Repos using Convex.',
547
- adoption: 'Requires: CONVEX_DEPLOYMENT.',
548
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CONVEX_DEPLOYMENT'],
549
- serverName: 'convex',
550
- jsonProjection: { command: 'npx', args: ['-y', '@convex-dev/mcp-server@latest'], env: { CONVEX_DEPLOYMENT: '${env:CONVEX_DEPLOYMENT}' } },
551
- excludeTools: ['delete_deployment'],
552
- cloudAgentCompatible: true,
553
- },
554
- {
555
- key: 'clerk-mcp', label: 'Clerk Authentication',
556
- description: 'User auth via Clerk.',
557
- useWhen: 'Repos using Clerk.',
558
- adoption: 'Requires: CLERK_SECRET_KEY.',
559
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CLERK_SECRET_KEY'],
560
- serverName: 'clerk',
561
- jsonProjection: { command: 'npx', args: ['-y', '@clerk/mcp-server@latest'], env: { CLERK_SECRET_KEY: '${env:CLERK_SECRET_KEY}' } },
562
- excludeTools: ['delete_user'],
563
- cloudAgentCompatible: true,
564
- },
565
- {
566
- key: 'resend-mcp', label: 'Resend Email',
567
- description: 'Transactional email via Resend.',
568
- useWhen: 'Repos using Resend.',
569
- adoption: 'Requires: RESEND_API_KEY.',
570
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['RESEND_API_KEY'],
571
- serverName: 'resend',
572
- jsonProjection: { command: 'npx', args: ['-y', 'resend-mcp-server@latest'], env: { RESEND_API_KEY: '${env:RESEND_API_KEY}' } },
573
- excludeTools: [],
574
- cloudAgentCompatible: true,
575
- },
576
- {
577
- key: 'temporal-mcp', label: 'Temporal Workflow',
578
- description: 'Workflow orchestration via Temporal.',
579
- useWhen: 'Repos using Temporal.',
580
- adoption: 'Requires: TEMPORAL_ADDRESS.',
581
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['TEMPORAL_ADDRESS'],
582
- serverName: 'temporal',
583
- jsonProjection: { command: 'npx', args: ['-y', 'temporal-mcp-server@latest'], env: { TEMPORAL_ADDRESS: '${env:TEMPORAL_ADDRESS}' } },
584
- excludeTools: ['terminate_workflow'],
585
- cloudAgentCompatible: true,
586
- },
587
- {
588
- key: 'launchdarkly-mcp', label: 'LaunchDarkly',
589
- description: 'Feature flags via LaunchDarkly.',
590
- useWhen: 'Repos using LaunchDarkly.',
591
- adoption: 'Requires: LAUNCHDARKLY_ACCESS_TOKEN.',
592
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['LAUNCHDARKLY_ACCESS_TOKEN'],
593
- serverName: 'launchdarkly',
594
- jsonProjection: { command: 'npx', args: ['-y', 'launchdarkly-mcp-server@latest'], env: { LAUNCHDARKLY_ACCESS_TOKEN: '${env:LAUNCHDARKLY_ACCESS_TOKEN}' } },
595
- excludeTools: ['delete_flag'],
596
- cloudAgentCompatible: true,
597
- },
598
- {
599
- key: 'datadog-mcp', label: 'Datadog',
600
- description: 'Monitoring and APM via Datadog.',
601
- useWhen: 'Repos using Datadog.',
602
- adoption: 'Requires: DATADOG_API_KEY, DATADOG_APP_KEY.',
603
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['DATADOG_API_KEY', 'DATADOG_APP_KEY'],
604
- serverName: 'datadog',
605
- jsonProjection: { command: 'npx', args: ['-y', '@datadog/mcp-server@latest'], env: { DATADOG_API_KEY: '${env:DATADOG_API_KEY}', DATADOG_APP_KEY: '${env:DATADOG_APP_KEY}' } },
606
- excludeTools: ['delete_monitor'],
607
- cloudAgentCompatible: true,
608
- },
609
- {
610
- key: 'grafana-mcp', label: 'Grafana',
611
- description: 'Dashboards via Grafana.',
612
- useWhen: 'Repos using Grafana.',
613
- adoption: 'Requires: GRAFANA_URL, GRAFANA_API_KEY.',
614
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['GRAFANA_URL', 'GRAFANA_API_KEY'],
615
- serverName: 'grafana',
616
- jsonProjection: { command: 'npx', args: ['-y', 'grafana-mcp-server@latest'], env: { GRAFANA_URL: '${env:GRAFANA_URL}', GRAFANA_API_KEY: '${env:GRAFANA_API_KEY}' } },
617
- excludeTools: ['delete_dashboard'],
618
- cloudAgentCompatible: true,
619
- },
620
- {
621
- key: 'circleci-mcp', label: 'CircleCI',
622
- description: 'CI/CD via CircleCI.',
623
- useWhen: 'Repos using CircleCI.',
624
- adoption: 'Requires: CIRCLECI_TOKEN.',
625
- trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CIRCLECI_TOKEN'],
626
- serverName: 'circleci',
627
- jsonProjection: { command: 'npx', args: ['-y', 'circleci-mcp-server@latest'], env: { CIRCLECI_TOKEN: '${env:CIRCLECI_TOKEN}' } },
628
- excludeTools: ['cancel_pipeline'],
629
- cloudAgentCompatible: true,
630
- },
631
- {
632
- key: 'anthropic-mcp', label: 'Anthropic Claude API',
633
- description: 'Claude API for AI-powered apps.',
634
- useWhen: 'Repos building on Claude API.',
635
- adoption: 'Requires: ANTHROPIC_API_KEY.',
636
- trustLevel: 'high', transport: 'stdio', requiredAuth: ['ANTHROPIC_API_KEY'],
637
- serverName: 'anthropic',
638
- jsonProjection: { command: 'npx', args: ['-y', '@anthropic-ai/mcp-server@latest'], env: { ANTHROPIC_API_KEY: '${env:ANTHROPIC_API_KEY}' } },
639
- excludeTools: [],
640
- cloudAgentCompatible: true,
641
- },
642
- ];
643
-
644
- // --- Helpers ---
645
-
646
- function clone(value) {
647
- return JSON.parse(JSON.stringify(value));
648
- }
649
-
650
- function hasDependency(deps, name) {
651
- return Object.prototype.hasOwnProperty.call(deps || {}, name);
652
- }
653
-
654
- function hasFileContentMatch(ctx, filePath, pattern) {
655
- if (!ctx) return false;
656
- const content = ctx.fileContent(filePath);
657
- return !!(content && pattern.test(content));
658
- }
659
-
660
- function getProjectDependencies(ctx) {
661
- if (!ctx) return {};
662
- if (typeof ctx.projectDependencies === 'function') return ctx.projectDependencies();
663
- const pkg = ctx.jsonFile('package.json') || {};
664
- return { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
665
- }
666
-
667
- function hasPostgresSignals(ctx, deps) {
668
- if (hasDependency(deps, 'pg') || hasDependency(deps, 'postgres') || hasDependency(deps, 'pg-promise') ||
669
- hasDependency(deps, 'slonik') || hasDependency(deps, '@neondatabase/serverless') || hasDependency(deps, '@vercel/postgres')) {
670
- return true;
671
- }
672
- return (
673
- hasFileContentMatch(ctx, 'prisma/schema.prisma', /provider\s*=\s*["']postgresql["']/i) ||
674
- hasFileContentMatch(ctx, 'docker-compose.yml', /\bpostgres\b/i) ||
675
- hasFileContentMatch(ctx, 'docker-compose.yaml', /\bpostgres\b/i)
676
- );
677
- }
678
-
679
- // --- Core Functions ---
680
-
681
- function getCopilotMcpPack(key) {
682
- return COPILOT_MCP_PACKS.find(pack => pack.key === key) || null;
683
- }
684
-
685
- function normalizeCopilotMcpPackKeys(keys = []) {
686
- return [...new Set((Array.isArray(keys) ? keys : [])
687
- .map(key => `${key}`.trim())
688
- .filter(Boolean))]
689
- .filter(key => !!getCopilotMcpPack(key));
690
- }
691
-
692
- /**
693
- * Generate .vscode/mcp.json entry for a single MCP pack.
694
- * Copilot uses .vscode/mcp.json with "servers" wrapper (not settings.json mcpServers).
695
- */
696
- function packToJson(pack) {
697
- const entry = {};
698
- const proj = pack.jsonProjection;
699
-
700
- if (proj.command) entry.command = proj.command;
701
- if (proj.url) entry.url = proj.url;
702
- if (proj.args && proj.args.length > 0) entry.args = [...proj.args];
703
- if (proj.env && Object.keys(proj.env).length > 0) entry.env = { ...proj.env };
704
- if (pack.excludeTools && pack.excludeTools.length > 0) entry.excludeTools = [...pack.excludeTools];
705
-
706
- return { [pack.serverName]: entry };
707
- }
708
-
709
- /**
710
- * Detect which MCP packs to recommend for a Copilot project.
711
- */
712
- function recommendCopilotMcpPacks(stacks = [], domainPacks = [], options = {}) {
713
- const recommended = new Set();
714
- const stackKeys = new Set(stacks.map(s => s.key));
715
- const ctx = options.ctx || null;
716
- const deps = getProjectDependencies(ctx);
717
- const domainKeys = new Set(domainPacks.map(p => p.key));
718
- const cloudOnly = options.cloudOnly === true;
719
-
720
- if (stackKeys.size > 0) recommended.add('context7-docs');
721
- if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo')) recommended.add('github-mcp');
722
-
723
- if (domainKeys.has('frontend-ui') || stackKeys.has('react') || stackKeys.has('nextjs') ||
724
- stackKeys.has('vue') || stackKeys.has('angular') || stackKeys.has('svelte')) {
725
- recommended.add('playwright-mcp');
726
- }
727
-
728
- if (stackKeys.has('nextjs') || hasDependency(deps, 'next')) recommended.add('next-devtools');
729
-
730
- if ((domainKeys.has('backend-api') || domainKeys.has('infra-platform')) && hasPostgresSignals(ctx, deps)) {
731
- recommended.add('postgres-mcp');
732
- }
733
-
734
- if (domainKeys.has('monorepo') || domainKeys.has('enterprise-governed')) recommended.add('memory-mcp');
735
- if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo') || domainKeys.has('infra-platform')) recommended.add('sequential-thinking');
736
- if (domainKeys.has('infra-platform')) recommended.add('filesystem-mcp');
737
-
738
- if (domainKeys.has('backend-api') && ctx && (hasDependency(deps, 'axios') || hasDependency(deps, 'node-fetch') || hasDependency(deps, 'got'))) {
739
- recommended.add('fetch-mcp');
740
- }
741
-
742
- if (domainKeys.has('infra-platform') || domainKeys.has('devops-cicd')) recommended.add('docker-mcp');
743
- if (domainKeys.has('ecommerce') && (hasDependency(deps, 'stripe') || hasDependency(deps, '@stripe/stripe-js'))) recommended.add('stripe-mcp');
744
- if (domainKeys.has('ecommerce') && (hasDependency(deps, 'shopify') || hasDependency(deps, '@shopify/shopify-api'))) recommended.add('shopify-mcp');
745
- if (domainKeys.has('ai-ml')) recommended.add('huggingface-mcp');
746
- if (domainKeys.has('design-system')) recommended.add('figma-mcp');
747
- if (recommended.size >= 2) recommended.add('mcp-security');
748
- if (recommended.size === 0) recommended.add('context7-docs');
749
-
750
- let result = COPILOT_MCP_PACKS.filter(pack => recommended.has(pack.key)).map(pack => clone(pack));
751
-
752
- // Filter out cloud-incompatible packs if targeting cloud agent
753
- if (cloudOnly) {
754
- result = result.filter(pack => pack.cloudAgentCompatible !== false);
755
- }
756
-
757
- return result;
758
- }
759
-
760
- /**
761
- * Trust preflight: check if packs are safe to install.
762
- */
763
- function getCopilotMcpPreflight(packKeys = [], env = process.env) {
764
- return normalizeCopilotMcpPackKeys(packKeys)
765
- .map(key => {
766
- const pack = getCopilotMcpPack(key);
767
- if (!pack) return null;
768
- const missingEnvVars = pack.requiredAuth.filter(envKey => {
769
- const value = env && Object.prototype.hasOwnProperty.call(env, envKey) ? env[envKey] : '';
770
- return !`${value || ''}`.trim();
771
- });
772
- return {
773
- key,
774
- label: pack.label,
775
- trustLevel: pack.trustLevel,
776
- transport: pack.transport,
777
- requiredAuth: pack.requiredAuth,
778
- missingEnvVars,
779
- safe: missingEnvVars.length === 0,
780
- cloudAgentCompatible: pack.cloudAgentCompatible,
781
- warning: missingEnvVars.length > 0
782
- ? `Missing env vars: ${missingEnvVars.join(', ')}. Pack will be included but may fail at runtime.`
783
- : null,
784
- };
785
- })
786
- .filter(Boolean);
787
- }
788
-
789
- /**
790
- * Merge MCP packs into existing .vscode/mcp.json content.
791
- * Uses "servers" wrapper format (Copilot-specific).
792
- */
793
- function mergeCopilotMcpJson(existingContent = {}, packKeys = []) {
794
- let settings;
795
- if (typeof existingContent === 'string') {
796
- try { settings = JSON.parse(existingContent); } catch { settings = {}; }
797
- } else {
798
- settings = clone(existingContent);
799
- }
800
-
801
- if (!settings.servers || typeof settings.servers !== 'object') {
802
- settings.servers = {};
803
- }
804
-
805
- const existingServers = new Set(Object.keys(settings.servers));
806
- const newPacks = normalizeCopilotMcpPackKeys(packKeys)
807
- .map(key => getCopilotMcpPack(key))
808
- .filter(pack => pack && !existingServers.has(pack.serverName));
809
-
810
- for (const pack of newPacks) {
811
- const entry = packToJson(pack);
812
- const serverName = Object.keys(entry)[0];
813
- settings.servers[serverName] = entry[serverName];
814
- }
815
-
816
- return settings;
817
- }
818
-
819
- module.exports = {
820
- COPILOT_MCP_PACKS,
821
- getCopilotMcpPack,
822
- recommendCopilotMcpPacks,
823
- getCopilotMcpPreflight,
824
- mergeCopilotMcpJson,
825
- packToJson,
826
- };
1
+ /**
2
+ * Copilot MCP Pack System
3
+ *
4
+ * 26 MCP packs with JSON-aware projection, detection,
5
+ * recommendation, merge logic, and trust preflight.
6
+ *
7
+ * KEY DIFFERENCE: Copilot MCP uses .vscode/mcp.json format,
8
+ * which is a separate file from .vscode/settings.json.
9
+ * The cloud agent has MCP limitations (no OAuth remote servers).
10
+ *
11
+ * .vscode/mcp.json format:
12
+ * {
13
+ * "servers": {
14
+ * "server-name": {
15
+ * "command": "npx",
16
+ * "args": [...],
17
+ * "env": {...}
18
+ * }
19
+ * }
20
+ * }
21
+ */
22
+
23
+ const COPILOT_MCP_PACKS = [
24
+ {
25
+ key: 'context7-docs',
26
+ label: 'Context7 Docs',
27
+ description: 'Live, current framework and library documentation during Copilot 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
+ cloudAgentCompatible: true,
37
+ },
38
+ {
39
+ key: 'github-mcp',
40
+ label: 'GitHub',
41
+ description: 'Issue, PR, and repository context during Copilot 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: '${GITHUB_PERSONAL_ACCESS_TOKEN}' } },
49
+ excludeTools: ['create_repository', 'delete_file', 'push_files'],
50
+ cloudAgentCompatible: 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
+ cloudAgentCompatible: true,
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', '${DATABASE_URL}'] },
77
+ excludeTools: ['execute_sql'],
78
+ cloudAgentCompatible: false, // Requires local DB access
79
+ },
80
+ {
81
+ key: 'memory-mcp',
82
+ label: 'Memory / Knowledge Graph',
83
+ description: 'Persistent entity and relationship tracking across Copilot 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
+ cloudAgentCompatible: false, // Ephemeral VM = no persistence
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
+ cloudAgentCompatible: 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 Copilot 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
+ cloudAgentCompatible: 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
+ cloudAgentCompatible: 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
+ cloudAgentCompatible: false, // Requires local dev server
149
+ },
150
+ {
151
+ key: 'docker-mcp',
152
+ label: 'Docker',
153
+ description: 'Container management during Copilot 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
+ cloudAgentCompatible: 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: '${NOTION_API_KEY}' } },
175
+ excludeTools: [],
176
+ cloudAgentCompatible: 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: '${LINEAR_API_KEY}' } },
189
+ excludeTools: [],
190
+ cloudAgentCompatible: 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: '${SENTRY_AUTH_TOKEN}' } },
203
+ excludeTools: [],
204
+ cloudAgentCompatible: 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: '${SLACK_BOT_TOKEN}' } },
217
+ excludeTools: ['delete_message'],
218
+ cloudAgentCompatible: 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: '${STRIPE_API_KEY}' } },
231
+ excludeTools: ['create_charge', 'delete_customer'],
232
+ cloudAgentCompatible: 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: '${FIGMA_ACCESS_TOKEN}' } },
245
+ excludeTools: [],
246
+ cloudAgentCompatible: 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.',
254
+ trustLevel: 'high',
255
+ transport: 'stdio',
256
+ requiredAuth: [],
257
+ serverName: 'mcp-scan',
258
+ jsonProjection: { command: 'npx', args: ['-y', 'mcp-scan@latest'] },
259
+ excludeTools: [],
260
+ cloudAgentCompatible: 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: '${COMPOSIO_API_KEY}' } },
273
+ excludeTools: [],
274
+ cloudAgentCompatible: 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: '${ATLASSIAN_API_TOKEN}', ATLASSIAN_EMAIL: '${ATLASSIAN_EMAIL}' } },
287
+ excludeTools: [],
288
+ cloudAgentCompatible: 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: '${GA4_PROPERTY_ID}', GOOGLE_APPLICATION_CREDENTIALS: '${GOOGLE_APPLICATION_CREDENTIALS}' } },
301
+ excludeTools: [],
302
+ cloudAgentCompatible: false, // Requires OAuth credentials
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: '${GOOGLE_CLIENT_ID}', GOOGLE_CLIENT_SECRET: '${GOOGLE_CLIENT_SECRET}' } },
315
+ excludeTools: [],
316
+ cloudAgentCompatible: 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: '${N8N_URL}', N8N_API_KEY: '${N8N_API_KEY}' } },
329
+ excludeTools: [],
330
+ cloudAgentCompatible: 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: '${ZENDESK_API_TOKEN}', ZENDESK_SUBDOMAIN: '${ZENDESK_SUBDOMAIN}' } },
343
+ excludeTools: [],
344
+ cloudAgentCompatible: 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: '${INFISICAL_TOKEN}' } },
357
+ excludeTools: ['delete_secret', 'update_secret'],
358
+ cloudAgentCompatible: 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: '${SHOPIFY_ACCESS_TOKEN}' } },
371
+ excludeTools: [],
372
+ cloudAgentCompatible: 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: '${HF_TOKEN}' } },
385
+ excludeTools: [],
386
+ cloudAgentCompatible: true,
387
+ },
388
+ // ── 23 new packs ─────────────────────────────────────────────────────────
389
+ {
390
+ key: 'supabase-mcp', label: 'Supabase',
391
+ description: 'Database, auth, and storage for Supabase.',
392
+ useWhen: 'Repos using Supabase.',
393
+ adoption: 'Requires: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY.',
394
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['SUPABASE_URL', 'SUPABASE_SERVICE_ROLE_KEY'],
395
+ serverName: 'supabase',
396
+ jsonProjection: { command: 'npx', args: ['-y', '@supabase/mcp-server-supabase@latest'], env: { SUPABASE_URL: '${env:SUPABASE_URL}', SUPABASE_SERVICE_ROLE_KEY: '${env:SUPABASE_SERVICE_ROLE_KEY}' } },
397
+ excludeTools: ['delete_project', 'drop_table'],
398
+ cloudAgentCompatible: true,
399
+ },
400
+ {
401
+ key: 'prisma-mcp', label: 'Prisma ORM',
402
+ description: 'Schema inspection and migrations via Prisma.',
403
+ useWhen: 'Repos with a Prisma schema.',
404
+ adoption: 'Requires: DATABASE_URL.',
405
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['DATABASE_URL'],
406
+ serverName: 'prisma',
407
+ jsonProjection: { command: 'npx', args: ['-y', 'prisma-mcp-server@latest'], env: { DATABASE_URL: '${env:DATABASE_URL}' } },
408
+ excludeTools: ['drop_database'],
409
+ cloudAgentCompatible: true,
410
+ },
411
+ {
412
+ key: 'vercel-mcp', label: 'Vercel',
413
+ description: 'Deployment management via Vercel.',
414
+ useWhen: 'Repos deployed on Vercel.',
415
+ adoption: 'Requires: VERCEL_TOKEN.',
416
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['VERCEL_TOKEN'],
417
+ serverName: 'vercel',
418
+ jsonProjection: { command: 'npx', args: ['-y', '@vercel/mcp-server@latest'], env: { VERCEL_TOKEN: '${env:VERCEL_TOKEN}' } },
419
+ excludeTools: ['delete_project', 'delete_deployment'],
420
+ cloudAgentCompatible: true,
421
+ },
422
+ {
423
+ key: 'cloudflare-mcp', label: 'Cloudflare',
424
+ description: 'Workers, KV, R2, and D1 management.',
425
+ useWhen: 'Repos using Cloudflare edge.',
426
+ adoption: 'Requires: CLOUDFLARE_API_TOKEN.',
427
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CLOUDFLARE_API_TOKEN'],
428
+ serverName: 'cloudflare',
429
+ jsonProjection: { command: 'npx', args: ['-y', '@cloudflare/mcp-server-cloudflare@latest'], env: { CLOUDFLARE_API_TOKEN: '${env:CLOUDFLARE_API_TOKEN}' } },
430
+ excludeTools: ['delete_worker', 'purge_cache'],
431
+ cloudAgentCompatible: true,
432
+ },
433
+ {
434
+ key: 'aws-mcp', label: 'AWS',
435
+ description: 'S3, Lambda, DynamoDB access.',
436
+ useWhen: 'Repos using AWS.',
437
+ adoption: 'Requires: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION.',
438
+ trustLevel: 'low', transport: 'stdio', requiredAuth: ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION'],
439
+ serverName: 'aws',
440
+ jsonProjection: { command: 'npx', args: ['-y', '@aws-samples/mcp-server-aws@latest'], env: { AWS_ACCESS_KEY_ID: '${env:AWS_ACCESS_KEY_ID}', AWS_SECRET_ACCESS_KEY: '${env:AWS_SECRET_ACCESS_KEY}', AWS_REGION: '${env:AWS_REGION}' } },
441
+ excludeTools: ['delete_stack', 'terminate_instances', 'delete_bucket'],
442
+ cloudAgentCompatible: true,
443
+ },
444
+ {
445
+ key: 'redis-mcp', label: 'Redis',
446
+ description: 'Cache and session management.',
447
+ useWhen: 'Repos using Redis.',
448
+ adoption: 'Requires: REDIS_URL.',
449
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['REDIS_URL'],
450
+ serverName: 'redis',
451
+ jsonProjection: { command: 'npx', args: ['-y', 'redis-mcp-server@latest'], env: { REDIS_URL: '${env:REDIS_URL}' } },
452
+ excludeTools: ['flushall', 'flushdb'],
453
+ cloudAgentCompatible: true,
454
+ },
455
+ {
456
+ key: 'mongodb-mcp', label: 'MongoDB',
457
+ description: 'Document database access.',
458
+ useWhen: 'Repos using MongoDB.',
459
+ adoption: 'Requires: MONGODB_URI.',
460
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['MONGODB_URI'],
461
+ serverName: 'mongodb',
462
+ jsonProjection: { command: 'npx', args: ['-y', '@mongodb-js/mongodb-mcp-server@latest'], env: { MONGODB_URI: '${env:MONGODB_URI}' } },
463
+ excludeTools: ['drop_collection', 'drop_database'],
464
+ cloudAgentCompatible: true,
465
+ },
466
+ {
467
+ key: 'twilio-mcp', label: 'Twilio',
468
+ description: 'SMS, voice, and messaging.',
469
+ useWhen: 'Repos using Twilio.',
470
+ adoption: 'Requires: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN.',
471
+ trustLevel: 'low', transport: 'stdio', requiredAuth: ['TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN'],
472
+ serverName: 'twilio',
473
+ jsonProjection: { command: 'npx', args: ['-y', 'twilio-mcp-server@latest'], env: { TWILIO_ACCOUNT_SID: '${env:TWILIO_ACCOUNT_SID}', TWILIO_AUTH_TOKEN: '${env:TWILIO_AUTH_TOKEN}' } },
474
+ excludeTools: ['delete_message'],
475
+ cloudAgentCompatible: true,
476
+ },
477
+ {
478
+ key: 'sendgrid-mcp', label: 'SendGrid',
479
+ description: 'Transactional email delivery.',
480
+ useWhen: 'Repos using SendGrid.',
481
+ adoption: 'Requires: SENDGRID_API_KEY.',
482
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['SENDGRID_API_KEY'],
483
+ serverName: 'sendgrid',
484
+ jsonProjection: { command: 'npx', args: ['-y', 'sendgrid-mcp-server@latest'], env: { SENDGRID_API_KEY: '${env:SENDGRID_API_KEY}' } },
485
+ excludeTools: [],
486
+ cloudAgentCompatible: true,
487
+ },
488
+ {
489
+ key: 'algolia-mcp', label: 'Algolia Search',
490
+ description: 'Search indexing via Algolia.',
491
+ useWhen: 'Repos using Algolia.',
492
+ adoption: 'Requires: ALGOLIA_APP_ID, ALGOLIA_API_KEY.',
493
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['ALGOLIA_APP_ID', 'ALGOLIA_API_KEY'],
494
+ serverName: 'algolia',
495
+ jsonProjection: { command: 'npx', args: ['-y', 'algolia-mcp-server@latest'], env: { ALGOLIA_APP_ID: '${env:ALGOLIA_APP_ID}', ALGOLIA_API_KEY: '${env:ALGOLIA_API_KEY}' } },
496
+ excludeTools: ['delete_index'],
497
+ cloudAgentCompatible: true,
498
+ },
499
+ {
500
+ key: 'planetscale-mcp', label: 'PlanetScale',
501
+ description: 'Serverless MySQL via PlanetScale.',
502
+ useWhen: 'Repos on PlanetScale.',
503
+ adoption: 'Requires: PLANETSCALE_TOKEN.',
504
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['PLANETSCALE_TOKEN'],
505
+ serverName: 'planetscale',
506
+ jsonProjection: { command: 'npx', args: ['-y', 'planetscale-mcp-server@latest'], env: { PLANETSCALE_TOKEN: '${env:PLANETSCALE_TOKEN}' } },
507
+ excludeTools: ['delete_database'],
508
+ cloudAgentCompatible: true,
509
+ },
510
+ {
511
+ key: 'neon-mcp', label: 'Neon Serverless Postgres',
512
+ description: 'Serverless Postgres via Neon.',
513
+ useWhen: 'Repos using Neon.',
514
+ adoption: 'Requires: NEON_API_KEY.',
515
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['NEON_API_KEY'],
516
+ serverName: 'neon',
517
+ jsonProjection: { command: 'npx', args: ['-y', '@neondatabase/mcp-server-neon@latest'], env: { NEON_API_KEY: '${env:NEON_API_KEY}' } },
518
+ excludeTools: ['delete_project'],
519
+ cloudAgentCompatible: true,
520
+ },
521
+ {
522
+ key: 'turso-mcp', label: 'Turso Edge SQLite',
523
+ description: 'Edge SQLite via Turso.',
524
+ useWhen: 'Repos using Turso.',
525
+ adoption: 'Requires: TURSO_DATABASE_URL, TURSO_AUTH_TOKEN.',
526
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['TURSO_DATABASE_URL', 'TURSO_AUTH_TOKEN'],
527
+ serverName: 'turso',
528
+ jsonProjection: { command: 'npx', args: ['-y', 'turso-mcp-server@latest'], env: { TURSO_DATABASE_URL: '${env:TURSO_DATABASE_URL}', TURSO_AUTH_TOKEN: '${env:TURSO_AUTH_TOKEN}' } },
529
+ excludeTools: ['destroy_database'],
530
+ cloudAgentCompatible: true,
531
+ },
532
+ {
533
+ key: 'upstash-mcp', label: 'Upstash Redis+Kafka',
534
+ description: 'Serverless Redis and Kafka.',
535
+ useWhen: 'Repos using Upstash.',
536
+ adoption: 'Requires: UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN.',
537
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['UPSTASH_REDIS_REST_URL', 'UPSTASH_REDIS_REST_TOKEN'],
538
+ serverName: 'upstash',
539
+ jsonProjection: { command: 'npx', args: ['-y', '@upstash/mcp-server@latest'], env: { UPSTASH_REDIS_REST_URL: '${env:UPSTASH_REDIS_REST_URL}', UPSTASH_REDIS_REST_TOKEN: '${env:UPSTASH_REDIS_REST_TOKEN}' } },
540
+ excludeTools: [],
541
+ cloudAgentCompatible: true,
542
+ },
543
+ {
544
+ key: 'convex-mcp', label: 'Convex',
545
+ description: 'Reactive backend via Convex.',
546
+ useWhen: 'Repos using Convex.',
547
+ adoption: 'Requires: CONVEX_DEPLOYMENT.',
548
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CONVEX_DEPLOYMENT'],
549
+ serverName: 'convex',
550
+ jsonProjection: { command: 'npx', args: ['-y', '@convex-dev/mcp-server@latest'], env: { CONVEX_DEPLOYMENT: '${env:CONVEX_DEPLOYMENT}' } },
551
+ excludeTools: ['delete_deployment'],
552
+ cloudAgentCompatible: true,
553
+ },
554
+ {
555
+ key: 'clerk-mcp', label: 'Clerk Authentication',
556
+ description: 'User auth via Clerk.',
557
+ useWhen: 'Repos using Clerk.',
558
+ adoption: 'Requires: CLERK_SECRET_KEY.',
559
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CLERK_SECRET_KEY'],
560
+ serverName: 'clerk',
561
+ jsonProjection: { command: 'npx', args: ['-y', '@clerk/mcp-server@latest'], env: { CLERK_SECRET_KEY: '${env:CLERK_SECRET_KEY}' } },
562
+ excludeTools: ['delete_user'],
563
+ cloudAgentCompatible: true,
564
+ },
565
+ {
566
+ key: 'resend-mcp', label: 'Resend Email',
567
+ description: 'Transactional email via Resend.',
568
+ useWhen: 'Repos using Resend.',
569
+ adoption: 'Requires: RESEND_API_KEY.',
570
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['RESEND_API_KEY'],
571
+ serverName: 'resend',
572
+ jsonProjection: { command: 'npx', args: ['-y', 'resend-mcp-server@latest'], env: { RESEND_API_KEY: '${env:RESEND_API_KEY}' } },
573
+ excludeTools: [],
574
+ cloudAgentCompatible: true,
575
+ },
576
+ {
577
+ key: 'temporal-mcp', label: 'Temporal Workflow',
578
+ description: 'Workflow orchestration via Temporal.',
579
+ useWhen: 'Repos using Temporal.',
580
+ adoption: 'Requires: TEMPORAL_ADDRESS.',
581
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['TEMPORAL_ADDRESS'],
582
+ serverName: 'temporal',
583
+ jsonProjection: { command: 'npx', args: ['-y', 'temporal-mcp-server@latest'], env: { TEMPORAL_ADDRESS: '${env:TEMPORAL_ADDRESS}' } },
584
+ excludeTools: ['terminate_workflow'],
585
+ cloudAgentCompatible: true,
586
+ },
587
+ {
588
+ key: 'launchdarkly-mcp', label: 'LaunchDarkly',
589
+ description: 'Feature flags via LaunchDarkly.',
590
+ useWhen: 'Repos using LaunchDarkly.',
591
+ adoption: 'Requires: LAUNCHDARKLY_ACCESS_TOKEN.',
592
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['LAUNCHDARKLY_ACCESS_TOKEN'],
593
+ serverName: 'launchdarkly',
594
+ jsonProjection: { command: 'npx', args: ['-y', 'launchdarkly-mcp-server@latest'], env: { LAUNCHDARKLY_ACCESS_TOKEN: '${env:LAUNCHDARKLY_ACCESS_TOKEN}' } },
595
+ excludeTools: ['delete_flag'],
596
+ cloudAgentCompatible: true,
597
+ },
598
+ {
599
+ key: 'datadog-mcp', label: 'Datadog',
600
+ description: 'Monitoring and APM via Datadog.',
601
+ useWhen: 'Repos using Datadog.',
602
+ adoption: 'Requires: DATADOG_API_KEY, DATADOG_APP_KEY.',
603
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['DATADOG_API_KEY', 'DATADOG_APP_KEY'],
604
+ serverName: 'datadog',
605
+ jsonProjection: { command: 'npx', args: ['-y', '@datadog/mcp-server@latest'], env: { DATADOG_API_KEY: '${env:DATADOG_API_KEY}', DATADOG_APP_KEY: '${env:DATADOG_APP_KEY}' } },
606
+ excludeTools: ['delete_monitor'],
607
+ cloudAgentCompatible: true,
608
+ },
609
+ {
610
+ key: 'grafana-mcp', label: 'Grafana',
611
+ description: 'Dashboards via Grafana.',
612
+ useWhen: 'Repos using Grafana.',
613
+ adoption: 'Requires: GRAFANA_URL, GRAFANA_API_KEY.',
614
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['GRAFANA_URL', 'GRAFANA_API_KEY'],
615
+ serverName: 'grafana',
616
+ jsonProjection: { command: 'npx', args: ['-y', 'grafana-mcp-server@latest'], env: { GRAFANA_URL: '${env:GRAFANA_URL}', GRAFANA_API_KEY: '${env:GRAFANA_API_KEY}' } },
617
+ excludeTools: ['delete_dashboard'],
618
+ cloudAgentCompatible: true,
619
+ },
620
+ {
621
+ key: 'circleci-mcp', label: 'CircleCI',
622
+ description: 'CI/CD via CircleCI.',
623
+ useWhen: 'Repos using CircleCI.',
624
+ adoption: 'Requires: CIRCLECI_TOKEN.',
625
+ trustLevel: 'medium', transport: 'stdio', requiredAuth: ['CIRCLECI_TOKEN'],
626
+ serverName: 'circleci',
627
+ jsonProjection: { command: 'npx', args: ['-y', 'circleci-mcp-server@latest'], env: { CIRCLECI_TOKEN: '${env:CIRCLECI_TOKEN}' } },
628
+ excludeTools: ['cancel_pipeline'],
629
+ cloudAgentCompatible: true,
630
+ },
631
+ {
632
+ key: 'anthropic-mcp', label: 'Anthropic Claude API',
633
+ description: 'Claude API for AI-powered apps.',
634
+ useWhen: 'Repos building on Claude API.',
635
+ adoption: 'Requires: ANTHROPIC_API_KEY.',
636
+ trustLevel: 'high', transport: 'stdio', requiredAuth: ['ANTHROPIC_API_KEY'],
637
+ serverName: 'anthropic',
638
+ jsonProjection: { command: 'npx', args: ['-y', '@anthropic-ai/mcp-server@latest'], env: { ANTHROPIC_API_KEY: '${env:ANTHROPIC_API_KEY}' } },
639
+ excludeTools: [],
640
+ cloudAgentCompatible: true,
641
+ },
642
+ ];
643
+
644
+ // --- Helpers ---
645
+
646
+ function clone(value) {
647
+ return JSON.parse(JSON.stringify(value));
648
+ }
649
+
650
+ function hasDependency(deps, name) {
651
+ return Object.prototype.hasOwnProperty.call(deps || {}, name);
652
+ }
653
+
654
+ function hasFileContentMatch(ctx, filePath, pattern) {
655
+ if (!ctx) return false;
656
+ const content = ctx.fileContent(filePath);
657
+ return !!(content && pattern.test(content));
658
+ }
659
+
660
+ function getProjectDependencies(ctx) {
661
+ if (!ctx) return {};
662
+ if (typeof ctx.projectDependencies === 'function') return ctx.projectDependencies();
663
+ const pkg = ctx.jsonFile('package.json') || {};
664
+ return { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
665
+ }
666
+
667
+ function hasPostgresSignals(ctx, deps) {
668
+ if (hasDependency(deps, 'pg') || hasDependency(deps, 'postgres') || hasDependency(deps, 'pg-promise') ||
669
+ hasDependency(deps, 'slonik') || hasDependency(deps, '@neondatabase/serverless') || hasDependency(deps, '@vercel/postgres')) {
670
+ return true;
671
+ }
672
+ return (
673
+ hasFileContentMatch(ctx, 'prisma/schema.prisma', /provider\s*=\s*["']postgresql["']/i) ||
674
+ hasFileContentMatch(ctx, 'docker-compose.yml', /\bpostgres\b/i) ||
675
+ hasFileContentMatch(ctx, 'docker-compose.yaml', /\bpostgres\b/i)
676
+ );
677
+ }
678
+
679
+ // --- Core Functions ---
680
+
681
+ function getCopilotMcpPack(key) {
682
+ return COPILOT_MCP_PACKS.find(pack => pack.key === key) || null;
683
+ }
684
+
685
+ function normalizeCopilotMcpPackKeys(keys = []) {
686
+ return [...new Set((Array.isArray(keys) ? keys : [])
687
+ .map(key => `${key}`.trim())
688
+ .filter(Boolean))]
689
+ .filter(key => !!getCopilotMcpPack(key));
690
+ }
691
+
692
+ /**
693
+ * Generate .vscode/mcp.json entry for a single MCP pack.
694
+ * Copilot uses .vscode/mcp.json with "servers" wrapper (not settings.json mcpServers).
695
+ */
696
+ function packToJson(pack) {
697
+ const entry = {};
698
+ const proj = pack.jsonProjection;
699
+
700
+ if (proj.command) entry.command = proj.command;
701
+ if (proj.url) entry.url = proj.url;
702
+ if (proj.args && proj.args.length > 0) entry.args = [...proj.args];
703
+ if (proj.env && Object.keys(proj.env).length > 0) entry.env = { ...proj.env };
704
+ if (pack.excludeTools && pack.excludeTools.length > 0) entry.excludeTools = [...pack.excludeTools];
705
+
706
+ return { [pack.serverName]: entry };
707
+ }
708
+
709
+ /**
710
+ * Detect which MCP packs to recommend for a Copilot project.
711
+ */
712
+ function recommendCopilotMcpPacks(stacks = [], domainPacks = [], options = {}) {
713
+ const recommended = new Set();
714
+ const stackKeys = new Set(stacks.map(s => s.key));
715
+ const ctx = options.ctx || null;
716
+ const deps = getProjectDependencies(ctx);
717
+ const domainKeys = new Set(domainPacks.map(p => p.key));
718
+ const cloudOnly = options.cloudOnly === true;
719
+
720
+ if (stackKeys.size > 0) recommended.add('context7-docs');
721
+ if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo')) recommended.add('github-mcp');
722
+
723
+ if (domainKeys.has('frontend-ui') || stackKeys.has('react') || stackKeys.has('nextjs') ||
724
+ stackKeys.has('vue') || stackKeys.has('angular') || stackKeys.has('svelte')) {
725
+ recommended.add('playwright-mcp');
726
+ }
727
+
728
+ if (stackKeys.has('nextjs') || hasDependency(deps, 'next')) recommended.add('next-devtools');
729
+
730
+ if ((domainKeys.has('backend-api') || domainKeys.has('infra-platform')) && hasPostgresSignals(ctx, deps)) {
731
+ recommended.add('postgres-mcp');
732
+ }
733
+
734
+ if (domainKeys.has('monorepo') || domainKeys.has('enterprise-governed')) recommended.add('memory-mcp');
735
+ if (domainKeys.has('enterprise-governed') || domainKeys.has('monorepo') || domainKeys.has('infra-platform')) recommended.add('sequential-thinking');
736
+ if (domainKeys.has('infra-platform')) recommended.add('filesystem-mcp');
737
+
738
+ if (domainKeys.has('backend-api') && ctx && (hasDependency(deps, 'axios') || hasDependency(deps, 'node-fetch') || hasDependency(deps, 'got'))) {
739
+ recommended.add('fetch-mcp');
740
+ }
741
+
742
+ if (domainKeys.has('infra-platform') || domainKeys.has('devops-cicd')) recommended.add('docker-mcp');
743
+ if (domainKeys.has('ecommerce') && (hasDependency(deps, 'stripe') || hasDependency(deps, '@stripe/stripe-js'))) recommended.add('stripe-mcp');
744
+ if (domainKeys.has('ecommerce') && (hasDependency(deps, 'shopify') || hasDependency(deps, '@shopify/shopify-api'))) recommended.add('shopify-mcp');
745
+ if (domainKeys.has('ai-ml')) recommended.add('huggingface-mcp');
746
+ if (domainKeys.has('design-system')) recommended.add('figma-mcp');
747
+ if (recommended.size >= 2) recommended.add('mcp-security');
748
+ if (recommended.size === 0) recommended.add('context7-docs');
749
+
750
+ let result = COPILOT_MCP_PACKS.filter(pack => recommended.has(pack.key)).map(pack => clone(pack));
751
+
752
+ // Filter out cloud-incompatible packs if targeting cloud agent
753
+ if (cloudOnly) {
754
+ result = result.filter(pack => pack.cloudAgentCompatible !== false);
755
+ }
756
+
757
+ return result;
758
+ }
759
+
760
+ /**
761
+ * Trust preflight: check if packs are safe to install.
762
+ */
763
+ function getCopilotMcpPreflight(packKeys = [], env = process.env) {
764
+ return normalizeCopilotMcpPackKeys(packKeys)
765
+ .map(key => {
766
+ const pack = getCopilotMcpPack(key);
767
+ if (!pack) return null;
768
+ const missingEnvVars = pack.requiredAuth.filter(envKey => {
769
+ const value = env && Object.prototype.hasOwnProperty.call(env, envKey) ? env[envKey] : '';
770
+ return !`${value || ''}`.trim();
771
+ });
772
+ return {
773
+ key,
774
+ label: pack.label,
775
+ trustLevel: pack.trustLevel,
776
+ transport: pack.transport,
777
+ requiredAuth: pack.requiredAuth,
778
+ missingEnvVars,
779
+ safe: missingEnvVars.length === 0,
780
+ cloudAgentCompatible: pack.cloudAgentCompatible,
781
+ warning: missingEnvVars.length > 0
782
+ ? `Missing env vars: ${missingEnvVars.join(', ')}. Pack will be included but may fail at runtime.`
783
+ : null,
784
+ };
785
+ })
786
+ .filter(Boolean);
787
+ }
788
+
789
+ /**
790
+ * Merge MCP packs into existing .vscode/mcp.json content.
791
+ * Uses "servers" wrapper format (Copilot-specific).
792
+ */
793
+ function mergeCopilotMcpJson(existingContent = {}, packKeys = []) {
794
+ let settings;
795
+ if (typeof existingContent === 'string') {
796
+ try { settings = JSON.parse(existingContent); } catch { settings = {}; }
797
+ } else {
798
+ settings = clone(existingContent);
799
+ }
800
+
801
+ if (!settings.servers || typeof settings.servers !== 'object') {
802
+ settings.servers = {};
803
+ }
804
+
805
+ const existingServers = new Set(Object.keys(settings.servers));
806
+ const newPacks = normalizeCopilotMcpPackKeys(packKeys)
807
+ .map(key => getCopilotMcpPack(key))
808
+ .filter(pack => pack && !existingServers.has(pack.serverName));
809
+
810
+ for (const pack of newPacks) {
811
+ const entry = packToJson(pack);
812
+ const serverName = Object.keys(entry)[0];
813
+ settings.servers[serverName] = entry[serverName];
814
+ }
815
+
816
+ return settings;
817
+ }
818
+
819
+ module.exports = {
820
+ COPILOT_MCP_PACKS,
821
+ getCopilotMcpPack,
822
+ recommendCopilotMcpPacks,
823
+ getCopilotMcpPreflight,
824
+ mergeCopilotMcpJson,
825
+ packToJson,
826
+ };