You have a Next.js site, a coding agent open in the terminal, and one job: a lead form that sends you real enquiries and doesn't break next week. The agent will happily write a form. The real decision is where the answers go after someone clicks submit, and who has to maintain that part.
There are three common routes. Your agent can build a form and a Server Action that you own end to end. It can wire your own form markup to a hosted form backend. Or it can build the whole funnel in a hosted form tool over MCP and embed it on the page. Each one fits a different team, and the first one is often the right answer.
The three routes at a glance
| Route (Next.js forms guide) | What the agent writes | Where answers go | You maintain | Fits best when |
|---|---|---|---|---|
| Your own Server Action | Form component, validation, Server Action, email or database call | Your database, or your inbox through an email API | Validation, spam protection, storage, notifications | You have a developer and want the form in your own components |
| Form backend (Formspree, Basin) | Form markup that posts to the service's endpoint | The service's dashboard and email | Only the markup | A static or handed-off client site that just needs submissions to arrive |
| Hosted funnel over MCP (Dashform) | Nothing in your codebase except an embed; the funnel is built in the tool through MCP | The tool's replies, scored, plus its integrations | The questions and rules, not the plumbing | You want branching, qualification and AI agents able to read and submit the same form |
Route 1: a Server Action you own
This is what most coding agents suggest first, and for good reason. Next.js documents the pattern in its forms guide: a form posts to a Server Action, the action validates the input on the server, then stores it or sends it on.
A prompt that gets a solid first version:
Add a lead form to the contact page of this Next.js app.
Fields: name, work email, company, service (select), budget range (select), message.
Validate on the server with a shared schema and return field errors to the form.
Add a honeypot field and reject submissions that fill it.
Send each lead to my inbox with Resend and store it in the leads table.
Show a thank-you state after submit. Then run the dev server and submit one test lead.Resend has a Next.js guide for the email step, and the same structure works with any database you already run.
Choose this route when the form must match your design system exactly, when the data must live in your own database from the first second, or when the form is a small part of a bigger app. The cost is ownership: spam rules, failed emails, schema changes and every new question become code changes.
Route 2: a form backend
A form backend keeps your markup and replaces the server part. The agent writes a normal HTML form and points its action at the service's endpoint. Formspree and Basin both work this way and both start with a free plan.
This is the quickest route for agencies handing a static site to a client: there is no server code to deploy, and the client gets submissions by email and in a dashboard. It is a good choice whenever "send me the message" is the whole requirement.
It does less once you need the form to decide something. Branching questions, scoring a lead against your criteria, or sending only good fits to your calendar mean adding more tools around it.
Route 3: a hosted funnel your agent builds over MCP
The third route moves the form out of your codebase. Your coding agent connects to a form tool's MCP server and builds the funnel there, in the same conversation, then drops an embed into the page.
With Dashform the setup is one command in Claude Code:
claude mcp add dashform --transport http https://getaiform.com/api/mcpAfter you sign in, the agent can create the funnel with create_form, adjust questions and branching with update_form, and publish it with publish_form. The MCP docs list the permissions and the commands for Cursor and Codex. The page then needs only the embed script from the Dashform docs, which a coding agent can add with next/script.
A prompt for this route:
Using the Dashform MCP server, create a lead funnel for a web design agency.
Ask for the project type, budget range, timeline and website URL, and branch
so that projects under our minimum budget see a resource page instead of the booking step.
Publish it, give me the share link, and embed it on /contact in this Next.js app.What you get beyond a form: you can turn on AI lead scoring, which gives each completed reply a High, Medium or Low verdict with the reason, judged against criteria you write. The published funnel can also be found and submitted by buyers' AI assistants through the same MCP server. If you want to check how your current site reads to those assistants, the free AX Audit scans any URL.
Where it fits less well, stated plainly:
- The form renders in an embed, not in your own React components, so pixel-level control is lower than in Route 1.
- It is hosted SaaS with monthly reply and AI credit allowances per plan; see pricing.
- Dashform records the request and hands back your booking link. It does not put the appointment on your calendar itself.
How to choose
- Pick your own Server Action if a developer will own the site and the form is simple, or the data must stay in your own database.
- Pick a form backend if you are shipping static client sites and only need messages to arrive.
- Pick a hosted funnel over MCP if the form has to qualify people (budget, fit, timeline), you want to change questions without a deploy, or you want AI assistants to be able to complete it for their users.
Whichever route you take, ask the agent to submit a test lead at the end and show you where it landed. A form that has never delivered a submission is the most common way this goes wrong.
If Route 3 fits, the MCP setup guide walks through connecting Claude Code, and building a client intake form from a brief shows a full session from field map to published form.
Pricing and features of other products were checked on their own pages on December 1, 2026.







