New:Socket for Asana Is Now Available.Learn more
Sign In

@formio/mcp

Package Overview
Dependencies
Maintainers
7
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formio/mcp

Form.io MCP Server

Source
npmnpm
Version
0.4.1
Version published
Maintainers
7
Created
Source

Formio MCP server

The MCP server (@formio/mcp) is independently usable from any MCP-aware client. From a clone of this repo:

pnpm install
pnpm --filter @formio/mcp dev

The server starts on port 3000. Override with the PORT env var.

Transports

TransportEndpointCompatible with
Streamable HTTPPOST /mcpClaude Code, VS Copilot, modern MCP clients
SSEGET /sse + POST /messagesClaude Desktop, legacy MCP clients
stdionode dist/stdio.js.mcp.json spawn-mode clients

Connect to Claude Code

{
  "mcpServers": {
    "formio-mcp": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Connect to Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "formio-mcp": {
      "url": "http://localhost:3000/sse"
    }
  }
}

Spawn via .mcp.json (stdio)

{
  "mcpServers": {
    "formio-mcp": {
      "command": "npx",
      "args": ["-y", "@formio/mcp"],
      "env": {
        "FORMIO_BASE_URL": "https://api.form.io",
        "FORMIO_PROJECT_URL": "https://your-project.form.io"
      }
    }
  }
}

In standalone (non-plugin) mode, FORMIO_BASE_URL and FORMIO_PROJECT_URL are required env vars. In plugin mode, the plugin manages both via Claude Code's user-config + per-cwd ~/.formio/projects.json mapping.

MCP server tools

The bundled @formio/mcp server exposes these tools. Skills prefer these over raw HTTP whenever an operation is covered.

Forms

ToolPurpose
form_createCreate a new form. Use the formio-form skill first to build the JSON definition.
form_getFetch a single form definition by ID or path.
form_listList forms with optional filtering and pagination.
form_updateUpdate an existing form. Call form_get first, edit with formio-form, then update.

Roles

ToolPurpose
role_createCreate a new project role.
role_listList all project roles.
role_updateFull-replacement update of a role. Include all fields you want preserved.

Actions

ToolPurpose
action_types_listList all action types available on the server.
action_type_getGet an action type's settings schema.
action_createAttach a new action to a form.
action_listList actions on a form.
action_getGet a single action by ID.
action_updateUpdate an action.
action_deleteDetach an action from a form.

Project

ToolPurpose
project_exportExport the project's complete template (roles, resources, forms, actions) as a portable JSON document. Use before project_import to snapshot.
project_importImport a template JSON — additively merges roles, resources, forms, and actions in one call. Same-machine-name items are overwritten in place; everything else is preserved.
project_setPlugin-mode only — persist a per-cwd Project URL mapping in ~/.formio/projects.json. Never exposed standalone (the standalone server binds to FORMIO_PROJECT_URL via env instead).

Diagnostic

ToolPurpose
helloSmoke-test tool. Returns a static greeting; useful for verifying MCP wiring before any authenticated call.

Authentication

The MCP server supports two authentication modes:

  • JWT mode (default). A short-lived local Express server renders the Form.io portal login form; the user signs in once, the JWT comes back via a /callback endpoint, and formioFetch attaches x-jwt-token on every subsequent request. The flow is implicit — the first authenticated tool call triggers it on a cache miss. No explicit authenticate tool exists.
  • API-key mode. Set FORMIO_API_KEY. All requests attach x-token; the browser flow is skipped entirely.

Login-form auto-resolution

When FORMIO_LOGIN_FORM is unset, the server probes these candidates on the first login attempt and caches the first one that responds (1.5-second timeout per candidate):

  • ${FORMIO_BASE_URL}/formio/user/login (portal-base)
  • ${FORMIO_PROJECT_URL}/admin/login (project admin)
  • ${FORMIO_PROJECT_URL}/user/login (project user)

The probe runs lazily — only when the local auth page is actually served.

Environment variables

NameRequiredDefaultPurposeHosted SaaS exampleSelf-hosted example
FORMIO_BASE_URLyesFull base URL of your Form.io deployment.https://api.form.iohttps://forms.example.com
FORMIO_PROJECT_URLyes*Full URL of your Form.io project. In plugin mode, only used as the pre-filled default offered when prompting for an unmapped cwd.https://myproject.form.iohttps://forms.example.com/myproject
FORMIO_API_KEYnoundefinedLong-lived project API key. When set, the server skips the browser login flow.CHANGEMECHANGEME
FORMIO_LOGIN_FORMnoAuto-resolvedOverride the portal login form URL used by the JWT login flow.https://formio.form.io/user/loginhttps://forms.example.com/formio/user/login
FORMIO_PLUGIN_CONTEXTno0Set by the plugin manifest. When 1, the server enables project_set and reads FORMIO_PROJECT_URL from ~/.formio/projects.json per cwd instead of env.

* In plugin context, FORMIO_PROJECT_URL is captured per-cwd by the project_set tool and persisted to ~/.formio/projects.json. The verify-project-url SessionStart/PreToolUse hook offers formio_default_project_url (from plugin user-config) as the default the first time you enter a workspace.

FAQs

Package last updated on 23 Jun 2026

Related posts