Skip to content

[FlutterFlow AI / CLI] MCP server crashes on startup on Windows: SignalException "Failed to listen for SIGTERM" #7521

Description

@mohammads1992a-pixel

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

The FlutterFlow AI MCP server (.flutterflow/sdk/flutterflow_ai/mcp/server.dill, registered in the workspace .mcp.json by flutterflow ai init) crashes immediately on startup on native Windows, so every MCP host (Claude Code, Codex, etc.) reports "Connection closed" and none of the flutterflow_ai tools are available.

Running the server manually shows the unhandled exception:

> dart .flutterflow/sdk/flutterflow_ai/mcp/server.dill --dir C:\Users\<user>\<workspace>
Unhandled exception:
SignalException: Failed to listen for SIGTERM, osError: OS Error: The request is not supported.
, errno = 50

Root cause (in mcp/server.dart, _installChildProcessReaper): the code wraps signal.watch().listen(...) in a try/catch expecting a synchronous throw on unsupported platforms, but on Windows the Dart VM reports the SIGTERM failure asynchronously as a stream error. Since the listen call has no onError, the error is unhandled and kills the isolate before the server ever answers initialize.

The flutterflow ai CLI itself works fine on Windows (init, upgrade --check, etc.); only the MCP server is affected.

Expected Behavior

The MCP server should start on Windows and answer the initialize request, with the unsupported SIGTERM watch silently ignored (as the existing code comment intends: "Unwatchable on this platform (SIGTERM on Windows) — the pipe-close path below still applies").

Suggested fix — add an onError handler to the listen call in _installChildProcessReaper (mcp/server.dart):

signal.watch().listen((_) async {
  await _shutdownCliProcesses();
  io.exit(0);
}, onError: (_) {
  // Windows reports "Failed to listen for SIGTERM" asynchronously on the
  // stream instead of throwing from watch(); ignore it.
});

I applied exactly this one-line change locally, recompiled server.dill with dart --snapshot-kind=kernel, and the server now starts and responds to initialize correctly on Windows 11.

Steps to Reproduce

  1. On a Windows 11 machine, install the CLI: dart pub global activate flutterflow_cli (0.0.39).
  2. Run flutterflow ai, enter the API key, pick an existing project, accept the workspace creation (SDK 0.0.40+4, build f68c87bc is downloaded).
  3. The wizard prints "FlutterFlow AI MCP server registered with Claude Code" and writes .mcp.json pointing at dart.exe <workspace>\.flutterflow\sdk\flutterflow_ai\mcp\server.dill --dir <workspace>.
  4. Start Claude Code (or any MCP host) in the workspace: the flutterflow_ai server fails with "Connection closed".
  5. Reproduce without a host, from PowerShell in the workspace:
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}' | dart .flutterflow/sdk/flutterflow_ai/mcp/server.dill --dir (Get-Location).Path
  1. Observe: no JSON-RPC response, process exits with code 255 and SignalException: Failed to listen for SIGTERM, osError: OS Error: The request is not supported., errno = 50.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

N/A — this is a bug in the FlutterFlow AI CLI/MCP server binary, not in a project widget, so there is no widget tree to generate a code from.

Visual documentation

Terminal output (text, since the bug is CLI-only):

PS C:\Users\<user>\<workspace>> '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | dart .flutterflow/sdk/flutterflow_ai/mcp/server.dill --dir C:\Users\<user>\<workspace>
Unhandled exception:
SignalException: Failed to listen for SIGTERM, osError: OS Error: The request is not supported.
, errno = 50
(exit code 255)

After the one-line onError fix and recompiling server.dill, the same command returns:

{"jsonrpc":"2.0","result":{"protocolVersion":"2024-11-05","capabilities":{"logging":{},"tools":{"listChanged":true}},"serverInfo":{"name":"flutterflow_ai","version":"0.0.40"}, ...},"id":1}

Environment

- FlutterFlow AI SDK: 0.0.40+4 (build f68c87bc, released 2026-09-17, env prod)
- flutterflow_cli: 0.0.39 (from pub.dev)
- Dart SDK: 3.8.1 (stable) windows_x64 (bundled with Flutter 3.32.1)
- Platform: Windows 11 Home 10.0.22631, native (not WSL)
- MCP host: Claude Code 2.1.270 (desktop app), also reproducible with plain `dart` in PowerShell
- Installed via the official `flutterflow@flutterflow` Claude Code plugin (0.1.6)

Additional Information

This blocks the entire FlutterFlow AI agentic workflow for Windows users: the flutterflow_ai MCP tools (fast-lane patch, list_props, inspect, live session, etc.) are never available, and the Claude Code plugin's documented workflow silently falls back to nothing. The DSL-only path via the CLI still works, so a fix is a one-line change in mcp/server.dart plus a rebuild of the SDK artifact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageA potential issue that has not been confirmed as a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions