@polymorphism-tech/morph-spec 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +367 -367
  2. package/framework/agents.json +132 -127
  3. package/framework/rubrics/backend.json +41 -36
  4. package/framework/rules/ai-agents-standards.md +45 -15
  5. package/framework/rules/neon-standards.md +25 -26
  6. package/framework/standards/STANDARDS.json +1729 -1133
  7. package/framework/standards/ai-agents/agent-session.md +160 -0
  8. package/framework/standards/ai-agents/batching.md +193 -0
  9. package/framework/standards/ai-agents/context-providers.md +188 -0
  10. package/framework/standards/ai-agents/mcp-server.md +250 -0
  11. package/framework/standards/ai-agents/mcp-tools.md +197 -0
  12. package/framework/standards/ai-agents/middleware-patterns.md +207 -0
  13. package/framework/standards/ai-agents/modalities-image-gen.md +173 -0
  14. package/framework/standards/ai-agents/modalities-speech-to-text.md +171 -0
  15. package/framework/standards/ai-agents/modalities-text-to-speech.md +181 -0
  16. package/framework/standards/ai-agents/modalities-vision.md +201 -0
  17. package/framework/standards/ai-agents/multi-agent-patterns.md +155 -0
  18. package/framework/standards/ai-agents/production.md +114 -258
  19. package/framework/standards/ai-agents/prompts-in-db.md +214 -0
  20. package/framework/standards/ai-agents/providers/model-registry.md +158 -0
  21. package/framework/standards/ai-agents/rag-custom-pgvector.md +243 -0
  22. package/framework/standards/ai-agents/service-tier-flex.md +135 -0
  23. package/framework/standards/ai-agents/setup.md +142 -316
  24. package/framework/standards/ai-agents/structured-output.md +249 -0
  25. package/framework/standards/ai-agents/sweet-spot.md +109 -0
  26. package/framework/standards/ai-agents/workflows.md +114 -284
  27. package/framework/standards/architecture/vertical-slice/vertical-slice.md +433 -429
  28. package/framework/standards/backend/api/validation.md +92 -88
  29. package/framework/standards/backend/database/postgresql/database.md +336 -332
  30. package/framework/standards/backend/database/vector-search-rag.md +599 -541
  31. package/framework/standards/backend/dotnet/fluent-validation-vsa.md +4 -0
  32. package/framework/standards/backend/dotnet/result-pattern.md +4 -0
  33. package/framework/standards/backend/dotnet/scalar-ui.md +176 -172
  34. package/framework/standards/backend/dotnet/scrutor.md +4 -0
  35. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +278 -274
  36. package/framework/standards/backend/integrations/asaas/asaas-api.md +260 -216
  37. package/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +354 -350
  38. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +30 -19
  39. package/framework/standards/backend/integrations/resend/resend-email.md +400 -385
  40. package/framework/standards/data/nosql/cache/redis.md +106 -97
  41. package/framework/standards/data/nosql/cosmos-db.md +127 -118
  42. package/framework/standards/data/vector-search/rag-chunking.md +113 -104
  43. package/framework/standards/frontend/design-system/ai-image-generation.md +4 -0
  44. package/framework/standards/frontend/design-system/animations.md +164 -160
  45. package/framework/standards/frontend/design-system/naming.md +68 -64
  46. package/framework/standards/frontend/gsap/gsap-core.md +14 -8
  47. package/framework/standards/frontend/gsap/gsap-plugins.md +26 -21
  48. package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +9 -7
  49. package/framework/standards/frontend/nextjs/app-router.md +127 -123
  50. package/framework/standards/frontend/nextjs/components.md +136 -132
  51. package/framework/standards/frontend/nextjs/data-fetching.md +130 -126
  52. package/framework/standards/frontend/nextjs/forms.md +134 -128
  53. package/framework/standards/frontend/nextjs/motion-patterns.md +328 -322
  54. package/framework/standards/frontend/nextjs/naming-conventions.md +71 -67
  55. package/framework/standards/frontend/nextjs/nextjs-patterns.md +229 -225
  56. package/framework/standards/frontend/nextjs/project-structure.md +106 -102
  57. package/framework/standards/frontend/nextjs/state-management.md +76 -72
  58. package/framework/standards/frontend/nextjs/testing.md +115 -111
  59. package/framework/standards/infrastructure/docker/easypanel-deploy.md +196 -192
  60. package/framework/standards/infrastructure/neon/neon-pgrag.md +6 -2
  61. package/framework/standards/infrastructure/neon/neon-pgvector.md +4 -0
  62. package/framework/standards/infrastructure/neon/neon-setup.md +5 -1
  63. package/framework/standards/integration/mcp/mcp-tools.md +471 -462
  64. package/framework/templates/REGISTRY.json +1745 -1239
  65. package/framework/templates/code/dotnet/ai-agents/AgentBootstrap.cs.template +39 -0
  66. package/framework/templates/code/dotnet/ai-agents/EmbeddingService.cs.template +68 -0
  67. package/framework/templates/code/dotnet/ai-agents/ModelRegistry.cs.template +117 -0
  68. package/framework/templates/code/dotnet/ai-agents/PromptRepository.cs.template +95 -0
  69. package/framework/templates/code/dotnet/ai-agents/ResilientToolMiddleware.cs.template +61 -0
  70. package/framework/templates/code/dotnet/ai-agents/VectorSearchTool.cs.template +107 -0
  71. package/framework/templates/code/dotnet/ai-agents/model-registry.json.template +58 -0
  72. package/framework/templates/code/sql/ai-agents/agent-prompts-migration.sql.template +58 -0
  73. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -0
  74. package/package.json +89 -83
  75. package/src/core/templates/template-registry.js +289 -256
  76. package/src/lib/generators/context-generator.js +516 -518
  77. package/src/lib/generators/scaffold-generator.js +23 -26
  78. package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +0 -310
  79. package/framework/templates/integrations/semantic-kernel-neon.cs +0 -125
