Why wire a form backend through MCP instead of by hand
Ask Cursor to "add a contact form" and it will happily generate a beautiful form — and then a backend API route, an email integration, and some spam handling, all of which you now own, maintain, and debug. For a contact, waitlist, or lead form, that's effort spent rebuilding infrastructure that already exists as a service.
The splitforms MCP server changes the shape of the task. Instead of generating a backend, Cursor talks to splitforms through the Model Context Protocol — a typed tool interface — and lets splitforms be the backend. The agent can create a real form on your account, read your access key, and generate front-end code that points at the right form. You get a working, hosted backend without a single server file in your repo.
This is also more reliable than prompt-only wiring. When the agent has live account context (real form IDs, your actual key), it stops guessing and starts confirming — fewer "it generated a placeholder key" mistakes.
Step 1: Connect the splitforms MCP server
Grab your MCP token from the MCP settings in your splitforms dashboard (it looks like sk_mcp_... and is a secret — not the same as your public access key). Then either let the installer write your config:
npx @splitforms/mcp install --token sk_mcp_xxxxxxxxxxxxOr add the server manually to Cursor's MCP configuration (Cursor Settings → MCP):
{
"mcpServers": {
"splitforms": {
"command": "npx",
"args": ["-y", "@splitforms/mcp"],
"env": { "SPLITFORMS_TOKEN": "sk_mcp_xxxxxxxxxxxx" }
}
}
}Restart Cursor. The agent now has access to seven splitforms tools: list_forms, get_form, create_form, list_submissions, get_submission, generate_form_html, and get_access_key — all on the free tier. Keep the SPLITFORMS_TOKEN in your MCP config only; never put it in app code.
Step 2: Ask the agent to build and wire the form
With the server connected, describe what you want. The agent will use the tools rather than inventing a backend:
Using the splitforms MCP server, create a contact form named
"Website Contact" with fields name, email, and message. Fetch the
account access key, then generate a Tailwind-styled React component
whose onSubmit POSTs the form data plus the access_key to
https://splitforms.com/api/submit. Include a hidden honeypot field.Behind the scenes the agent calls create_form to make the form, get_access_key to retrieve your public key, and generate_form_html (or just writes the component) to produce front-end code wired to the real endpoint. You end up with a styled form whose submissions land in your account — no API route, no email provider, no SMTP.
Later you can ask things like "show me the last 10 submissions for the Website Contact form" and the agent calls list_submissions / get_submission to read them inline — useful for debugging a live form without opening the dashboard.
Step 3: The generated submit handler
However the agent styles it, the core is the same lightweight client handler — no backend involved:
const ACCESS_KEY = "sf_live_..."; // public, from get_access_key
async function onSubmit(e) {
e.preventDefault();
const data = new FormData(e.currentTarget);
data.append("access_key", ACCESS_KEY);
const res = await fetch("https://splitforms.com/api/submit", {
method: "POST",
body: data,
});
// handle res.ok success / error states
}The access key here is the public identifier — safe in client code. The private MCP token never appears in the app; it only lives in your Cursor MCP config. That separation is the whole security model: the agent acts on your account with the secret token, the shipped form authenticates with the public key.
Step 4: Test and ship
Run the app, submit a test entry, and confirm it appears in your splitforms dashboard and inbox within ~5 seconds — or just ask the agent to list recent submissions. Before launch, add your production domain to Allowed Domains in the security tab. If something doesn't arrive, the contact form not working checklist covers it.
What to do next
- Same flow in Claude Code: give Claude Code a form backend via MCP
- Prompt-only AI builders: Lovable · v0 · Bolt.new
- Full tool reference: splitforms MCP and /docs
- Ready to start: get a free access key
FAQ
What does the splitforms MCP server let Cursor do?
Once connected, Cursor's agent can call splitforms tools directly: list_forms, get_form, create_form, list_submissions, get_submission, generate_form_html, and get_access_key. In practice that means you can ask Cursor to 'create a contact form and wire it up,' and it will create the form on your account, fetch your public access key, and generate the ready-to-paste HTML or JSX — without you leaving the editor or copy-pasting keys from a dashboard.
Is MCP better than just pasting the endpoint into a prompt?
For a one-off form, pasting the endpoint URL into a prompt is fine and this guide shows that too. MCP wins when the agent needs live account context — your real form IDs, your access key, existing submissions. With MCP the agent reads and writes through a typed protocol instead of guessing, so it can create the form, confirm it exists, and generate matching front-end code that actually points at the right form. That's the difference between 'works in the demo' and 'wired to your account.'
Do I need to write any backend code in Cursor?
No. That's the point. The form posts directly to the splitforms endpoint, so there's no API route, email provider, or SMTP setup in your project. Cursor's job is to generate the front-end form and drop in your access key; splitforms handles receiving, storing, emailing, spam-filtering, and webhooks. If you'd rather build a native Next.js Route Handler instead, that path is covered in our Server Actions vs form backend comparison.
Is the MCP token the same as the public access key?
No — they're two different credentials. The MCP token (SPLITFORMS_TOKEN, looks like sk_mcp_...) authenticates the Cursor agent to your account and is a secret you keep in your MCP config, never in app code. The access key (sf_live_...) is the public identifier that goes into the form's client-side HTML. Keep the MCP token private; the access key is meant to be public.
Which Cursor versions support MCP?
Cursor supports MCP servers through its settings, where you add servers to the MCP configuration. The splitforms server runs via npx, so there's nothing to install globally — Cursor launches it on demand. If you don't see MCP in your settings, update Cursor to a current version; MCP support has been standard in recent releases.