← All posts
Blog

Add a working contact form in Cursor in under a minute

Cursor builds the frontend fast. The slow part is the form backend. Here's how to give Cursor a submission endpoint, validation, and email delivery with one AgentsForms command — no database, no backend route.

You asked Cursor to “add a contact form.” Twenty seconds later the UI is done — and then it stalls. Storage? Validation? Email? A route? That’s the form-backend wall, and it’s the same wall every time.

The wall

When a coding agent spins up a site, the UI is the easy part. The painful part is everything behind the form:

  • a place to store submissions,
  • payload validation,
  • email delivery to the owner,
  • a route and deploy config.

Most agents either hand you a half-finished server action or punt to a third-party embed that yanks visitors off your site.

The fix: give Cursor a backend it doesn’t have to build

AgentsForms is a form backend for AI-generated sites. You create one endpoint; the agent keeps the form in your app’s design system and POSTs to it. AgentsForms validates, stores, and emails the submission.

Paste this into Cursor:

Add a contact form to this site. Use AgentsForms as the form backend:
1. Run `agentsforms forms create contact --email [email protected]`
2. Run `agentsforms codegen contact --target react`
3. Wire the generated component so it POSTs to the AgentsForms endpoint.
No database or backend route — AgentsForms stores and emails submissions.

What Cursor wires up:

  1. A native ContactForm component in your design system.
  2. A POST to https://api.agentsforms.com/v1/forms/contact/submissions.
  3. Email delivery to the owner — no inbox integration code.

Why this beats a hosted form

A hosted form link sends visitors to a generic page. AgentsForms keeps the form in your app, so the experience stays yours while the backend becomes a single endpoint.

Your agent should build the frontend, not the form backend.

Verify it

Use a real email in the --email flag, submit the form, and check the inbox. Done — a working contact form, no database.

See the full Cursor recipe and the Quickstart.