
Formio Mcp
io.form由 form.io 发布v1.0.1更新于 Oct 24, 2026
Create and manage Form.io forms, resources, actions, roles, and projects from your AI agent.
概览
本地 stdio MCP 服务器,让 AI 助手创建和管理 Form.io 的表单、资源、角色、动作与项目模板。
- 可以做什么
- 创建、读取、更新、发布和回滚表单,并浏览其修订历史与草稿,可先用 schema 技能构建表单 JSON。创建、列出和更新项目角色。列出动作类型及其设置架构,并在表单上添加、读取、更新或删除动作。导出和导入整个项目模板,创建和列出版本标签,并比较当前版本以来的变更。解析并记录目录对应的 Form.io 项目,并在无需凭据的情况下检查服务器状态。
- 适用场景
- 适合在构建或维护 Form.io 项目时使用,让助手编辑表单定义、管理角色和动作,或在项目之间迁移模板,而无需手写 API 调用。也适合在改动前确认当前工作目录解析到哪个项目。
- 运行要求
- 通过 stdio 在本地运行,通常使用 npx 加 npm 包,或使用已发布的 Docker 镜像。需要 Form.io 项目 URL,来源可以是提交的 formio.json、project_set 工具或 FORMIO_PROJECT_URL 变量。认证方式为浏览器门户登录(JWT),或在项目 URL 旁设置 FORMIO_API_KEY 变量。需要能访问 Form.io 部署的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Formio Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Formio MCP server
[npm: @formio/mcp] [Smithery] [MCP Registry]
The MCP server (@formio/mcp) is independently usable from any MCP-aware client. It speaks stdio: the client spawns it and owns stdin/stdout. There is no port to open and nothing to start by hand.
From a clone of this repo, the entry point is src/stdio.ts:
Run that way it waits for MCP traffic on stdin, which only tells you it starts cleanly — point a client at the command instead. A built package exposes the same entry point as the formio-mcp bin and as dist/stdio.js.
Transport
There is no HTTP or SSE transport. The server's only HTTP listener is the temporary browser-login page described under Authentication, which carries no MCP traffic.
Connect a client
The same stdio entry works everywhere, but the file it goes in and the key it goes under both vary by client — .mcp.json under mcpServers for Claude Code, .cursor/mcp.json under mcpServers for Cursor, .vscode/mcp.json under servers for VS Code, and .codex/config.toml as TOML for Codex. There is no universal .mcp.json. The root README carries the full per-client table; the JSON mcpServers shape is:
Every tool that reaches Form.io needs a project. It can come from a committed formio.json, from a per-directory mapping written by the project_set tool, or from FORMIO_PROJECT_URL in the environment — in that order, narrowest scope first, so a mapping overrides the environment and a committed file overrides both. FORMIO_BASE_URL is optional and usually unnecessary: the base URL is derived from the project URL's shape — https://api.form.io for a project on a form.io host, the parent path for a sub-directory-routed one — and is asked for only when it cannot be derived. No plugin manifest prompts for either value; every client records them per directory with project_set or a committed formio.json, and the .mcpb desktop bundle is the one exception because a desktop host has no working directory to interview in.
The server starts without either one, so a client can connect and list the tools before anything is configured — the project URL is only demanded at the point a tool needs it, and server_status works regardless.
Run in Docker
The server ships a Dockerfile and is published to Docker Hub as formio/mcp for linux/amd64 and linux/arm64. The image speaks stdio, so the MCP client owns stdin/stdout and the container must be run with -i:
Wired into a client — the same entry as Connect a client, with command and args pointed at Docker — that becomes (shown in the JSON mcpServers shape; VS Code uses servers and Codex uses TOML, as noted there):
Authentication in a container
FORMIO_API_KEY is the recommended path — no browser, nothing interactive. Browser login also works if you publish the auth port; see Headless environments for both.
Two container-specific notes regardless of auth mode. Prefer the FORMIO_PROJECT_URL environment variable over the project_set tool: project_set persists its per-directory mapping to ~/.formio/projects.json, which lives inside the container and is discarded when it exits. And the cwd argument every tool takes refers to a path inside the container, not on your host — while a workspace root the client reports is a host path, so pass cwd explicitly.
To reuse a token across container runs, mount the cache directory — it must be writable, since the server rewrites the file when a token is refreshed or cleared:
Self-hosted deployments
Two things commonly bite when the deployment is not public:
Hostname resolution. A private hostname won't resolve inside the container. Map it explicitly:
Private or self-signed certificates. The image trusts only the standard CA bundle. A certificate your host trusts — via the macOS keychain, say — will still fail inside the container, surfacing as a bare fetch failed from the tool. There are two cases, and they behave differently:
Issued by a private CA. Mount the CA certificate and point Node at it:
A fully self-signed server certificate — one where subject and issuer are identical and there is no CA:TRUE basic constraint. NODE_EXTRA_CA_CERTS cannot fix this, even if you mount the server's own certificate: Node requires a trust anchor to be a CA, and rejects the chain with DEPTH_ZERO_SELF_SIGNED_CERT. Confirm which case you have with:
If subject and issuer match, your only option is FORMIO_INSECURE_TLS=1, which skips certificate verification only for requests to the configured deployment; every other host the server reaches is still verified. Use it for local development only — never against a production deployment.
Building the image locally
The build context is the repository root, not this directory: the image installs its dependencies from the repository's pnpm-lock.yaml with a frozen lockfile, so it carries exactly the versions the repository tested. Run this from the repository root:
Inspect it with MCP Inspector
The MCP Inspector connects to the server and lets you browse and call its tools by hand — useful for confirming a config works before wiring it into an agent. Start the web portal:
It prints a URL carrying an auth token and opens a browser. The default port is 6274; if something already holds it, move both with CLIENT_PORT=6284 SERVER_PORT=6285.
Copy inspector-config.example.json to inspector-config.json, fill in your project URL and API key, and you have the file the next step asks for. That name is gitignored, so a filled-in copy cannot be committed by accident.
The same run, step by step:
1. Choose Add Servers → Import from client config.
[Add Servers menu with Import from client config highlighted]
2. Click "From file…". The dialog takes a client config file or a client installed on this machine — there is nowhere to paste JSON.
[Import from client config dialog offering a client dropdown and a From file button]
3. Select your inspector-config.json, and the server it defines is listed as new. Confirm with "Import 1 server".
[Dialog listing formio-mcp under New servers with an Import 1 server button]
4. Enable the server with the toggle on its card. It turns green and reports the negotiated protocol version once the container is up; the first connection is slower because Docker has to start it.
[Server card for formio-mcp showing Connected and the docker command it runs]
5. Open the Tools tab for the tools this server exposes. Every server lists all 25 — including project_set and project_get, which are registered for every client.
[Tools tab listing the server's Form.io tools]
6. Pick a tool, fill in its arguments, and press "Execute Tool". The result appears in the middle pane and the JSON-RPC exchange in the right-hand Protocol panel. server_status touches no credentials and makes no Form.io request, so it isolates transport problems from auth problems; form_list below is a real call against a project.
[form_list results showing form definitions returned from a Form.io project]
Importing writes the server into the inspector's own catalog at ~/.mcp-inspector/mcp.json, so it is still there next time — remove it from the card when you are done. A tool that fails with a bare fetch failed is usually the deployment, not the server: see Self-hosted deployments for hostname resolution and certificate trust inside a container.
MCP server tools
The bundled @formio/mcp server exposes these 25 tools. Skills prefer these over raw HTTP whenever an operation is covered.
Forms
Roles
Actions
Project
Why project_set works this way
The tool's description carries only the rules a caller acts on. The reasons behind them:
- The call is the persistence. An agent that answers "switch to project X" in text has changed nothing; only the tool call writes the mapping.
- The mapping is keyed by the directory the call resolves to. That is
cwdwhen it is passed, and otherwise the same directory every other tool resolves (seecwdunder the conventions below). Only the last fallback, the server process's own working directory, is fixed when the client spawns the server and often not where the user is working, so a write keyed there says so. - No restart, but not always in effect. Every tool resolves its project on each call, so a new mapping is read by the next call. It governs only where the mapping is the record that wins: under a committed
formio.jsonit is the fallback for when that file goes away. That is why the result reports the pair that actually resolves (projectUrl,ok) rather than the one just recorded. - The Base URL is derived, not asked for. It builds the portal-login URL and keys the cached token, so a wrong one fails at login rather than on a request, and a guessed one sends the login to a deployment the user does not use. It can be derived for a
form.iohost (https://api.form.io, the Base URL every hosted project shares) and for a sub-directory project (the parent path). A path-less project URL on a customer domain is the exception: its deployment is a sibling sub-domain, and nothing in the project URL names it. - A deployment is bound to its project. The Base URL is stored per directory beside the project recorded with it, so each directory can target a different deployment and no deployment answers for another project. A call that re-points a directory to a different project therefore keeps no Base URL: the old value belonged to the project being replaced.
- The mapping is machine-local. It is keyed by absolute path, so it does not survive a clone. A committed
formio.jsonis versioned, visible in a diff and shared with everyone who clones the repository, which is why it is preferred when the target belongs to the application. - Unknown arguments are refused. The input schema is strict: an argument the tool does not take (such as the removed
scope) is rejected rather than dropped, so a call written against older documentation cannot report a write that never happened.
Diagnostic
Conventions every tool follows
cwd. Every tool that resolves a project takes an optionalcwdand resolves for one directory on each call, chosen in this order: thecwdargument; the client's workspace roots, when the client declares the MCProotscapability — one root as is, and with several the roots holding a project record (a committedformio.jsonor a directory mapping, a broken one included) decide — the first of them when they all hold the same record, the next source when none holds one, and a refusal withINVALID_ARGUMENTlisting them when they hold different records; theCLAUDE_PROJECT_DIRenvironment variable, when it is an absolute path; and last the server process's own working directory, which is fixed where the client spawned it. Roots are read once per session and again afternotifications/roots/list_changed; aroots/listthat fails or does not answer within 2 seconds leaves the last good list in use, and counts as no roots only when no read has succeeded.project_getandserver_statusreport the source ascwdSource(argument,client-root,claude-project-dirorserver). Passcwd, as an absolute path, whencwdSourceisserverorclaude-project-dir— both guesses at where the user is — or to target another directory — such as one application in a monorepo that keeps aformio.jsonper app.formIdandformIdOrPath.formIdis always a form's 24-character ObjectId_id.formIdOrPathtakes the_idor the form's path, and only the reads Form.io serves by path take it:form_get,form_revision_listandform_revision_get. A path passed asformIdis refused withINVALID_ARGUMENT; read the form's_idwithform_get.- Lists.
form_list,role_list,action_listandform_revision_listtakelimit(default 100),skip,sortandselect. Each returns its items under its own key (forms,roles,actions,revisions) besidetotal, the number of items the whole query matches, andhasMore, which is true while another page exists: call again with a largerskipuntil it is false. When Form.io does not report a total,totalis absent andhasMoreis true whenever the page came back full.action_type_listreturns itsactionTypesthe same way, always withhasMore: false. - Updates overwrite what they send.
form_update,role_updateandaction_updatesend a PUT, which Form.io applies to the stored document: each field in the body overwrites the stored one, and a top-level field left out keeps its stored value. An array or object in the body is stored as given — it replaces the stored one whole rather than merging into it — so send every component, access entry or setting the field should keep. - Revision history. A
form_createorform_updatethat would save without revision history — the deployment is not licensed for revisions, the body setsrevisions: "", or an update targets a form whose revisions are off — is refused withHISTORY_NOT_ACCEPTEDand writes nothing, unless the call passesacceptNoHistory: true. The server never prompts the user itself: the agent relays the refusal, and retries with the user's answer. Drafts,form_publishandform_revertneed the revisions licence and are refused withLICENSE_REQUIREDwithout it. - Errors. A failed call returns
isError: true, with text that starts with the error's code in brackets —[NOT_FOUND] …— followed by the message, and_meta["io.form/error"]: { code, status?, body? }, wherestatusis Form.io's HTTP status andbodyits response body, truncated to 2,000 characters. An error result carries nostructuredContent. The codes areNOT_CONFIGURED,BASE_URL_UNRESOLVED,CONFIG_UNREADABLE,INVALID_ARGUMENT,AUTH_REQUIRED,FORBIDDEN,NOT_FOUND,VALIDATION_FAILED,LICENSE_REQUIRED,HISTORY_NOT_ACCEPTED,NO_DRAFT,UNKNOWN_ACTION_TYPE,REDIRECTED,UPSTREAM_ERROR,NETWORK_ERRORandINTERNAL. An argument that fails the tool's input schema is reported by the MCP SDK as plain text, without a code.
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
/callbackendpoint, andformioFetchattachesx-jwt-tokenon every subsequent request. The flow is implicit — the first authenticated tool call triggers it on a cache miss. No explicitauthenticatetool exists. - API-key mode. Set the
FORMIO_API_KEYenvironment variable besideFORMIO_PROJECT_URL. Requests to the projectFORMIO_PROJECT_URLnames attachx-tokenand skip the browser flow entirely; any other project a committedformio.jsonor a directory mapping resolves authenticates through the portal login instead, andproject_getsays why.
The JWT is cached in ~/.formio/mcp-tokens.json (mode 0600), keyed by the resolved Base URL — one token covers every project on the same deployment. Tokens are valid for roughly seven days; on a cache hit the server checks expiry locally, then revalidates against the server, and falls back to a fresh login if either check fails.
What the agent is granted. JWT mode hands the agent the JWT of whoever logs in, so the agent acts with that person's permissions for the token's lifetime — sign in as an administrator and the agent inherits administrator access to the deployment. An API key is scoped to its project instead. Prefer API-key mode for unattended or shared environments, and sign in as a least-privileged user when using JWT mode.
Headless environments
By default the login page is served on an ephemeral port bound to 127.0.0.1 and the server launches the default browser with open (macOS), xdg-open (Linux), or the url.dll protocol handler (Windows) — directly, not through a shell — which assumes a desktop browser on the same machine.
Where that assumption doesn't hold — a container, an SSH session, CI — you have three options:
-
Set the
FORMIO_API_KEYenvironment variable besideFORMIO_PROJECT_URLand skip the browser entirely. Simplest for unattended use. -
Complete the login manually. The login URL is written to stderr on every login attempt, before any browser launch is tried — not only when something fails. If the launch does fail, that is reported as an additional line rather than swallowed. The URL also appears in the timeout error, which the client surfaces as tool output, so it reaches you even if you never see the server's logs.
stderr is used because with stdio transport stdout carries the MCP protocol itself — writing anything else there corrupts the stream.
-
Bind somewhere reachable. Set
FORMIO_AUTH_HOST=0.0.0.0andFORMIO_AUTH_PORTto a fixed, published port, then open the URL from your own machine:FORMIO_AUTH_HOST=0.0.0.0exposes the login page on every interface for the duration of the login. Only use it where that is acceptable.
Whichever way you reach it, open the login URL exactly as printed, including its ?s= value: the page is served only for that value, which is generated for each login. Behind a forwarded port (a devcontainer, Codespaces) keep the ?s= value and change only the host and port.
If no login arrives within FORMIO_AUTH_TIMEOUT seconds (default 900) the call fails with an error naming these options, rather than hanging until the client gives up.
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):
{baseUrl}/formio/user/login(portal-base){projectUrl}/admin/login(project admin){projectUrl}/user/login(project user)
{baseUrl} and {projectUrl} are the RESOLVED values — whatever project get reports for that directory — not the environment variables of similar name.
The probe runs lazily — only when the local auth page is actually served.
Environment variables
* Not at startup — the server starts, lists every tool, and answers server_status without it; only the tools that read or write Form.io data error, naming project_set and this variable. The alternative is the project_set tool, which maps a working directory to a project in ~/.formio/projects.json. Resolution runs by scope, narrowest first: a committed formio.json found by walking up from the caller's cwd, then the mapping for that cwd or its nearest mapped ancestor, then FORMIO_PROJECT_URL in the environment as the weakest source, then the error. Map a directory before any client connects with npx -y @formio/[email protected] project set --project-url <url> --cwd <path> — the deployment is derived from the project URL wherever it can be, so add --base-url <url> only when the server says it cannot be determined. Add --force beside both URLs to record a pair the domain rules refuse — the one shape they cannot tell from a mistake is an internal deployment served from a *.form.io domain; it takes both URLs in the same call, is honoured on every later read, and is a shell-only flag the project_set tool does not have. project set --reset --cwd <path> clears a directory's entry, which is how a forced pair is un-forced: a write that leaves both halves untouched keeps the override, so there is nothing for an unforced re-record to change. project get --cwd <path> prints what resolves and which source won. It exits 0 when it resolved, 1 when nothing is mapped for that directory, 2 when the command could not answer (a usage error, a malformed URL, an unreadable ~/.formio/projects.json), and 3 when a project resolved but its Base URL could not be determined — so a caller can tell "nothing here yet" from "this failed" from "half configured, and here is the one value missing". project set --cwd <path> exits 0 when the directory is ready to serve a call, 1 when a named value is still missing, 2 when the command could not answer, and 3 when the record WAS written and the directory still resolves no Base URL — a committed formio.json governs it and supplies none, so the remedy is an edit to that file rather than another write.
CLI reference: project get, project set and project logout
The formio-mcp binary (npx -y @formio/[email protected] project …) reports what a directory resolves to and records a project for it before any client connects. project logout signs out of one deployment — the one the directory resolves to, exactly as project get resolves it, or the one --base-url names — by removing that deployment's cached token from ~/.formio/mcp-tokens.json and leaving every other entry in place. A running server notices on its next call there and signs in again, so signing out or switching accounts needs no restart. These flags and exit codes are part of the 1.0 surface.
Privacy Policy
Form.io's privacy policy covers the Form.io Services this server talks to: https://form.io/privacy
What the server itself does with data, which is the part the policy above cannot describe:
Where your data goes. Only to the Form.io deployment you configure. Every request targets the Project URL and Base URL that resolve for your working directory — your own SaaS project or your self-hosted server. The server sends nothing to Form.io when you are self-hosted, and there is no telemetry, analytics, or usage reporting of any kind.
What is stored on your machine. Two files under ~/.formio/, both written with mode 0600:
Form data and submissions are never written to disk — they pass through in memory to answer a tool call.
Credentials. The FORMIO_API_KEY environment variable, when set, is read from the environment and sent as an authentication header only with requests to the project FORMIO_PROJECT_URL names; it is never written to disk. The cached JWT is valid for roughly seven days, after which the server re-authenticates. Delete ~/.formio/mcp-tokens.json to sign out immediately.
Third parties. The server contacts no third-party service. One exception is worth naming: the browser sign-in page is served locally, and the page it renders loads the Form.io renderer and its stylesheets from cdn.jsdelivr.net, a webfont from fonts.googleapis.com, and the Form.io logo from portal.form.io, so those hosts see your browser's IP address while that page is open. Everything else on the page comes from your own deployment. Set the FORMIO_API_KEY environment variable beside FORMIO_PROJECT_URL to skip the browser flow entirely and avoid it.
Retention. The files above persist until you delete them. Data held in your Form.io project is governed by your own deployment's retention rules, and by the policy linked above for Form.io-hosted projects.
Questions about data handling: [email protected]
来源:packages/mcp-server/README.md,提交 9d458c2
工具
0版本历史
5- v1.0.1最新Oct 14, 2026
- v1.0.0Oct 14, 2026
- v0.14.1Oct 5, 2026
- v0.14.0Sep 29, 2026
- v0.13.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分