MCP Trigger

Expose this workflow as an MCP tool callable by external AI agents (Claude Desktop, Cursor, Windsurf, etc.).

When to Use

Use MCP Trigger when:

  • You want external AI agents to discover and call your workflow as a tool
  • You need to expose business logic (search, create, lookup) to MCP-compatible clients
  • Other agents should invoke your workflow and receive a structured response via a Return node

For connecting your workflow's AI Agent to external MCP servers, use MCP Tool Provider instead.

Output

HandleTypeDescription
mcpobjectMCP tool call context

The mcp (accessed as {{ mcp.* }}) shape:

FieldTypeDescription
tool_namestringThe tool name from the MCP call
argumentsanyFull arguments object passed by the calling agent
call_idstringUnique identifier for this tool invocation

Settings

Tool Definition

SettingTypeDefaultDescription
tool_namestringThe name external agents see when discovering this tool (e.g. create_invoice, search_docs). Required.
tool_descriptiontextHelp agents understand when and how to use this tool. Be descriptive. Required.
parameterscode editor (JSON)JSON Schema with query propertyJSON Schema defining what parameters the tool accepts. External agents validate arguments against this schema. Required.

Behavior

SettingTypeDefaultDescription
responseModeselectuse-workflow-responseuse-workflow-response waits for the workflow Return node and sends the result back to the agent. ack-immediately returns a success message instantly.
timeoutnumber30Maximum seconds to wait for workflow response before timing out (only applies in use-workflow-response mode).

Testing

SettingTypeDefaultDescription
mockPayloadcode editor (JSON)JSON body to inject when running this workflow locally for testing.

Example

Canvas

A documentation search tool exposed to MCP clients:

  1. Set tool_name to search_docs
  2. Set tool_description to "Search the documentation knowledge base and return relevant results"
  3. Set parameters to a JSON Schema with query (string, required) and limit (number, optional)
  4. Connect the mcp output to your search logic, then wire a Return node

Access tool call data in downstream nodes:

{{ mcp.arguments.query }}
{{ mcp.arguments.limit }}
{{ mcp.call_id }}

After deploying, add the tool to your MCP client config:

{
  "mcpServers": {
    "tensorify-tools": {
      "url": "https://mcp.tensorify.io/v1/triggers",
      "headers": {
        "Authorization": "Bearer tfk_your_api_key_here"
      }
    }
  }
}

Or run tensorify mcp config to generate the config automatically.

TSL

import mcp from @tensorify/mcp-trigger:1.0.0
import http_request from @tensorify/http-request:3.0.0
import return_node from @tensorify/return:3.0.0

node trigger @tensorify/mcp-trigger:1.0.0 {
    tool_name = "search_docs"
    tool_description = "Search the documentation knowledge base"
    parameters = "{\"type\": \"object\", \"properties\": {\"query\": {\"type\": \"string\"}}, \"required\": [\"query\"]}"
    responseMode = "use-workflow-response"
    timeout = 30
}

node search @tensorify/http-request:3.0.0 {
    method = "GET"
    url = "https://api.example.com/search?q={{ mcp.arguments.query }}"
}

node respond @tensorify/return:3.0.0 {
    returnMode = "simple"
}

trigger.mcp -> search.body
search.response -> respond.input

Common Gotchas

  • When responseMode is use-workflow-response, you must connect a Return node — otherwise the agent's call times out after timeout seconds.
  • tool_name, tool_description, and parameters are all required. Agents use the description and schema to decide when and how to call your tool.
  • parameters must be valid JSON Schema. Invalid schema prevents agents from calling the tool correctly.
  • MCP Trigger exposes your workflow as a tool (server role). MCP Tool Provider connects your AI Agent to external tools (client role).

See Also

On this page