MoonDB for Windsurf: The Backend for AI-Powered Development

Windsurf by Codeium is an AI-native IDE that writes and refactors code using deep codebase understanding. MoonDB is the backend it can provision in seconds — a declarative JSON schema that becomes a live REST API with auth, storage, and AI endpoints. No server setup. No infrastructure decisions.

The Fast Path: MCP Server (recommended)

Windsurf supports the Model Context Protocol natively. Add MoonDB to your MCP config file and Cascade gets a first-class toolkit for the full project lifecycle — projects (create_project, list_projects, rotate_keys), schema (set_schema, validate_schema, get_schema, seed, get_reference), data (query, get_row, insert, update_row, delete_row), and ai_call — without any prompt-engineering or copy-paste glue. The server's initialize.instructions primer also briefs Cascade on MoonDB's schema conventions up-front, so it doesn't churn through "wrong column type, retrying" cycles.

~/.codeium/windsurf/mcp_config.json
{ "mcpServers": { "moondb": { "serverUrl": "https://moondb.ai/mcp", "headers": { "X-API-Key": "mk_..." } } } }
Replace mk_... with your real platform API key from /dashboard → Account.

After editing the config, refresh Cascade's tool list. Then prompt: "Use moondb to build a recipe sharing backend with users, recipes, favorites."

The Drop-in Path: Prompt File (also works)

Windsurf's Cascade also reads rules files for project-wide context. When you add the MoonDB prompt to your project (via a rules file or inline instructions), Windsurf can:

  1. Create a MoonDB account and project via the API
  2. Design a database schema from your app description
  3. Apply the schema with a single PUT /v1/schema call
  4. Fetch /v1/llm-context for exact API documentation
  5. Generate frontend code that calls the live endpoints

The entire flow happens inside Windsurf. No switching to a dashboard, no terminal commands, no deploy.

Example: Windsurf + MoonDB

windsurf cascade
// Tell Windsurf: "I need a backend for a recipe sharing app. Users can create recipes with ingredients and steps. Other users can save favorites. Use MoonDB." // Windsurf generates the schema: { "tables": { "users": { "auth_table": true, "columns": { "display_name": "string", "avatar": "file" } }, "recipes": { "columns": { "title": "string required", "description": "text", "ingredients": "json required", "steps": "json required", "photo": "file", "user_id": "ref users required" }, "access": { "read": "public", "create": "authenticated", "update": "owner", "delete": "owner" }, "owner_field": "user_id" }, "favorites": { "columns": { "recipe_id": "ref recipes required cascade", "user_id": "ref users required" }, "unique": [["recipe_id", "user_id"]], "owner_field": "user_id" } } }

Why MoonDB Works Well with Windsurf

Windsurf's Cascade operates as a multi-step agent with codebase-wide context — exactly the type of AI workflow MoonDB is built for. Key advantages:

Quick Start: Windsurf + MoonDB

  1. Copy the MoonDB prompt:
  2. Add it to your Windsurf project's AI rules file or paste at the start of a Cascade conversation
  3. Ask Cascade to build your app — it will create the MoonDB project, set the schema, and write frontend code

Compared to Traditional Backends

With a traditional backend (Express + Prisma, Django, Rails), Windsurf would need to generate server code, write migration files, set up auth middleware, configure CORS, and manage deployment. That is dozens of files and potential failure points. With MoonDB, the backend is a single API call and the agent focuses entirely on the frontend experience.

If you need full Postgres features, see how MoonDB compares to Supabase. For simpler apps and rapid prototyping with AI agents, MoonDB is the faster path.

Build with Windsurf + MoonDB

Add the prompt to your Windsurf project and let Cascade handle the backend.

Get started free
Copied! Now paste it into your AI agent