Tools
MCP_LOCAL_RUN
- Starts a local MCP server as a subprocess (stdio transport) and calls one of its tools
- Single
mcpinput (configured in the step editor) withcommand(defaultnpx),args(default["-y"]), optionalenv, the fetchedtoolslist, theselectedToolID, andtoolInputsfor that tool command,selectedTool, andtoolInputsare required at run time; otherwise the step fails withMissing required fields: command, selectedTool, or toolInputs
MCP_REMOTE_RUN
- Connects to a remote MCP server over Streamable HTTP and calls one of its tools
- Single
mcpinput withserver_url, optionalheaders(for example anAuthorizationheader), the fetchedtoolslist, theselectedToolID, andtoolInputs server_url,selectedTool, andtoolInputsare required at run time; otherwise the step fails withMissing required fields: server_url, selectedTool, or toolInputs
Authentication
MCP tools have noconfig of their own. Pass credentials through the mcp input: env for a local server (for example an API key the server reads from its environment) or headers for a remote server. Store secrets as Flow secrets and reference them with {{secrets.NAME}}.
Call a tool on a local MCP server
Replaceyour-mcp-server-package, read_document, and the toolInputs with the package, tool name, and input schema of the MCP server you fetched in the step editor.
Call a tool on a remote MCP server
Read the result
result holds what the MCP tool returned:
- If the tool returns
structuredContent,resultis that object. - Otherwise,
resultis the text of the tool’s content blocks: a single string when there is one block, or an array of strings when there are several. If that text is JSON, it is parsed, soresultcan be an object or array. - If the tool returns no content,
resultisnull.
steps.<id>.result for your server before referencing nested fields in later steps.
Error Handling
- Missing fields:
MissingFieldsErrorwhencommand/server_url,selectedTool, ortoolInputsare not set — open the step, fetch tools, and complete the setup. - Server or tool errors: an exception raised while connecting to the server or calling the tool fails the step with
An error occurred while the tool was executing: ...in the step error (MCP_REMOTE_RUNreportsAn error occurred while the tool was executing.without the detail).
Use Cases
- Data Processing: Advanced data transformation and analysis
- Document Processing: Complex document parsing and extraction
- AI/ML Integration: Machine learning model execution
- Custom Workflows: Domain-specific business logic execution
- External API Integration: Wrapper for external services
- Batch Processing: Large-scale data processing operations
- Specialized Tools: Industry-specific processing tools
- Research Tools: Academic and scientific computing tools
Best Practices
Performance Optimization
- Use local servers for frequent operations
- Use remote servers for compute-intensive tasks
- Keep
toolInputssmall; pass file URLs rather than file contents where the server supports it
Security Considerations
- In an organization with an egress policy, a local MCP server runs in the same kind of locked-down sandbox as Python code: no
sudo, no globalnpm install -g, and HTTP(S) only to allowed hosts.npx -y <package>still works when the npm registry is an allowed host. See Python Sandbox. - Secure authentication tokens: pass them through
envorheadersfrom Flow secrets - Validate all inputs and outputs
- Use HTTPS for remote connections
- Implement proper error handling
Development Guidelines
- Document custom MCP tools thoroughly
- Implement proper logging and monitoring
- Use consistent input/output schemas
- Test tools thoroughly before deployment