---
title: DYPAI Agent Setup — Build From Outside
description: How a coding agent connects to DYPAI and builds a full-stack app from your IDE, without opening the dashboard.
canonical: https://www.dypai.ai/agents.md
overview_url: https://www.dypai.ai/index.md
updated: 2026-07-08
---

# DYPAI — Build From Outside

This is the operational guide for coding agents. You do **not** need to open the DYPAI dashboard to build. Your agent operates the platform from your IDE through MCP.

For a product overview, read [index.md](https://www.dypai.ai/index.md).

## The idea

Traditional BaaS platforms expect a human to click through a dashboard to create tables, wire endpoints, and deploy. DYPAI is different: a coding agent in your IDE does all of that through MCP tools — create project, write backend flows, manage database, deploy frontend — while you stay in your editor.

```
Your IDE (Cursor / Claude Code / Codex / …)
    ↓  MCP
mcp.dypai.dev
    ↓
DYPAI runtime (Postgres, auth, storage, workflows, hosting)
```

## 1. Connect (one command)

From your project directory or a fresh folder:

```bash
npx -y @dypai-ai/install
```

What this does:
- Authenticates you (browser OAuth, or pass `--token` for headless)
- Registers the DYPAI MCP server in your IDE config
- Saves agent instructions as `AGENTS.md` in your project

**Non-interactive** (when an agent runs the installer — no TTY):

```bash
npx -y @dypai-ai/install --client cursor
# or: claude-code, codex, copilot, windsurf, cline, trae, kiro, antigravity, …
```

**Headless with token** (CI / automation):

```bash
npx -y @dypai-ai/install --client cursor --token dypai_mcp_xxx
```

Supported IDEs: Cursor, Claude Code, Codex, Copilot, Windsurf, Cline, Roo Code, Trae, Kiro, Antigravity, Qoder, Kimi, OpenCode.

## 2. Verify MCP is connected

After install, your agent session should see DYPAI MCP tools (e.g. `list_projects`, `create_project`, `execute_sql`, `manage_storage`, `search_flow_templates`).

The MCP server also sends platform instructions on `initialize` — read them. They include the flow-first authoring rules, publish/deploy asymmetry, and common mistakes.

**Local development**: if you run `dypai-mcp-local`, prefer it over the cloud MCP directly — it adds `dypai_pull`, `dypai_push`, `dypai_validate`, `manage_drafts`, and `manage_frontend` for full git-sync workflow.

## 3. Create or select a project

From your agent:

1. `list_projects` → reuse an existing project when continuing work
2. `create_project(name: "...")` → new project with default Studio shell
3. Pass `project_id` to every subsequent call if no project-scoped token is set

You never need to visit dypai.ai to create a project.

## 4. Materialize backend locally

```
dypai_pull
```

This downloads the `dypai/` folder to your local repo:
- `dypai/flows/*.flow.ts` — backend workflows (HTTP endpoints, webhooks, cron)
- `dypai/capability-catalog.json`, `dypai/node-catalog.json` — available nodes and capabilities
- `dypai/types/endpoints.gen.ts` — generated TypeScript types for endpoints

Read the on-disk catalogs after pull. Do not search removed MCP catalog tools.

## 5. Build backend (flows)

Edit `dypai/flows/*.flow.ts`. Example trigger types:

- `trigger.http_api { auth_mode: jwt|api_key|public }` — HTTP endpoint
- `trigger.webhook` — inbound webhook
- `trigger.schedule` — cron job
- `trigger.telegram` — Telegram bot

Workflow:

```
# edit dypai/flows/*.flow.ts
dypai_validate          # lint + compile check
dypai_push              # save draft + regenerate endpoint types
manage_drafts(operation:'publish', confirm:true)   # ship to production
```

**Rules:**
- Auth is built-in — never create login/signup endpoints
- Use `@dypai-ai/client-sdk` in frontend, never raw `fetch()`
- `${current_user_id}` is TEXT — never cast to `::uuid` on app tables
- `user_id` columns must be TEXT (better-auth nanoid), not UUID
- Search `search_flow_templates` for tested patterns before inventing from scratch

## 6. Build frontend

Edit `src/` (React/Vite/Next). The SDK is pre-configured at `src/lib/dypai.ts`.

```typescript
import { dypai } from './lib/dypai'

// API
const { data, error } = await dypai.api.post('my-endpoint', { ... })

// Auth (built-in — do not create auth endpoints)
await dypai.auth.signInWithPassword({ email, password })

// Realtime
useRealtime('my_table', { onInsert, onUpdate, onDelete })
```

Deploy:

```
manage_frontend(operation:'deploy', target:'both', confirm:true)
```

Or via CLI:

```bash
npx @dypai-ai/cli deploy
```

**Order matters**: publish backend FIRST, then deploy frontend.

## 7. What your agent can do without the dashboard

| Task | MCP tool / action |
|------|-------------------|
| List/create projects | `list_projects`, `create_project` |
| Inspect database | `get_app_tables`, `execute_sql` |
| Manage storage | `manage_storage` |
| Search flow templates | `search_flow_templates` |
| Search platform docs | `search_docs` |
| Pull/push backend | `dypai_pull`, `dypai_push` (local MCP) |
| Validate before push | `dypai_validate` (local MCP) |
| Publish backend | `manage_drafts(publish)` (local MCP) |
| Deploy frontend | `manage_frontend(deploy)` (local MCP) |
| Manage automations | `manage_automations` |
| Manage credentials | `manage_credentials` |

## SDK reference

Read [/.well-known/skills/dypai-sdk/SKILL.md](https://www.dypai.ai/.well-known/skills/dypai-sdk/SKILL.md) for auth modes, endpoint patterns, upload flows, and gotchas.

## Common mistakes

- Calling `fetch()` instead of the SDK
- Creating custom auth endpoints (auth is built-in)
- Pushing without `dypai_validate`
- Deploying frontend before publishing backend
- Using `user_id UUID` in schema (must be TEXT)
- Searching removed MCP catalog tools instead of on-disk files after `dypai_pull`
- Opening the dashboard when MCP can do the same operation

## Resources

- [Product overview](https://www.dypai.ai/index.md)
- [MCP server](https://mcp.dypai.dev)
- [Install CLI](https://www.npmjs.com/package/@dypai-ai/install)
- [Client SDK](https://www.npmjs.com/package/@dypai-ai/client-sdk)
- [Developer landing (human UI)](https://www.dypai.ai/desarrolladores)
