A contact form is the most common thing people ask an AI to add to a site, and it's the one that most often doesn't work. The AI writes a nice form, wires it to a fetch("/api/contact") that doesn't exist, or to a mailto: link, and the first real message goes nowhere.

The form isn't the hard part. Where the message goes is. You need something on a server to receive it, store it and email you, and usually a key for an email service on top.

This post walks through doing it the short way: connect your AI to your site over MCP, and let it hook the form up to a service that already receives and emails messages. No server code and no key. We build Xodia, so the steps use it, but the first half (connecting an MCP server to Claude Code, Cursor or the Claude app) works the same for any remote MCP server.

Step 1: connect your AI to the site

Xodia runs a remote MCP server at https://app.xodia.ai/mcp (Streamable HTTP, sign-in with OAuth). How you add it depends on the app.

Claude Code. The plugin adds the connection plus short slash commands:

claude plugin marketplace add https://app.xodia.ai/plugin/marketplace.json claude plugin install xodia@xodia 

Restart Claude Code, type /mcp, choose xodia and sign in in the browser.

If you'd rather add only the MCP server, without the plugin:

claude mcp add --transport http --scope user xodia https://app.xodia.ai/mcp 

Claude app (web, desktop or phone). Settings, Connectors, Add custom connector, paste https://app.xodia.ai/mcp, click Connect and allow access.

Cursor, Codex, VS Code and other MCP apps. Add a remote MCP server with type Streamable HTTP, OAuth sign-in and the same URL.

A note on the sign-in: it's OAuth with PKCE, so the app gets its own token. You never paste a password or an API key into your AI app, and Xodia never sees your Claude or Cursor account.

To check it works, ask: "List my Xodia projects." If you don't have one yet, ask it to create one, or start from a template in the browser first.

Step 2: make sure there's a form to connect

If your site already has a contact page with a form, skip this.

If not, ask your AI for one, and be specific about what you don't want:

Add a contact section to the home page with name, email and message fields. Plain <form> with a name on every field. No onSubmit handler and no mailto.

The reason for "no onSubmit" is that the next step adds the sending part to the form itself. A form that already has its own submit code gets flagged, because two things trying to send the same message is how you end up with zero or two emails.

Step 3: add the contact form feature

Now ask:

Add the contact form feature to this site.

Under the hood that's one tool call, add_feature with contact-form. It writes no server code. It finds the site's own form (a contact page's form first) and connects it to Xodia Forms. If the site has no form yet, it says so, and the AI goes back to step 2 and then calls connect_form on the new one.

Connecting a form changes only the form's markup. It sets action and method="post", adds success and error text, a hidden field that catches spam bots, and a field that records which page the message came from. Your field names stay as they are.

After that, each message is emailed to you and kept in Forms in Xodia, where you can read it later. There's no key to add, because the sending runs on our side.

The same step works in the browser without an AI: Features in the top menu, then Add on the Contact form card. Both paths do the same thing.

Step 4: send a test message

Open the preview, fill in the form and press send. The message shows up in Forms, and the setup card ticks off "Send a test message" on its own.

Two things worth checking while you're there:

  • The success text. It's the only thing a real visitor sees after pressing send. "Thanks, we'll reply within a day" beats "Form submitted".
  • The phone layout. Ask your AI to take a phone-size screenshot of the page. Forms are where small screens break first: labels wrap, buttons get cut off.

Why we did it this way

The usual answer to "nothing behind the form works" is to write a backend for it. Writing the backend for every site means a function, a key and a place to put messages, and it's easy for the key to end up in a chat on the way. For a contact form you don't need any of that. You need the message to arrive.

So the contact form is a ready-made piece. Your AI connects the form in your code, and the receiving, storing and emailing stays on our side, with no key for anyone to leak.

The same Features list has other ready-made pieces your AI can add the same way, like members-only pages with Google sign-in or an AI answer box. Some need a one-click connection, such as Stripe for taking payments, and the card says so before you add it.

Try it

The full connect steps for each MCP app: https://xodia.ai/guides/connect-mcp-server-website?utm_source=devto&utm_medium=article&utm_campaign=post-0005

What the Features list has and how each one is set up: https://docs.xodia.ai/features?utm_source=devto&utm_medium=article&utm_campaign=post-0005

Where do contact forms on your AI-built sites usually send their messages today?