MCP Tools

Expose flows as Model Context Protocol tools. LLM agents can discover and call flowgen flows as tools over the MCP transport.

Configuration

The MCP server must be enabled in the worker config:

worker:
  mcp_server:
    enabled: true
    port: 3001
    path: /mcp/v1
    credentials_path: /path/to/credentials.json

Individual flows register as MCP tools using the mcp_tool task:

- mcp_tool:
    name: lookup_user
    description: "Look up a user by ID."
    input_schema:
      type: object
      properties:
        user_id:
          type: string
      required:
        - user_id

Fields

FieldTypeDefaultDescription
namestringrequiredTool name. Combined with the flow name as {flow_name}.{name} to form the full tool identifier.
descriptionstringrequiredHuman-readable description shown to LLMs for tool selection.
input_schemaobjectJSON Schema for the tool’s input parameters.
credentials_pathstringPath to credentials file for this tool. Overrides worker.mcp_server.credentials_path.
ack_timeoutdurationwait indefinitelyMax time to wait for flow completion before returning a timeout error to the MCP client.
authobjectPer-tool authentication config. When auth.required is true, requests must include a valid bearer token validated by the worker auth provider; the resolved user context is injected into event.meta.auth.
depends_onlistUpstream task names.
retryobjectRetry configuration.

The MCP server listens on the configured port and exposes registered tools over the MCP Streamable HTTP transport.

Output

Format: JSON

FieldTypeDescription
argumentsobjectTool input parameters from the MCP tools/call request, structured per the configured input_schema.