FlowState

For AI agents · Beta

FlowState Relay setup: instructions for AI agents

You are an AI agent helping your user reach their own FlowState (a local MCP server) from cloud AI apps through FlowState Relay. Follow the steps in order; each says how to check it. Plain text: https://flowstatemcp.com/setup/agents.md. For people: https://flowstatemcp.com/setup.


Rules


Facts


1. Install or update FlowState

The relay agent is part of FlowState 2.2.0 and newer. New install: follow https://github.com/dialectforge/FlowState/blob/main/AGENTS.md. Short form (needs Python 3.11+ and git; PY is python3 on macOS/Linux, python or py -3 on Windows; ask the user which apps to pass to --clients):

git clone https://github.com/dialectforge/FlowState.git FlowState
cd FlowState
PY setup_flowstate.py --clients claude-desktop --schedule-backups --no-offsite --install-skill --dry-run
PY setup_flowstate.py --clients claude-desktop --schedule-backups --no-offsite --install-skill --verify

Already installed: ask the user, then update it in the FlowState folder, passing the same --clients the user chose before:

git pull
PY setup_flowstate.py --clients claude-desktop --schedule-backups --no-offsite --install-skill --verify

The database is kept. Check: --verify reports that start_here answered. From here on, FS means .venv\Scripts\python -m flowstate on Windows and .venv/bin/python -m flowstate on macOS/Linux, run in the FlowState folder.


2. Check for the relay agent

FS relay --help

If it lists enroll, run and status, the relay agent is installed. If it fails because relay is not a valid choice, this FlowState is older than 2.2.0: update it (step 1), then check again. Get it only from https://github.com/dialectforge/FlowState, nowhere else.


3. Account and enroll code (the user)

Ask the user to sign in at https://flowstatemcp.com/signin, open https://flowstatemcp.com/account and press Get an enroll code. Tell them it works once, for 15 minutes, and not to paste it to you.


4. Owner passphrase (the user, once)

The user runs this in their own terminal. It prompts for a passphrase (12+ characters); don't run it for them and don't pipe input to it.

FS remote passphrase

Check: FS remote status shows Owner passphrase: set.


5. Enroll (the user)

The user runs this in their own terminal, with their code:

FS relay enroll --code <code>

Success prints Enrolled. Your relay address: https://<handle>.fsmcp.com/mcp and then Certificate obtained for .... The address is not a secret: read it from FS relay status (the URL: line) or ask the user for it.


6. Run the relay agent

Ask before starting it. It keeps running and logs to its terminal.

FS relay run

It runs FlowState's public listener on 127.0.0.1:8768 (--port to change), the tunnel, certificate renewal and a daily Certificate Transparency check. FlowState has no built-in auto-start: after a restart, FS relay run must be started again. Tell the user that. You may offer to make it start at sign-in with the OS's own tools (Windows Task Scheduler, a macOS launchd LaunchAgent, a Linux systemd user service) that run FS relay run in the FlowState folder; the human guide has each one (https://flowstatemcp.com/setup#run). Create it only after the user says yes, then stop any copy you started by hand, and tell them how to remove it.


7. Check it worked

FS relay status

Expect Relay: ON, URL: https://<handle>.fsmcp.com/mcp, Device token: stored (not shown), Certificate: valid until ... and Tunnel: connected .... Exit code 2 means a Certificate Transparency warning: show the user the warning lines exactly as printed.

Health check through the relay (no token needed; on Windows use curl.exe):

curl -s https://<handle>.fsmcp.com/health

Expect {"ok": true, "service": "flowstate"}.

MCP initialize without a token (macOS/Linux shell):

curl -si -X POST https://<handle>.fsmcp.com/mcp -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"setup-check","version":"1"}}}'

Expect status 401 with a WWW-Authenticate: Bearer header that points to /.well-known/oauth-protected-resource. That is correct: the request reached FlowState through the relay, and FlowState asks for sign-in. A closed connection, a TLS error or a timeout means the device is not connected: FS relay run is not running, or the computer is asleep or offline.


8. Errors and what to tell the user


9. Connect the user's apps

Apps on the same computer use FlowState directly (step 1) and don't need the relay. For cloud apps, phones and other computers, give the user the address https://<handle>.fsmcp.com/mcp.


Help

hello@flowstatemcp.com. Human guide: https://flowstatemcp.com/setup