Agent commands. Your AI agent uses this node in workflows. You manage the MCP servers that provide these tools with
pflow mcp commands.How it works
- Add an MCP server with
pflow mcp add— it discovers the server’s tools right away - Re-sync with
pflow mcp syncafter editing the config file or fixing a server that failed - Tools become nodes named
mcp-{server}-{tool} - Agent uses them like any other node
Node naming
MCP tools become nodes with the patternmcp-{server}-{tool}:
Parameters
MCP node parameters come from the tool’s input schema. Each MCP server defines its own tools with their own parameters. pflow also adds two parameters to every MCP node. They control the call and are never sent to the server:
To see a tool’s parameters:
Output
All MCP nodes write to:
For dict results, read nested fields through
result:
If a tool returns {"issue_url": "...", "issue_number": 123}, use:
${node.field} and do not
write a {server}_{tool}_result alias. Each workflow node already has its own
namespace, so ${node.result} is the canonical success output.
Example workflow
Code passed to a tool
Some tools take JavaScript to run:function of evaluate_script (chrome-devtools) and browser_evaluate (Playwright), initScript of navigate_page, and code of browser_run_code_unsafe. pflow sends that code exactly as written, so a ${...} inside it is JavaScript’s own template literal, not a template variable. A workflow value goes in as ${x|json}, which inserts it as a JavaScript value: a string arrives quoted and escaped ("Don't Stop"), a boolean as true, an object as an object literal.
stdout, arrives as a string: parse it with JSON.parse(${fetch.stdout|json}). $${...} is sent unchanged here too. |json is accepted only in these parameters, and validation points out a ${...} in the code that names a workflow value, with the |json form to use.
Setup
To use MCP tools, first add MCP servers to pflow. See Adding MCP servers for configuration format, authentication, and examples. pflow supports both local (stdio) and remote (HTTP) MCP servers. Both work identically in workflows - same naming, parameters, and output structure.Server lifetime
Each run, and eachpflow probe, connects to its MCP servers and disconnects at the end. A stdio server starts and stops with the run, so every run begins clean. That is the right default for a saved workflow, but anything the server holds in memory (an open browser page, a notebook kernel) is gone before the next call. State the server writes to disk, such as a browser profile, survives either way.
When your agent needs to explore step by step across separate calls, keep one server process alive outside pflow. Run the stdio server behind mcp-proxy, which starts a single child and shares it with every connection, and register the proxy as an HTTP server:
@playwright/mcp, --port starts the next run at about:blank, while behind the proxy the open page, localStorage and session cookie carried across separate runs. Everything that uses the long-lived registration shares one server and its state, so confirm a finished workflow against the normal run-scoped registration.
Error handling
MCP nodes returnerror action on:
- Connection failure: Server not reachable
- Tool error: Tool reported an error (via
isErrorflag) - Timeout: The call took longer than
timeoutseconds (default 30)
When tools are synced
pflow mcp add discovers tools from the servers it adds. Running a workflow never contacts servers to discover tools — it uses the tools already in the registry.
Run pflow mcp sync <server> (or --all) when:
pflow mcp addreported a server it could not reach (fix the token or start the server, then sync)- You edited
~/.pflow/mcp-servers.jsonby hand - A server added or changed its tools

