MoonDB + Claude Code: Backend in One Conversation

Claude Code is Anthropic's CLI agent that writes, runs, and debugs code directly in your terminal. MoonDB is the backend it can provision without leaving the conversation. Add the MoonDB prompt to your CLAUDE.md and Claude builds a complete backend — schema, API, auth, storage — while you describe the app.

The Fast Path: MCP Server (recommended)

Claude Code supports MCP servers natively. One command and Claude has a complete MoonDB toolkit in every session — no CLAUDE.md prompt to maintain, no mid-conversation "what's your API key?" interrupt. The server's initialize.instructions field briefs Claude on MoonDB schema conventions automatically, so it doesn't burn turns guessing column types or trying SQL syntax.

terminal
# register the MoonDB MCP server claude mcp add --transport http \ moondb https://moondb.ai/mcp \ --header "X-API-Key: mk_..." # then in any project: # "Use moondb to spin up a backend for a blog with users, # posts, comments — owner-scoped, public read on posts."
Replace mk_... with your real platform API key from /dashboard → Account.

Exposed tools, grouped:

Get your mk_... account key from the dashboard Account tab.

The Drop-in Path: CLAUDE.md (also works)

If you prefer to keep MCP servers per-project, MoonDB also publishes a prompt for CLAUDE.md that teaches Claude the REST API directly.

  1. Add the MoonDB prompt to your CLAUDE.md:
  2. Tell Claude: "Build me a blog platform with users, posts, and comments"
  3. Claude signs up, creates a project, designs and applies the schema
  4. Claude fetches /v1/llm-context to get exact API docs for your schema
  5. Claude writes the frontend, wired to the live API — no stubs, no placeholders

The llm-context Endpoint

Every MoonDB project exposes GET /p/{id}/v1/llm-context, which returns a machine-readable document with your actual table names, column types, endpoints, auth flow, and access rules. Claude reads this and generates code that matches your exact schema — no hallucinated column names, no wrong endpoints.

CLAUDE.md
# MoonDB Backend # (paste the MoonDB prompt here) # Claude reads this, then runs: // 1. Sign up POST https://api.moondb.ai/v1/accounts/signup { "email": "user@example.com", "password": "..." } // 2. Create project + set schema // 3. Fetch llm-context GET /p/{id}/v1/llm-context // Returns your exact endpoints, types, auth flow // 4. Claude writes code using the real API const res = await fetch( `https://api.moondb.ai/p/${id}/api/posts?sort=created_at.desc`, { headers: { Authorization: `Bearer ${token}` } } );

Why Claude Code + MoonDB

Claude Code excels at multi-step tasks: it can sign up for a service, create resources, read documentation, and write application code — all in one session. MoonDB is designed for exactly this workflow:

The result: Claude goes from "build me an app" to a deployed backend with working auth, REST API, and file storage — in a single conversation, typically under 60 seconds.

Build with Claude Code + MoonDB

Add the prompt to CLAUDE.md and let Claude handle the rest.

Get started
Copied! Now paste it into your AI agent