@dypai-ai/mcp 1.5.14 → 1.5.15
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.
- package/package.json +1 -1
- package/src/index.js +21 -17
- package/src/tools/scaffold.js +5 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -153,7 +153,7 @@ This stores classification metadata only. It does not create users, roles, login
|
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
{ name: "list_ai_models", description: "List only the DYPAI Managed AI models that are active for a project. Returns the project-gated OpenRouter model catalog priced in AI Credits per 1M tokens, RPM limit, max output tokens, active/available counts, billing metadata, and the exact node parameters to use. Call this before creating or editing an AI Agent node with DYPAI Managed models. Agents must not invent or use inactive model ids. Use provider='openrouter' and do NOT set credential_id; DYPAI uses the platform OpenRouter key and deducts usage from the organization's AI Credits.", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "Project UUID whose plan and Model Gateway settings determine the active Managed AI catalog." } }, required: ["project_id"] } },
|
|
156
|
-
{ name: "create_project", description: "Create a new DYPAI project (free plan). Creates a full project with database, engine, GitHub repo, and frontend hosting. BLOCKS by default until provisioning finishes (~60s typical, 120s max) — when it returns, the project_id is ready to use with execute_sql, endpoint tools, etc. Pass wait_until_ready:false for batch flows.\n\nName collision: if another project in the same org already uses the name (case-insensitive), returns {error:'name_taken', existing_project_id, suggestions:[...]}. Pick a different name or use the existing project.\n\nProject limits are enforced by the DYPAI API at organization/workspace scope according to the workspace plan. If it returns {error:'project_limit_reached'}, do not retry create_project; show list_projects for that organization and ask the user to reuse, archive/pause, upgrade the workspace to Pro, or add capacity.\n\nIMPORTANT: before calling, check for a matching template with `search_project_templates`. Passing a `template_slug`
|
|
156
|
+
{ name: "create_project", description: "Create a new DYPAI project (free plan). Creates a full project with database, engine, GitHub repo, and frontend hosting. BLOCKS by default until provisioning finishes (~60s typical, 120s max) — when it returns, the project_id is ready to use with execute_sql, endpoint tools, etc. Pass wait_until_ready:false for batch flows.\n\nName collision: if another project in the same org already uses the name (case-insensitive), returns {error:'name_taken', existing_project_id, suggestions:[...]}. Pick a different name or use the existing project.\n\nProject limits are enforced by the DYPAI API at organization/workspace scope according to the workspace plan. If it returns {error:'project_limit_reached'}, do not retry create_project; show list_projects for that organization and ask the user to reuse, archive/pause, upgrade the workspace to Pro, or add capacity.\n\nIMPORTANT: before calling, check for a matching Studio template with `search_project_templates`. Passing a `template_slug` can drop in ready-made UI, schema, endpoints, and agent instructions. Prefer Studio catalog slugs when the returned brief is a strong fit; legacy fallback bases (`private-admin`, `user-accounts`, `landing-admin`, `blank`) remain available when no catalog template fits.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Project name (e.g. 'My Veterinary App')" }, organization_id: { type: "string", description: "Optional. Uses default org if omitted." }, description: { type: "string" }, template_slug: { type: "string", description: "RECOMMENDED. Template slug returned by search_project_templates. Use Studio catalog slugs when a strong template fits; legacy fallback bases remain supported when no catalog template fits." }, wait_until_ready: { type: "boolean", description: "If true (default), blocks until provisioning completes and the project is ready for all operations. If false, returns immediately with status='provisioning' — caller must poll get_project before using.", default: true } }, required: ["name"] } },
|
|
157
157
|
{ name: "get_app_credentials", description: "Lists available credentials in the current application. Returns API keys, anon key, service role key, and engine URL needed for SDK configuration.", inputSchema: { type: "object", properties: { project_id: { type: "string" } }, required: [] } },
|
|
158
158
|
|
|
159
159
|
// ── Database ──────────────────────────────────────────────────────────────
|
|
@@ -496,7 +496,7 @@ endpoint YAML and \`dypai_push\`. This tool does NOT modify the definition.`,
|
|
|
496
496
|
{ name: "search_docs", description: "Search DYPAI documentation. Use this when unsure about SDK usage, auth patterns, workflow nodes, or platform features. Returns relevant documentation chunks.", inputSchema: { type: "object", properties: { query: { type: "string", description: "What you want to learn about" } }, required: ["query"] } },
|
|
497
497
|
{ name: "search_design_patterns", description: "Search compact DYPAI UI/design recipes. Use before designing substantial screens.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Design need, with starter/domain/screen/style context when known." }, starter_slug: { type: "string", description: "Optional: private-admin, user-accounts, landing-admin, or blank." }, app_type: { type: "string", description: "Optional domain/app type." }, screen_type: { type: "string", description: "Optional screen/workflow." }, visual_style: { type: "string", description: "Optional style." }, category: { type: "string", description: "Optional category." }, limit: { type: "integer", default: 3, minimum: 1, maximum: 4 } }, required: ["query"] } },
|
|
498
498
|
{ name: "search_workflow_templates", description: "Search workflow templates by description. Returns ready-to-use workflow code for common patterns: CRUD operations, payment gateways, email sending, AI chatbots, data pipelines, etc.", inputSchema: { type: "object", properties: { query: { type: "string", description: "What the workflow should do (e.g. 'send email', 'stripe payment')" }, category: { type: "string", description: "Optional: AI, Database, Payments, Communication, Logic, Storage" } }, required: ["query"] } },
|
|
499
|
-
{ name: "search_project_templates", description: "Search project
|
|
499
|
+
{ name: "search_project_templates", description: "Search DYPAI Studio project templates by description. Studio catalog results are the primary source and return compact template briefs plus selection_guidance: recommended_slug, confidence, fallback_slug, and agent_rule. Legacy fallback bases are returned only when no Studio template is a strong fit.", inputSchema: { type: "object", properties: { query: { type: "string", description: "What kind of project starter you need, in the user's language (e.g. 'app para barberia con reservas', 'private admin dashboard', 'landing plus admin')" }, category: { type: "string", description: "Optional category/type filter." }, limit: { type: "integer", default: 5, minimum: 1, maximum: 10 }, include_drafts: { type: "boolean", default: false, description: "Internal/local testing only. Include draft Studio catalog templates." } }, required: ["query"] } },
|
|
500
500
|
]
|
|
501
501
|
|
|
502
502
|
// ── Server Instructions ──────────────────────────────────────────────────────
|
|
@@ -511,11 +511,11 @@ const SERVER_INSTRUCTIONS = `You are building full-stack applications on the DYP
|
|
|
511
511
|
|
|
512
512
|
## What NOT to do
|
|
513
513
|
|
|
514
|
-
-
|
|
515
|
-
-
|
|
516
|
-
-
|
|
517
|
-
-
|
|
518
|
-
-
|
|
514
|
+
- Do not say: *"Te propongo Next.js + TypeScript + Tailwind + Prisma + SQLite..."*
|
|
515
|
+
- Do not say: *"Podrías usar Supabase / Firebase / MongoDB / Vercel..."*
|
|
516
|
+
- Do not ask: *"¿Qué base de datos prefieres, PostgreSQL o SQLite?"*
|
|
517
|
+
- Do not ask: *"¿Prefieres Tailwind o CSS Modules?"*
|
|
518
|
+
- Do not ask "which framework" unless the user explicitly says *"I want to compare platforms"* or *"what are my options"*.
|
|
519
519
|
|
|
520
520
|
These are ALL dead signals: Next.js is already what DYPAI scaffolds. The DB is already PostgreSQL (via DYPAI engine). Auth is built in. Tailwind is already in the templates. Prisma / ORMs are not used — you write SQL directly in workflow endpoints.
|
|
521
521
|
|
|
@@ -524,19 +524,23 @@ These are ALL dead signals: Next.js is already what DYPAI scaffolds. The DB is a
|
|
|
524
524
|
First reflex, always:
|
|
525
525
|
|
|
526
526
|
1. **Acknowledge briefly** what they want to build (one short line, their language).
|
|
527
|
-
2. **\`search_project_templates(query: "<keywords from their request>")\`** — keywords in their language.
|
|
528
|
-
3. **Decide:
|
|
529
|
-
-
|
|
530
|
-
-
|
|
531
|
-
-
|
|
527
|
+
2. **\`search_project_templates(query: "<keywords from their request>")\`** — keywords in their language. The Studio catalog returns compact briefs plus \`selection_guidance\`: recommended slug, confidence, fallback slug, and the rule for deciding.
|
|
528
|
+
3. **Decide: Studio catalog template, legacy base, or blank.** Use \`selection_guidance\` explicitly:
|
|
529
|
+
- confidence "strong": use \`recommended_slug\` if it does not contradict the user's plan.
|
|
530
|
+
- confidence "medium": use it only if the user's answers confirm the same domain/workflow.
|
|
531
|
+
- confidence "weak": do not auto-use it; use \`fallback_slug\`.
|
|
532
|
+
- confidence "fallback": use \`recommended_slug\` unless the app plan clearly requires a different returned slug.
|
|
533
|
+
- Strong fit: user says *"app para barberia con reservas"* and the result includes a booking/barber vertical with matching routes/endpoints. Use that template and preserve what it already has.
|
|
534
|
+
- Strong fit: user asks for a broad business app and a matching vertical template says what to adapt and what not to rebuild. Use the template, then customize it.
|
|
535
|
+
- Weak fit: user says *"algo para gestionar reservas"* and only a very specific unrelated vertical matches softly. Use a safer legacy base or blank. Don't inherit domain-specific schema they did not ask for.
|
|
536
|
+
- Legacy bases are fallback defaults when no Studio catalog template fits:
|
|
532
537
|
- private/internal/admin/dashboard/backoffice/business management → \`private-admin\`
|
|
533
538
|
- end-user signup/login/customer/member portal/marketplace/SaaS accounts → \`user-accounts\`
|
|
534
539
|
- public landing/marketing site plus private admin → \`landing-admin\`
|
|
535
540
|
- no clear access pattern or explicitly custom/from scratch → \`blank\`
|
|
536
|
-
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
If you went with a template, acknowledge in ONE line what's included so the user can push back: *"Lo arranco con la plantilla X, que trae socios, clases y pagos. ¿Te vale o prefieres algo más simple?"*
|
|
541
|
+
- Concrete spec: user is a dev with a concrete spec (*"crea un proyecto con estas 3 tablas y estos endpoints"*). Usually use **blank**, unless a Studio template exactly matches the requested product.
|
|
542
|
+
4. **Call it** → \`create_project(name: "<their name>", template_slug: "<slug from search_project_templates>")\`.
|
|
543
|
+
If you went with a catalog template, use its \`agent_brief\`: preserve \`already_included\`, follow \`adaptation_steps\`, and do not rebuild \`do_not_rebuild\`.
|
|
540
544
|
If you went blank, just say: *"Arranco un proyecto en blanco y lo construimos a medida."*
|
|
541
545
|
5. **After \`create_project\`** → ask for an absolute workspace path, then \`dypai_pull\` + \`manage_frontend(sync)\` (see next section).
|
|
542
546
|
|
|
@@ -556,7 +560,7 @@ target workspace package.json and install them locally (never globally or in
|
|
|
556
560
|
the MCP server). Then wire the kit into the app, apply SQL if needed, validate
|
|
557
561
|
endpoints, and verify the frontend.
|
|
558
562
|
|
|
559
|
-
**The template system exists to save time when the fit is obvious, not to force-match every request.** When in doubt →
|
|
563
|
+
**The template system exists to save time when the fit is obvious, not to force-match every request.** When in doubt → use the safest legacy base or blank. Iterating up from a smaller base is cheaper than deleting 80% of a mismatched template.
|
|
560
564
|
|
|
561
565
|
## The one legit follow-up question
|
|
562
566
|
|
package/src/tools/scaffold.js
CHANGED
|
@@ -19,9 +19,9 @@ Scaffolds a project directory with:
|
|
|
19
19
|
- MCP config for your IDE
|
|
20
20
|
- .env with engine URL
|
|
21
21
|
|
|
22
|
-
Use search_project_templates first
|
|
23
|
-
|
|
24
|
-
"
|
|
22
|
+
Use search_project_templates first, then pass the returned template slug here.
|
|
23
|
+
Prefer Studio catalog template slugs when a strong brief fits. Legacy fallback
|
|
24
|
+
bases ("private-admin", "user-accounts", "landing-admin", "blank") remain available when no catalog template fits.`,
|
|
25
25
|
|
|
26
26
|
inputSchema: {
|
|
27
27
|
type: "object",
|
|
@@ -36,7 +36,7 @@ Use "private-admin" for private internal tools, "user-accounts" for apps with si
|
|
|
36
36
|
},
|
|
37
37
|
template: {
|
|
38
38
|
type: "string",
|
|
39
|
-
description: 'Template slug
|
|
39
|
+
description: 'Template slug returned by search_project_templates. Studio catalog slugs are preferred; legacy fallback bases remain supported.',
|
|
40
40
|
default: "blank",
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -60,7 +60,7 @@ Use "private-admin" for private internal tools, "user-accounts" for apps with si
|
|
|
60
60
|
// Try to download template from API
|
|
61
61
|
let files = []
|
|
62
62
|
try {
|
|
63
|
-
const res = await api.get(`/api/engine/${project_id}/frontend/template?
|
|
63
|
+
const res = await api.get(`/api/engine/${project_id}/frontend/template?template=${encodeURIComponent(template)}`)
|
|
64
64
|
if (res.files) files = res.files
|
|
65
65
|
} catch {}
|
|
66
66
|
|