@dypai-ai/mcp 1.5.14 → 1.5.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dypai-ai/mcp",
3
- "version": "1.5.14",
3
+ "version": "1.5.16",
4
4
  "description": "DYPAI MCP Server — AI agent toolkit for building and deploying full-stack apps",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
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` drops in a ready-made schema + endpoints + UI that cover 70% of common app types. Use built-in bases when appropriate: `private-admin` for private internal tools, `user-accounts` for apps with signup/login users, `landing-admin` for public landing plus admin, and `blank` only when no base 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. Project template slug to start from (e.g. 'clinic', 'gym', 'private-admin', 'user-accounts', 'landing-admin', 'blank'). Always call search_project_templates first to find the best match." }, 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"] } },
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. Use only slugs returned by search_project_templates; do not invent legacy template slugs.", 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 only visible Studio catalog slugs." }, 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 starter templates by description. Returns template metadata and slugs for marketplace templates plus built-in bases: private-admin, user-accounts, landing-admin, and blank.", inputSchema: { type: "object", properties: { query: { type: "string", description: "What kind of project starter you need (e.g. 'gym app', 'private admin dashboard', 'user accounts portal', 'landing plus admin')" }, category: { type: "string", description: "Optional category filter" } }, required: ["query"] } },
499
+ { name: "search_project_templates", description: "Search visible DYPAI Studio project templates by description. Returns only the Studio catalog plus compact template briefs and selection_guidance: recommended_slug, confidence, fallback_slug, and agent_rule.", 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
- - *"Te propongo Next.js + TypeScript + Tailwind + Prisma + SQLite..."*
515
- - *"Podrías usar Supabase / Firebase / MongoDB / Vercel..."*
516
- - *"¿Qué base de datos prefieres, PostgreSQL o SQLite?"*
517
- - *"¿Prefieres Tailwind o CSS Modules?"*
518
- - Asking "which framework" unless the user explicitly says *"I want to compare platforms"* or *"what are my options"*.
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,20 +524,19 @@ 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. Templates cover common app types (gym, clinic, waitlist, saas dashboard, etc.).
528
- 3. **Decide: marketplace template, built-in base, or blank.** Marketplace templates are only right when the match is OBVIOUS and STRONG:
529
- - User says *"app para mi gimnasio"* + there's \`gym-manager\` (exact domain + feature overlap) template.
530
- - User says *"algo para gestionar reservas"* + there's \`gym-manager\` (soft match, many interpretations) → use a built-in base or **blank**. Don't assume they want the gym's specific schema (classes, memberships, check-ins) — they didn't ask for it.
531
- - Built-in bases are safe defaults:
532
- - private/internal/admin/dashboard/backoffice/business management \`private-admin\`
533
- - end-user signup/login/customer/member portal/marketplace/SaaS accounts \`user-accounts\`
534
- - public landing/marketing site plus private admin \`landing-admin\`
535
- - no clear access pattern or explicitly custom/from scratch \`blank\`
536
- - User is a dev with a concrete spec (*"crea un proyecto con estas 3 tablas y estos endpoints"*) usually **blank**, unless they explicitly want one of the built-in bases.
537
- - No marketplace or built-in base fits **blank**.
538
- 4. **Call it** \`create_project(name: "<their name>", template_slug: "<matched_slug>" | "private-admin" | "user-accounts" | "landing-admin" | "blank")\`.
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?"*
540
- If you went blank, just say: *"Arranco un proyecto en blanco y lo construimos a medida."*
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 from the returned Studio catalog templates only.** 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 \`fallback_slug\` from the Studio catalog guidance. Don't inherit domain-specific schema they did not ask for.
536
+ - Concrete spec: user is a dev with a concrete spec (*"crea un proyecto con estas 3 tablas y estos endpoints"*). Use the simplest returned Studio base unless a template exactly matches the requested product.
537
+ 4. **Call it** \`create_project(name: "<their name>", template_slug: "<slug from search_project_templates>")\`.
538
+ If you went with a catalog template, use its \`agent_brief\`: preserve \`already_included\`, follow \`adaptation_steps\`, and do not rebuild \`do_not_rebuild\`.
539
+ Do not invent or use legacy slugs that were not returned by search_project_templates.
541
540
  5. **After \`create_project\`** → ask for an absolute workspace path, then \`dypai_pull\` + \`manage_frontend(sync)\` (see next section).
542
541
 
543
542
  Before designing substantial UI (app shell, dashboard, login, tables/lists,
@@ -556,7 +555,7 @@ target workspace package.json and install them locally (never globally or in
556
555
  the MCP server). Then wire the kit into the app, apply SQL if needed, validate
557
556
  endpoints, and verify the frontend.
558
557
 
559
- **The template system exists to save time when the fit is obvious, not to force-match every request.** When in doubt → blank is always correct. Iterating up from blank is cheaper than deleting 80% of a mismatched template.
558
+ **The template system exists to save time when the fit is obvious, not to force-match every request.** When in doubt → use the safest returned Studio base. Iterating up from a smaller base is cheaper than deleting 80% of a mismatched template.
560
559
 
561
560
  ## The one legit follow-up question
562
561
 
@@ -576,7 +575,7 @@ These (and only these) justify mentioning alternatives:
576
575
 
577
576
  ## If the client isn't web (mobile, desktop, game, extension)
578
577
 
579
- DYPAI builds the **backend** (DB, auth, API, storage, realtime) for any client. If the user asks for a native iOS/Android/desktop app: arranca un \`create_project(template_slug:"blank")\` para el backend y déjale claro que el cliente nativo lo construye él aparte (o le ayudas con el cliente fuera de DYPAI). No propongas "entonces usemos otra plataforma entera" — el backend encaja.
578
+ DYPAI builds the **backend** (DB, auth, API, storage, realtime) for any client. If the user asks for a native iOS/Android/desktop app: use the simplest returned Studio template for the backend and make clear that the native client lives outside DYPAI Studio. Do not propose "then use another whole platform" — the backend fits.
580
579
 
581
580
  For everything else, **the stack is decided. Start building.**
582
581
 
@@ -19,9 +19,8 @@ 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 to find available templates, then pass the template slug here.
23
- Use "private-admin" for private internal tools, "user-accounts" for apps with signup/login users,
24
- "landing-admin" for public landing plus admin, or "blank" only when no base fits.`,
22
+ Use search_project_templates first, then pass the returned template slug here.
23
+ Use only visible Studio catalog template slugs; do not invent legacy slugs.`,
25
24
 
26
25
  inputSchema: {
27
26
  type: "object",
@@ -36,14 +35,14 @@ Use "private-admin" for private internal tools, "user-accounts" for apps with si
36
35
  },
37
36
  template: {
38
37
  type: "string",
39
- description: 'Template slug (e.g. "clinic", "gym", "private-admin", "user-accounts", "landing-admin", "blank"). Use search_project_templates to find available templates.',
40
- default: "blank",
38
+ description: "Template slug returned by search_project_templates.",
39
+ default: "template-blank-mixed",
41
40
  },
42
41
  },
43
42
  required: ["directory", "project_id"],
44
43
  },
45
44
 
46
- async execute({ directory, project_id, template = "blank" }) {
45
+ async execute({ directory, project_id, template = "template-blank-mixed" }) {
47
46
  if (existsSync(join(directory, "package.json"))) {
48
47
  return { error: `Directory already has a package.json. Pick an empty directory or a new name.` }
49
48
  }
@@ -60,7 +59,7 @@ Use "private-admin" for private internal tools, "user-accounts" for apps with si
60
59
  // Try to download template from API
61
60
  let files = []
62
61
  try {
63
- const res = await api.get(`/api/engine/${project_id}/frontend/template?slug=${template}`)
62
+ const res = await api.get(`/api/engine/${project_id}/frontend/template?template=${encodeURIComponent(template)}`)
64
63
  if (res.files) files = res.files
65
64
  } catch {}
66
65
 
@@ -140,7 +139,7 @@ Use "private-admin" for private internal tools, "user-accounts" for apps with si
140
139
  directory,
141
140
  files_created: created,
142
141
  dependencies_installed: installed,
143
- template: template || "blank",
142
+ template: template || "template-blank-mixed",
144
143
  engine_url: engineUrl,
145
144
  sdk_client: "src/lib/dypai.ts",
146
145
  // Critical: dypai_pull without an absolute out_dir can land in $HOME