Formly

How to Let AI Agents Build Your Forms with MCP

If you already work inside an AI agent (Claude Code, Cursor, ChatGPT, Codex), leaving it to click around a form builder feels like a step backwards. With the Model Context Protocol (MCP), you don't have to: connect Formly to your agent once, and it can create forms, edit them, publish links, and pull responses, all from the conversation you're already in.

This guide covers what that setup looks like and how to get it running in a few minutes.

What is MCP, briefly

The Model Context Protocol is an open standard that lets AI agents call tools in external services. A service exposes an MCP server; the agent connects to it and gains a set of typed tools it can invoke on your behalf. Formly ships an MCP server, which means any MCP-compatible agent can operate your Formly account, with your permission, using your API key.

In practice, that turns requests like these into finished work:

Step 1: Create an API key

You'll need a Formly account on the Pro plan. In the dashboard, go to Settings → Developer and generate an API key. This key is what authorizes your agent, so treat it like a password.

Step 2: Connect your agent

There are two ways to run the Formly MCP server. Both expose the same tools, so pick whichever your agent supports.

Remote (hosted, zero install). Add a remote MCP server pointing at:

https://api.formly.so/mcp

with your API key as a bearer token (Authorization: Bearer YOUR_API_KEY).

Local (npx). Add the formly-mcp package to your agent's MCP config:

{
  "mcpServers": {
    "formly": {
      "command": "npx",
      "args": ["-y", "formly-mcp"],
      "env": {
        "FORMLY_API_KEY": "formly_sk_your_key_here"
      }
    }
  }
}

For CLI agents, registration is a one-liner. Claude Code:

claude mcp add formly --env FORMLY_API_KEY=formly_sk_your_key_here -- npx -y formly-mcp

Codex CLI:

codex mcp add formly --env FORMLY_API_KEY=formly_sk_your_key_here -- npx -y formly-mcp

There's an even lazier option: paste the ready-made setup prompt from the developer docs into a coding agent, and it will install and verify the connection itself.

Step 3: Just ask

Once connected, your agent has the full toolkit:

ToolWhat it does
create_formBuild a new form from a description
edit_formChange questions, pages, or structure
update_form_settingsAdjust settings like notifications or access
publish_form / unpublish_formTake a form live, or take it down
list_forms / get_formBrowse forms and fetch links or structure
get_submissionsRead responses
create_space / list_spacesOrganize forms into workspaces

Ask in plain language and the agent chooses the right tools. A single request like "create a feedback survey for our beta users and publish it" typically chains create_formpublish_formget_form and hands you the live link.

What this unlocks beyond convenience

If you'd rather integrate directly, everything the MCP server does is also available as a plain REST API, including an endpoint that generates a form from a description in one call.

Troubleshooting


New to the prompt-based side of Formly? Start with how to create a form with AI, or get an API key and connect your agent now.