@@ -1,462 +1,471 @@
1
- # Integration Standard: MCP Tools in MORPH Workflows
2
-
3
- > Reference for using Model Context Protocol (MCP) tools across morph-spec phases. Each phase benefits from different MCPs depending on what data is needed.
4
-
5
- ## MCP Availability Detection
6
-
7
- Before using any MCP tool, check if it's available in the current session:
8
-
9
- ```javascript
10
- // Pattern: Attempt the call — if the tool doesn't exist, Claude Code will report it
11
- // There is no "list MCPs" command; just try the most common operation
12
-
13
- // GitHub MCP
14
- await mcp__github__get_repo();
15
-
16
- // Context7 (library docs)
17
- await mcp__context7__resolve_library_id({ libraryName: "react" });
18
-
19
- // Playwright (browser automation)
20
- await mcp__playwright__browser_navigate({ url: "https://example.com" });
21
-
22
- // Neon — use `neonctl` CLI + `psql`
23
- // neonctl connection-string → get DB URL
24
- // psql <DB_URL> -c "SELECT ..."
25
- ```
26
-
27
- **Fallback rule:** If an MCP is not available, every phase has a manual alternative using Claude Code native tools (Read, Grep, Glob, Bash).
28
-
29
- ---
30
-
31
- ## MCP Providers by Phase
32
-
33
- ### Phase 1 (Setup) — Project Discovery
34
-
35
- | MCP | Use Case | Example |
36
- |-----|----------|---------|
37
- | **GitHub** | Repo info, recent PRs, issues | `mcp__github__get_repo()` |
38
- | **Filesystem** | Scan project structure | Native Glob/Read preferred |
39
-
40
- ```javascript
41
- // Detect project type from repo metadata
42
- const repo = await mcp__github__get_repo();
43
- // → language, default_branch, topics
44
-
45
- // Fallback: use Glob to detect stack
46
- // Glob: "**/{package.json,*.csproj,*.sln,go.mod,Cargo.toml}"
47
- ```
48
-
49
- ### Phase 2 (UI/UX) — Design References
50
-
51
- | MCP | Use Case | Example |
52
- |-----|----------|---------|
53
- | **Playwright** | Navigate, screenshot, inspect live pages | `mcp__playwright__browser_navigate({ url })` |
54
- | **Context7** | Component library documentation | `mcp__context7__query_docs({ libraryId, query })` |
55
-
56
- ```javascript
57
- // Screenshot existing app for design reference
58
- await mcp__playwright__browser_navigate({ url: "https://app.example.com/dashboard" });
59
- const screenshot = await mcp__playwright__browser_take_screenshot();
60
- // → Visual reference for UI/UX design
61
-
62
- // Inspect page structure via accessibility tree
63
- const snapshot = await mcp__playwright__browser_snapshot();
64
- // → Structured element tree (headings, buttons, inputs, etc.)
65
-
66
- // Test responsive layout
67
- await mcp__playwright__browser_resize({ width: 375, height: 812 });
68
- const mobileScreenshot = await mcp__playwright__browser_take_screenshot();
69
-
70
- // Get MudBlazor component docs for UI specs
71
- const libId = await mcp__context7__resolve_library_id({
72
- libraryName: "mudblazor",
73
- query: "data grid with sorting and filtering"
74
- });
75
- const docs = await mcp__context7__query_docs({
76
- libraryId: libId,
77
- query: "DataGrid component props and events"
78
- });
79
-
80
- // Fallback: WebSearch for component documentation
81
- // WebFetch for specific component API pages
82
- ```
83
-
84
- ### Gemini Image MCP — AI Image Generation
85
-
86
- > Available in: **UI/UX** (preview generation), **Implement** (production assets)
87
-
88
- | Tool | Use Case | Example |
89
- |------|----------|---------|
90
- | `generate_image` | Create new image from text prompt | `mcp__gemini-image-mcp__generate_image({ prompt, aspectRatio, outputPath })` |
91
- | `edit_image` | Modify existing image | `mcp__gemini-image-mcp__edit_image({ imageSource, prompt })` |
92
- | `continue_editing` | Iterate on last generated/edited image | `mcp__gemini-image-mcp__continue_editing({ prompt })` |
93
- | `list_images` | Browse image generation history | `mcp__gemini-image-mcp__list_images({ type: "all" })` |
94
- | `get_image_info` | Get metadata about a specific image | `mcp__gemini-image-mcp__get_image_info({ imageId })` |
95
-
96
- ```javascript
97
- // Generate a hero image using design system tokens
98
- // Read design-system.md first to get project colors and aesthetic direction
99
- const image = await mcp__gemini_image_mcp__generate_image({
100
- prompt: "A floating tablet showing a modern dashboard interface on a dark charcoal background with copper and gold accent lighting. Premium luxury aesthetic, photorealistic, cinematic lighting with warm rim light.",
101
- aspectRatio: "16:9",
102
- outputPath: "public/images/my-feature/hero-mockup.png"
103
- });
104
-
105
- // Edit an existing image (keep edits short and targeted)
106
- await mcp__gemini_image_mcp__edit_image({
107
- imageSource: "public/images/my-feature/hero-mockup.png",
108
- prompt: "Make the lighting warmer and add a subtle copper glow around the tablet edges."
109
- });
110
-
111
- // Iterate with continue_editing (one change at a time)
112
- await mcp__gemini_image_mcp__continue_editing({
113
- prompt: "More contrast in the shadows."
114
- });
115
-
116
- // Fallback: Manual image creation, stock photos, or placeholder divs
117
- ```
118
-
119
- **Use cases by phase:**
120
-
121
- | Phase | Use Case | Tool |
122
- |-------|----------|------|
123
- | UI/UX (2) | Generate preview images for design approval | `generate_image` |
124
- | Implement (7) | Generate production assets from assets.md specs | `generate_image` + `edit_image` |
125
- | Implement (7) | Iterate on generated images for quality | `continue_editing` |
126
-
127
- > **Standard:** See `frontend/design-system/ai-image-generation.md` for prompt engineering patterns, aspect ratio guide, and `assets.md` format.
128
-
129
- ---
130
-
131
- ### Phase 3 (Design) — Schema & Architecture
132
-
133
- | Tool | Use Case | Example |
134
- |------|----------|---------|
135
- | **Neon CLI (`neonctl`) / psql** | Database schema, tables, relationships, RLS | `psql <DB_URL> -c "SELECT ..."` |
136
- | **Context7** | Library docs for architecture decisions | `mcp__context7__query_docs()` |
137
- | **GitHub** | Check existing code patterns, PRs | `mcp__github__search_code()` |
138
-
139
- ```bash
140
- # === SCHEMA ANALYSIS (Critical for contracts.cs) ===
141
-
142
- # 0. Get Neon DB connection string
143
- neonctl connection-string
144
- # → e.g.: postgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/neondb?sslmode=require
145
-
146
- # 1. List all tables
147
- pg_dump $(neonctl connection-string) --schema-only --schema public 2>/dev/null | grep "CREATE TABLE"
148
-
149
- # 2. Get schema for each relevant table
150
- psql $(neonctl connection-string) -c "SELECT column_name, data_type, is_nullable, column_default \
151
- FROM information_schema.columns WHERE table_name = 'leads' ORDER BY ordinal_position"
152
-
153
- # 3. Get foreign key relationships
154
- psql $(neonctl connection-string) -c "SELECT tc.table_name, kcu.column_name, ccu.table_name AS foreign_table, \
155
- ccu.column_name AS foreign_column FROM information_schema.table_constraints tc \
156
- JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name \
157
- JOIN information_schema.constraint_column_usage ccu ON tc.constraint_name = ccu.constraint_name \
158
- WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = 'leads'"
159
-
160
- # 4. Check RLS policies (security-critical)
161
- psql $(neonctl connection-string) -c "SELECT tablename, policyname, cmd, qual FROM pg_policies WHERE tablename = 'leads'"
162
- ```
163
-
164
- **Fallback (Neon database not accessible):**
165
- ```
166
- 1. Grep: "\.from\(|\.select\(|SELECT |DbSet<" → find query files
167
- 2. Read each query file → extract table/column names
168
- 3. Glob: "src/**/types/**/*.ts" or "**/Entities/**/*.cs" → find type definitions
169
- 4. Read type files → map properties to database columns
170
- ```
171
-
172
- ### Phase 4 (Clarify) — Validation & Research
173
-
174
- | MCP | Use Case | Example |
175
- |-----|----------|---------|
176
- | **Context7** | Verify library capabilities, API limits | `mcp__context7__query_docs()` |
177
- | **GitHub** | Check issue discussions, known limitations | `mcp__github__search_issues()` |
178
-
179
- ```javascript
180
- // Verify if library supports a required feature
181
- const docs = await mcp__context7__query_docs({
182
- libraryId: "/mudblazor/mudblazor",
183
- query: "DataGrid server-side pagination with virtual scrolling"
184
- });
185
- // → Confirms capability or identifies limitation for spec update
186
-
187
- // Fallback: WebSearch for library capabilities
188
- ```
189
-
190
- ### Phase 6 (Tasks) — Planning & Organization
191
-
192
- | MCP | Use Case | Example |
193
- |-----|----------|---------|
194
- | **GitHub** | Create issues from tasks, link to milestone | `mcp__github__create_issue()` |
195
- | **Context7** | Estimate complexity based on library docs | `mcp__context7__query_docs()` |
196
-
197
- ```javascript
198
- // Create GitHub issues from tasks.json (if team uses GitHub Projects)
199
- for (const task of tasks) {
200
- await mcp__github__create_issue({
201
- title: task.title,
202
- body: task.description,
203
- labels: [task.category],
204
- milestone: featureMilestone
205
- });
206
- }
207
-
208
- // Fallback: Bash with gh CLI
209
- // gh issue create --title "T001: Create Entity Lead" --label "domain"
210
- ```
211
-
212
- ### Phase 7 (Implement) — Build & Deploy
213
-
214
- | Tool | Use Case | Example |
215
- |------|----------|---------|
216
- | **Neon CLI (`neonctl`) / psql** | Run migrations, create RLS policies | `dotnet ef database update` |
217
- | **GitHub** | Create PR, push branches | `mcp__github__create_pull_request()` |
218
- | **Context7** | Look up API usage during coding | `mcp__context7__query_docs()` |
219
- | **Playwright** | Smoke test deployed features, verify UI | `mcp__playwright__browser_navigate()` |
220
- | **Vercel** | Deploy, check logs, manage env vars | `mcp__vercel__list_projects()` |
221
- | **Azure CLI** | Resource management, deployments | `az` commands |
222
- | **Docker CLI** | Build, run, compose, logs (local) | `docker` commands |
223
-
224
- ```bash
225
- # === NEON (Migrations & RLS via EF Core) ===
226
-
227
- # Create migration
228
- dotnet ef migrations add AddStatusToLeads
229
-
230
- # Apply migration to Neon database
231
- dotnet ef database update
232
-
233
- # Verify schema after migration
234
- psql $(neonctl connection-string) -c "SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'leads'"
235
-
236
- # Verify RLS policies
237
- psql $(neonctl connection-string) -c "SELECT policyname, cmd, qual FROM pg_policies WHERE tablename = 'leads'"
238
- ```
239
-
240
- ```javascript
241
- // Lookup API during implementation
242
- const docs = await mcp__context7__query_docs({
243
- libraryId: "/dotnet/efcore",
244
- query: "owned entity types configuration"
245
- });
246
-
247
- // Smoke test deployed feature via browser
248
- await mcp__playwright__browser_navigate({ url: "https://localhost:5001/leads" });
249
- const snapshot = await mcp__playwright__browser_snapshot();
250
- // → Verify page renders correctly, check for errors
251
-
252
- // Check for console errors after deploy
253
- const logs = await mcp__playwright__browser_console_messages();
254
- // → Catch JavaScript errors, failed API calls
255
-
256
- // Screenshot for recap.md documentation
257
- const screenshot = await mcp__playwright__browser_take_screenshot();
258
-
259
- // === VERCEL (Deployment & Environment) ===
260
-
261
- // List projects
262
- const projects = await mcp__vercel__list_projects();
263
-
264
- // Check deployment status and logs
265
- const deployments = await mcp__vercel__get_deployments({ projectId: 'my-project' });
266
- const logs = await mcp__vercel__get_deployment_logs({ deploymentId: deployments[0].uid });
267
-
268
- // Manage environment variables
269
- await mcp__vercel__manage_env_vars({
270
- projectId: 'my-project',
271
- action: 'set',
272
- key: 'DATABASE_URL',
273
- value: process.env.DATABASE_URL,
274
- target: ['production', 'preview']
275
- });
276
-
277
- // Fallback: Bash for gh CLI for PRs, vercel CLI for deployments
278
- ```
279
-
280
- ---
281
-
282
- ## MCP vs Native Tools Decision
283
-
284
- | Need | MCP Tool | Native Alternative |
285
- |------|----------|--------------------|
286
- | Database schema | Neon CLI (`neonctl`) / psql | Grep queries + Read types |
287
- | Repo metadata | GitHub MCP | Bash `gh` CLI |
288
- | Library docs | Context7 | WebSearch + WebFetch |
289
- | Live page preview | Playwright MCP | WebFetch URL |
290
- | Page interaction (click, type, navigate) | Playwright MCP | Manual testing |
291
- | Responsive layout testing | Playwright MCP (`browser_resize`) | Manual testing |
292
- | Console error checking | Playwright MCP (`browser_console_messages`) | Browser DevTools |
293
- | Container ops | Docker CLI (`docker ps`, `docker logs`, `docker compose`) | — |
294
- | Cloud resources | Azure CLI (`az resource`, `az deployment`) | — |
295
- | Vercel deployments | Vercel MCP | Bash `vercel` CLI |
296
- | AI image generation | Gemini Image MCP | Manual creation or stock photos |
297
-
298
- **Rule:** MCP tools provide structured data (JSON responses). Native tools require manual parsing. **Always prefer MCP when available** — fall back to native when not. **Exceptions:** Neon, Docker, and Azure always use their respective CLIs directly — never MCP.
299
-
300
- ---
301
-
302
- ## Common MCP Patterns
303
-
304
- ### Browser (Playwright): Page Automation & Analysis
305
-
306
- ```javascript
307
- // === SETUP ===
308
- // Playwright MCP: npx @playwright/mcp@latest
309
- // Config in .claude/settings.json or claude_desktop_config.json:
310
- // { "mcpServers": { "playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] } } }
311
-
312
- // === NAVIGATION & SNAPSHOT ===
313
-
314
- // 1. Navigate to a page
315
- await mcp__playwright__browser_navigate({ url: "https://app.example.com/dashboard" });
316
-
317
- // 2. Take accessibility snapshot (preferred — structured, LLM-friendly)
318
- const snapshot = await mcp__playwright__browser_snapshot();
319
- // → Returns accessibility tree with element refs for interaction
320
-
321
- // 3. Take visual screenshot (requires --caps vision)
322
- const screenshot = await mcp__playwright__browser_take_screenshot();
323
- // → Returns PNG image of current page
324
-
325
- // === INTERACTION ===
326
-
327
- // 4. Click an element (use ref from snapshot)
328
- await mcp__playwright__browser_click({ element: "Submit button", ref: "s1e15" });
329
-
330
- // 5. Type into an input field
331
- await mcp__playwright__browser_type({ element: "Search input", ref: "s1e8", text: "query" });
332
-
333
- // 6. Fill a form field (replaces existing value)
334
- await mcp__playwright__browser_fill_form({ ref: "s1e8", value: "new value" });
335
-
336
- // 7. Select dropdown option
337
- await mcp__playwright__browser_select_option({ element: "Status", ref: "s1e12", values: ["active"] });
338
-
339
- // 8. Press keyboard key
340
- await mcp__playwright__browser_press_key({ key: "Enter" });
341
-
342
- // === TABS & NAVIGATION ===
343
-
344
- // 9. List open tabs
345
- const tabs = await mcp__playwright__browser_tabs();
346
-
347
- // 10. Navigate back
348
- await mcp__playwright__browser_navigate_back();
349
-
350
- // 11. Close current tab
351
- await mcp__playwright__browser_close();
352
-
353
- // === ADVANCED ===
354
-
355
- // 12. Evaluate JavaScript in page context
356
- const result = await mcp__playwright__browser_evaluate({
357
- expression: "document.querySelectorAll('.error').length"
358
- });
359
-
360
- // 13. Get console messages (debug)
361
- const logs = await mcp__playwright__browser_console_messages();
362
-
363
- // 14. Get network requests
364
- const requests = await mcp__playwright__browser_network_requests();
365
-
366
- // 15. Handle dialog (alert, confirm, prompt)
367
- await mcp__playwright__browser_handle_dialog({ accept: true });
368
-
369
- // 16. Resize viewport
370
- await mcp__playwright__browser_resize({ width: 375, height: 812 }); // iPhone viewport
371
-
372
- // 17. Save page as PDF (requires --caps pdf)
373
- await mcp__playwright__browser_pdf_save();
374
-
375
- // 18. Upload file
376
- await mcp__playwright__browser_file_upload({ ref: "s1e20", paths: ["/path/to/file.png"] });
377
- ```
378
-
379
- **Use cases by phase:**
380
-
381
- | Phase | Use Case | Tool |
382
- |-------|----------|------|
383
- | UI/UX (2) | Screenshot reference pages for design | `browser_navigate` + `browser_take_screenshot` |
384
- | UI/UX (2) | Inspect existing app structure | `browser_navigate` + `browser_snapshot` |
385
- | UI/UX (2) | Test responsive layouts | `browser_resize` + `browser_take_screenshot` |
386
- | Clarify (4) | Verify existing UI behavior | `browser_navigate` + `browser_snapshot` |
387
- | Implement (7) | Smoke test deployed features | `browser_navigate` + `browser_click` + `browser_snapshot` |
388
- | Implement (7) | Verify form flows end-to-end | `browser_fill_form` + `browser_click` + `browser_snapshot` |
389
- | Implement (7) | Check console errors after deploy | `browser_navigate` + `browser_console_messages` |
390
- | Implement (7) | Screenshot for recap.md | `browser_take_screenshot` |
391
-
392
- ---
393
-
394
- ### Neon: Full Schema Discovery (via neonctl + psql)
395
-
396
- > **Primary:** Neon CLI (`neonctl`) + psql connecting to Neon database.
397
- > **Connection:** Always use `neonctl connection-string` to get the DB URL.
398
-
399
- ```bash
400
- # Complete workflow for Phase 3 schema analysis
401
-
402
- # 1. Get Neon DB URL
403
- neonctl connection-string # → pooled connection string
404
-
405
- # 2. List all tables
406
- pg_dump $(neonctl connection-string) --schema-only --schema public 2>/dev/null | grep "CREATE TABLE"
407
-
408
- # 3. For each relevant table:
409
- psql $(neonctl connection-string) -c "SELECT column_name, data_type, is_nullable, column_default \
410
- FROM information_schema.columns WHERE table_name = 'TABLE_NAME' ORDER BY ordinal_position"
411
-
412
- # 4. Get relationships
413
- psql $(neonctl connection-string) -c "SELECT tc.table_name, kcu.column_name, ccu.table_name AS foreign_table \
414
- FROM information_schema.table_constraints tc \
415
- JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name \
416
- JOIN information_schema.constraint_column_usage ccu ON tc.constraint_name = ccu.constraint_name \
417
- WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = 'TABLE_NAME'"
418
-
419
- # → Write findings to schema-analysis.md
420
- ```
421
-
422
- ### Context7: Library Research
423
-
424
- ```javascript
425
- // Workflow for any phase needing library documentation
426
- // Step 1: Resolve library ID
427
- const lib = await mcp__context7__resolve_library_id({
428
- libraryName: "fluent-ui-blazor",
429
- query: "dialog component with form validation"
430
- });
431
-
432
- // Step 2: Query specific documentation
433
- const docs = await mcp__context7__query_docs({
434
- libraryId: lib.id,
435
- query: "FluentDialog component usage with EditForm validation"
436
- });
437
- ```
438
-
439
- ### GitHub: Code Search Across Repo
440
-
441
- > **v4 config:** Docker — `{ "command": "docker", "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"] }`. Requires Docker Desktop.
442
-
443
- ```javascript
444
- // Find patterns in large codebase during Phase 2
445
- const results = await mcp__github__search_code({
446
- query: "DbSet leads repo:myorg/myrepo",
447
- });
448
- // → Find all places that query the leads table
449
- ```
450
-
451
- ---
452
-
453
- ## Security Considerations
454
-
455
- - **Never pass secrets** in MCP tool parameters (API keys, tokens, passwords)
456
- - **Neon** uses neonctl/psql — use database branches for development, not production
457
- - **GitHub MCP** inherits the configured token's permissions
458
- - **Always validate tool responses** before using in contracts or code generation
459
-
460
- ---
461
-
462
- *MORPH-SPEC by Polymorphism Tech*
1
+ # Integration Standard: MCP Tools in MORPH Workflows
2
+
3
+ > **Scope:** integration-mcp
4
+ > **Layer:** 2
5
+ > **Keywords:** mcp, model-context-protocol, mcp-tools, context7, playwright, mcp-client
6
+ > **Load When:** an MCP tool is used in any morph-spec phase
7
+
8
+ **Verified against:** Claude Code MCP tooling — context7, Playwright, GitHub, Neon CLI. Last-verified: 2026-05-20.
9
+
10
+ ---
11
+
12
+ Reference for using Model Context Protocol (MCP) tools across morph-spec phases. Each phase benefits from different MCPs depending on what data is needed.
13
+
14
+ ## MCP Availability Detection
15
+
16
+ Before using any MCP tool, check if it's available in the current session:
17
+
18
+ ```javascript
19
+ // Pattern: Attempt the call — if the tool doesn't exist, Claude Code will report it
20
+ // There is no "list MCPs" command; just try the most common operation
21
+
22
+ // GitHub MCP
23
+ await mcp__github__get_repo();
24
+
25
+ // Context7 (library docs)
26
+ await mcp__context7__resolve_library_id({ libraryName: "react" });
27
+
28
+ // Playwright (browser automation)
29
+ await mcp__playwright__browser_navigate({ url: "https://example.com" });
30
+
31
+ // Neon — use `neonctl` CLI + `psql`
32
+ // neonctl connection-string → get DB URL
33
+ // psql <DB_URL> -c "SELECT ..."
34
+ ```
35
+
36
+ **Fallback rule:** If an MCP is not available, every phase has a manual alternative using Claude Code native tools (Read, Grep, Glob, Bash).
37
+
38
+ ---
39
+
40
+ ## MCP Providers by Phase
41
+
42
+ ### Phase 1 (Setup) — Project Discovery
43
+
44
+ | MCP | Use Case | Example |
45
+ |-----|----------|---------|
46
+ | **GitHub** | Repo info, recent PRs, issues | `mcp__github__get_repo()` |
47
+ | **Filesystem** | Scan project structure | Native Glob/Read preferred |
48
+
49
+ ```javascript
50
+ // Detect project type from repo metadata
51
+ const repo = await mcp__github__get_repo();
52
+ // → language, default_branch, topics
53
+
54
+ // Fallback: use Glob to detect stack
55
+ // Glob: "**/{package.json,*.csproj,*.sln,go.mod,Cargo.toml}"
56
+ ```
57
+
58
+ ### Phase 2 (UI/UX) — Design References
59
+
60
+ | MCP | Use Case | Example |
61
+ |-----|----------|---------|
62
+ | **Playwright** | Navigate, screenshot, inspect live pages | `mcp__playwright__browser_navigate({ url })` |
63
+ | **Context7** | Component library documentation | `mcp__context7__query_docs({ libraryId, query })` |
64
+
65
+ ```javascript
66
+ // Screenshot existing app for design reference
67
+ await mcp__playwright__browser_navigate({ url: "https://app.example.com/dashboard" });
68
+ const screenshot = await mcp__playwright__browser_take_screenshot();
69
+ // → Visual reference for UI/UX design
70
+
71
+ // Inspect page structure via accessibility tree
72
+ const snapshot = await mcp__playwright__browser_snapshot();
73
+ // → Structured element tree (headings, buttons, inputs, etc.)
74
+
75
+ // Test responsive layout
76
+ await mcp__playwright__browser_resize({ width: 375, height: 812 });
77
+ const mobileScreenshot = await mcp__playwright__browser_take_screenshot();
78
+
79
+ // Get MudBlazor component docs for UI specs
80
+ const libId = await mcp__context7__resolve_library_id({
81
+ libraryName: "mudblazor",
82
+ query: "data grid with sorting and filtering"
83
+ });
84
+ const docs = await mcp__context7__query_docs({
85
+ libraryId: libId,
86
+ query: "DataGrid component props and events"
87
+ });
88
+
89
+ // Fallback: WebSearch for component documentation
90
+ // WebFetch for specific component API pages
91
+ ```
92
+
93
+ ### Gemini Image MCP — AI Image Generation
94
+
95
+ > Available in: **UI/UX** (preview generation), **Implement** (production assets)
96
+
97
+ | Tool | Use Case | Example |
98
+ |------|----------|---------|
99
+ | `generate_image` | Create new image from text prompt | `mcp__gemini-image-mcp__generate_image({ prompt, aspectRatio, outputPath })` |
100
+ | `edit_image` | Modify existing image | `mcp__gemini-image-mcp__edit_image({ imageSource, prompt })` |
101
+ | `continue_editing` | Iterate on last generated/edited image | `mcp__gemini-image-mcp__continue_editing({ prompt })` |
102
+ | `list_images` | Browse image generation history | `mcp__gemini-image-mcp__list_images({ type: "all" })` |
103
+ | `get_image_info` | Get metadata about a specific image | `mcp__gemini-image-mcp__get_image_info({ imageId })` |
104
+
105
+ ```javascript
106
+ // Generate a hero image using design system tokens
107
+ // Read design-system.md first to get project colors and aesthetic direction
108
+ const image = await mcp__gemini_image_mcp__generate_image({
109
+ prompt: "A floating tablet showing a modern dashboard interface on a dark charcoal background with copper and gold accent lighting. Premium luxury aesthetic, photorealistic, cinematic lighting with warm rim light.",
110
+ aspectRatio: "16:9",
111
+ outputPath: "public/images/my-feature/hero-mockup.png"
112
+ });
113
+
114
+ // Edit an existing image (keep edits short and targeted)
115
+ await mcp__gemini_image_mcp__edit_image({
116
+ imageSource: "public/images/my-feature/hero-mockup.png",
117
+ prompt: "Make the lighting warmer and add a subtle copper glow around the tablet edges."
118
+ });
119
+
120
+ // Iterate with continue_editing (one change at a time)
121
+ await mcp__gemini_image_mcp__continue_editing({
122
+ prompt: "More contrast in the shadows."
123
+ });
124
+
125
+ // Fallback: Manual image creation, stock photos, or placeholder divs
126
+ ```
127
+
128
+ **Use cases by phase:**
129
+
130
+ | Phase | Use Case | Tool |
131
+ |-------|----------|------|
132
+ | UI/UX (2) | Generate preview images for design approval | `generate_image` |
133
+ | Implement (7) | Generate production assets from assets.md specs | `generate_image` + `edit_image` |
134
+ | Implement (7) | Iterate on generated images for quality | `continue_editing` |
135
+
136
+ > **Standard:** See `frontend/design-system/ai-image-generation.md` for prompt engineering patterns, aspect ratio guide, and `assets.md` format.
137
+
138
+ ---
139
+
140
+ ### Phase 3 (Design) — Schema & Architecture
141
+
142
+ | Tool | Use Case | Example |
143
+ |------|----------|---------|
144
+ | **Neon CLI (`neonctl`) / psql** | Database schema, tables, relationships, RLS | `psql <DB_URL> -c "SELECT ..."` |
145
+ | **Context7** | Library docs for architecture decisions | `mcp__context7__query_docs()` |
146
+ | **GitHub** | Check existing code patterns, PRs | `mcp__github__search_code()` |
147
+
148
+ ```bash
149
+ # === SCHEMA ANALYSIS (Critical for contracts.cs) ===
150
+
151
+ # 0. Get Neon DB connection string
152
+ neonctl connection-string
153
+ # → e.g.: postgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/neondb?sslmode=require
154
+
155
+ # 1. List all tables
156
+ pg_dump $(neonctl connection-string) --schema-only --schema public 2>/dev/null | grep "CREATE TABLE"
157
+
158
+ # 2. Get schema for each relevant table
159
+ psql $(neonctl connection-string) -c "SELECT column_name, data_type, is_nullable, column_default \
160
+ FROM information_schema.columns WHERE table_name = 'leads' ORDER BY ordinal_position"
161
+
162
+ # 3. Get foreign key relationships
163
+ psql $(neonctl connection-string) -c "SELECT tc.table_name, kcu.column_name, ccu.table_name AS foreign_table, \
164
+ ccu.column_name AS foreign_column FROM information_schema.table_constraints tc \
165
+ JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name \
166
+ JOIN information_schema.constraint_column_usage ccu ON tc.constraint_name = ccu.constraint_name \
167
+ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = 'leads'"
168
+
169
+ # 4. Check RLS policies (security-critical)
170
+ psql $(neonctl connection-string) -c "SELECT tablename, policyname, cmd, qual FROM pg_policies WHERE tablename = 'leads'"
171
+ ```
172
+
173
+ **Fallback (Neon database not accessible):**
174
+ ```
175
+ 1. Grep: "\.from\(|\.select\(|SELECT |DbSet<" → find query files
176
+ 2. Read each query file → extract table/column names
177
+ 3. Glob: "src/**/types/**/*.ts" or "**/Entities/**/*.cs" → find type definitions
178
+ 4. Read type files → map properties to database columns
179
+ ```
180
+
181
+ ### Phase 4 (Clarify) — Validation & Research
182
+
183
+ | MCP | Use Case | Example |
184
+ |-----|----------|---------|
185
+ | **Context7** | Verify library capabilities, API limits | `mcp__context7__query_docs()` |
186
+ | **GitHub** | Check issue discussions, known limitations | `mcp__github__search_issues()` |
187
+
188
+ ```javascript
189
+ // Verify if library supports a required feature
190
+ const docs = await mcp__context7__query_docs({
191
+ libraryId: "/mudblazor/mudblazor",
192
+ query: "DataGrid server-side pagination with virtual scrolling"
193
+ });
194
+ // → Confirms capability or identifies limitation for spec update
195
+
196
+ // Fallback: WebSearch for library capabilities
197
+ ```
198
+
199
+ ### Phase 6 (Tasks) — Planning & Organization
200
+
201
+ | MCP | Use Case | Example |
202
+ |-----|----------|---------|
203
+ | **GitHub** | Create issues from tasks, link to milestone | `mcp__github__create_issue()` |
204
+ | **Context7** | Estimate complexity based on library docs | `mcp__context7__query_docs()` |
205
+
206
+ ```javascript
207
+ // Create GitHub issues from tasks.json (if team uses GitHub Projects)
208
+ for (const task of tasks) {
209
+ await mcp__github__create_issue({
210
+ title: task.title,
211
+ body: task.description,
212
+ labels: [task.category],
213
+ milestone: featureMilestone
214
+ });
215
+ }
216
+
217
+ // Fallback: Bash with gh CLI
218
+ // gh issue create --title "T001: Create Entity Lead" --label "domain"
219
+ ```
220
+
221
+ ### Phase 7 (Implement) — Build & Deploy
222
+
223
+ | Tool | Use Case | Example |
224
+ |------|----------|---------|
225
+ | **Neon CLI (`neonctl`) / psql** | Run migrations, create RLS policies | `dotnet ef database update` |
226
+ | **GitHub** | Create PR, push branches | `mcp__github__create_pull_request()` |
227
+ | **Context7** | Look up API usage during coding | `mcp__context7__query_docs()` |
228
+ | **Playwright** | Smoke test deployed features, verify UI | `mcp__playwright__browser_navigate()` |
229
+ | **Vercel** | Deploy, check logs, manage env vars | `mcp__vercel__list_projects()` |
230
+ | **Azure CLI** | Resource management, deployments | `az` commands |
231
+ | **Docker CLI** | Build, run, compose, logs (local) | `docker` commands |
232
+
233
+ ```bash
234
+ # === NEON (Migrations & RLS via EF Core) ===
235
+
236
+ # Create migration
237
+ dotnet ef migrations add AddStatusToLeads
238
+
239
+ # Apply migration to Neon database
240
+ dotnet ef database update
241
+
242
+ # Verify schema after migration
243
+ psql $(neonctl connection-string) -c "SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'leads'"
244
+
245
+ # Verify RLS policies
246
+ psql $(neonctl connection-string) -c "SELECT policyname, cmd, qual FROM pg_policies WHERE tablename = 'leads'"
247
+ ```
248
+
249
+ ```javascript
250
+ // Lookup API during implementation
251
+ const docs = await mcp__context7__query_docs({
252
+ libraryId: "/dotnet/efcore",
253
+ query: "owned entity types configuration"
254
+ });
255
+
256
+ // Smoke test deployed feature via browser
257
+ await mcp__playwright__browser_navigate({ url: "https://localhost:5001/leads" });
258
+ const snapshot = await mcp__playwright__browser_snapshot();
259
+ // → Verify page renders correctly, check for errors
260
+
261
+ // Check for console errors after deploy
262
+ const logs = await mcp__playwright__browser_console_messages();
263
+ // → Catch JavaScript errors, failed API calls
264
+
265
+ // Screenshot for recap.md documentation
266
+ const screenshot = await mcp__playwright__browser_take_screenshot();
267
+
268
+ // === VERCEL (Deployment & Environment) ===
269
+
270
+ // List projects
271
+ const projects = await mcp__vercel__list_projects();
272
+
273
+ // Check deployment status and logs
274
+ const deployments = await mcp__vercel__get_deployments({ projectId: 'my-project' });
275
+ const logs = await mcp__vercel__get_deployment_logs({ deploymentId: deployments[0].uid });
276
+
277
+ // Manage environment variables
278
+ await mcp__vercel__manage_env_vars({
279
+ projectId: 'my-project',
280
+ action: 'set',
281
+ key: 'DATABASE_URL',
282
+ value: process.env.DATABASE_URL,
283
+ target: ['production', 'preview']
284
+ });
285
+
286
+ // Fallback: Bash for gh CLI for PRs, vercel CLI for deployments
287
+ ```
288
+
289
+ ---
290
+
291
+ ## MCP vs Native Tools Decision
292
+
293
+ | Need | MCP Tool | Native Alternative |
294
+ |------|----------|--------------------|
295
+ | Database schema | Neon CLI (`neonctl`) / psql | Grep queries + Read types |
296
+ | Repo metadata | GitHub MCP | Bash `gh` CLI |
297
+ | Library docs | Context7 | WebSearch + WebFetch |
298
+ | Live page preview | Playwright MCP | WebFetch URL |
299
+ | Page interaction (click, type, navigate) | Playwright MCP | Manual testing |
300
+ | Responsive layout testing | Playwright MCP (`browser_resize`) | Manual testing |
301
+ | Console error checking | Playwright MCP (`browser_console_messages`) | Browser DevTools |
302
+ | Container ops | Docker CLI (`docker ps`, `docker logs`, `docker compose`) | — |
303
+ | Cloud resources | Azure CLI (`az resource`, `az deployment`) | — |
304
+ | Vercel deployments | Vercel MCP | Bash `vercel` CLI |
305
+ | AI image generation | Gemini Image MCP | Manual creation or stock photos |
306
+
307
+ **Rule:** MCP tools provide structured data (JSON responses). Native tools require manual parsing. **Always prefer MCP when available** — fall back to native when not. **Exceptions:** Neon, Docker, and Azure always use their respective CLIs directly — never MCP.
308
+
309
+ ---
310
+
311
+ ## Common MCP Patterns
312
+
313
+ ### Browser (Playwright): Page Automation & Analysis
314
+
315
+ ```javascript
316
+ // === SETUP ===
317
+ // Playwright MCP: npx @playwright/mcp@latest
318
+ // Config in .claude/settings.json or claude_desktop_config.json:
319
+ // { "mcpServers": { "playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] } } }
320
+
321
+ // === NAVIGATION & SNAPSHOT ===
322
+
323
+ // 1. Navigate to a page
324
+ await mcp__playwright__browser_navigate({ url: "https://app.example.com/dashboard" });
325
+
326
+ // 2. Take accessibility snapshot (preferred — structured, LLM-friendly)
327
+ const snapshot = await mcp__playwright__browser_snapshot();
328
+ // → Returns accessibility tree with element refs for interaction
329
+
330
+ // 3. Take visual screenshot (requires --caps vision)
331
+ const screenshot = await mcp__playwright__browser_take_screenshot();
332
+ // → Returns PNG image of current page
333
+
334
+ // === INTERACTION ===
335
+
336
+ // 4. Click an element (use ref from snapshot)
337
+ await mcp__playwright__browser_click({ element: "Submit button", ref: "s1e15" });
338
+
339
+ // 5. Type into an input field
340
+ await mcp__playwright__browser_type({ element: "Search input", ref: "s1e8", text: "query" });
341
+
342
+ // 6. Fill a form field (replaces existing value)
343
+ await mcp__playwright__browser_fill_form({ ref: "s1e8", value: "new value" });
344
+
345
+ // 7. Select dropdown option
346
+ await mcp__playwright__browser_select_option({ element: "Status", ref: "s1e12", values: ["active"] });
347
+
348
+ // 8. Press keyboard key
349
+ await mcp__playwright__browser_press_key({ key: "Enter" });
350
+
351
+ // === TABS & NAVIGATION ===
352
+
353
+ // 9. List open tabs
354
+ const tabs = await mcp__playwright__browser_tabs();
355
+
356
+ // 10. Navigate back
357
+ await mcp__playwright__browser_navigate_back();
358
+
359
+ // 11. Close current tab
360
+ await mcp__playwright__browser_close();
361
+
362
+ // === ADVANCED ===
363
+
364
+ // 12. Evaluate JavaScript in page context
365
+ const result = await mcp__playwright__browser_evaluate({
366
+ expression: "document.querySelectorAll('.error').length"
367
+ });
368
+
369
+ // 13. Get console messages (debug)
370
+ const logs = await mcp__playwright__browser_console_messages();
371
+
372
+ // 14. Get network requests
373
+ const requests = await mcp__playwright__browser_network_requests();
374
+
375
+ // 15. Handle dialog (alert, confirm, prompt)
376
+ await mcp__playwright__browser_handle_dialog({ accept: true });
377
+
378
+ // 16. Resize viewport
379
+ await mcp__playwright__browser_resize({ width: 375, height: 812 }); // iPhone viewport
380
+
381
+ // 17. Save page as PDF (requires --caps pdf)
382
+ await mcp__playwright__browser_pdf_save();
383
+
384
+ // 18. Upload file
385
+ await mcp__playwright__browser_file_upload({ ref: "s1e20", paths: ["/path/to/file.png"] });
386
+ ```
387
+
388
+ **Use cases by phase:**
389
+
390
+ | Phase | Use Case | Tool |
391
+ |-------|----------|------|
392
+ | UI/UX (2) | Screenshot reference pages for design | `browser_navigate` + `browser_take_screenshot` |
393
+ | UI/UX (2) | Inspect existing app structure | `browser_navigate` + `browser_snapshot` |
394
+ | UI/UX (2) | Test responsive layouts | `browser_resize` + `browser_take_screenshot` |
395
+ | Clarify (4) | Verify existing UI behavior | `browser_navigate` + `browser_snapshot` |
396
+ | Implement (7) | Smoke test deployed features | `browser_navigate` + `browser_click` + `browser_snapshot` |
397
+ | Implement (7) | Verify form flows end-to-end | `browser_fill_form` + `browser_click` + `browser_snapshot` |
398
+ | Implement (7) | Check console errors after deploy | `browser_navigate` + `browser_console_messages` |
399
+ | Implement (7) | Screenshot for recap.md | `browser_take_screenshot` |
400
+
401
+ ---
402
+
403
+ ### Neon: Full Schema Discovery (via neonctl + psql)
404
+
405
+ > **Primary:** Neon CLI (`neonctl`) + psql connecting to Neon database.
406
+ > **Connection:** Always use `neonctl connection-string` to get the DB URL.
407
+
408
+ ```bash
409
+ # Complete workflow for Phase 3 schema analysis
410
+
411
+ # 1. Get Neon DB URL
412
+ neonctl connection-string # → pooled connection string
413
+
414
+ # 2. List all tables
415
+ pg_dump $(neonctl connection-string) --schema-only --schema public 2>/dev/null | grep "CREATE TABLE"
416
+
417
+ # 3. For each relevant table:
418
+ psql $(neonctl connection-string) -c "SELECT column_name, data_type, is_nullable, column_default \
419
+ FROM information_schema.columns WHERE table_name = 'TABLE_NAME' ORDER BY ordinal_position"
420
+
421
+ # 4. Get relationships
422
+ psql $(neonctl connection-string) -c "SELECT tc.table_name, kcu.column_name, ccu.table_name AS foreign_table \
423
+ FROM information_schema.table_constraints tc \
424
+ JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name \
425
+ JOIN information_schema.constraint_column_usage ccu ON tc.constraint_name = ccu.constraint_name \
426
+ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = 'TABLE_NAME'"
427
+
428
+ # → Write findings to schema-analysis.md
429
+ ```
430
+
431
+ ### Context7: Library Research
432
+
433
+ ```javascript
434
+ // Workflow for any phase needing library documentation
435
+ // Step 1: Resolve library ID
436
+ const lib = await mcp__context7__resolve_library_id({
437
+ libraryName: "fluent-ui-blazor",
438
+ query: "dialog component with form validation"
439
+ });
440
+
441
+ // Step 2: Query specific documentation
442
+ const docs = await mcp__context7__query_docs({
443
+ libraryId: lib.id,
444
+ query: "FluentDialog component usage with EditForm validation"
445
+ });
446
+ ```
447
+
448
+ ### GitHub: Code Search Across Repo
449
+
450
+ > **v4 config:** Docker — `{ "command": "docker", "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"] }`. Requires Docker Desktop.
451
+
452
+ ```javascript
453
+ // Find patterns in large codebase during Phase 2
454
+ const results = await mcp__github__search_code({
455
+ query: "DbSet leads repo:myorg/myrepo",
456
+ });
457
+ // → Find all places that query the leads table
458
+ ```
459
+
460
+ ---
461
+
462
+ ## Security Considerations
463
+
464
+ - **Never pass secrets** in MCP tool parameters (API keys, tokens, passwords)
465
+ - **Neon** uses neonctl/psql — use database branches for development, not production
466
+ - **GitHub MCP** inherits the configured token's permissions
467
+ - **Always validate tool responses** before using in contracts or code generation
468
+
469
+ ---
470
+
471
+ *MORPH-SPEC by Polymorphism Tech*