MCP Server

Connects an external MCP (Model Context Protocol) server to an AI Agent. All tools exposed by the MCP server become available to the agent automatically — no manual tool configuration needed.

When to Use

Use MCP Server when:

  • You want to connect an agent to an existing MCP-compatible service (Stripe MCP, database MCP, etc.)
  • You need tools that are defined and maintained externally
  • You're integrating with third-party MCP tool providers

For tools that are Tensorify workflows themselves, connect action nodes directly to the agent's Tools handle instead.

Configuration

MCP Server is connected to an AI Agent's Tools handle, like any other tool node.

SettingTypeDefaultDescription
serverUrlstringMCP server URL (e.g. https://mcp.stripe.com or http://localhost:3100/mcp). Supports bindings.
transportTypeselecthttpTransport protocol. Currently only HTTP (Streamable HTTP) is supported.

SSE transport is not yet implemented. Only HTTP (Streamable HTTP) is supported. Most MCP servers use HTTP by default.

Required Secrets

Environment VariableDescription
MCP_API_KEYAPI key for authenticating with the MCP server. This is a single global key shared across all MCP servers connected to an agent.

How It Works

  1. The transpiler generates module-scope code that registers the MCP server with the agent's tool registry
  2. On the first agent request, the tool registry lazily connects to the MCP server and discovers available tools via the MCP protocol's tools/list method
  3. Each discovered tool is converted to a schema the LLM understands (name, description, parameters)
  4. During the agent's ReAct loop, when the LLM decides to call an MCP tool, the runtime invokes it via the MCP protocol's tools/call method
  5. The tool result is passed back to the LLM for the next reasoning step

Example

Connect an agent to Stripe's MCP server:

  1. Add an AI Agent node
  2. Add an MCP Server node
  3. Connect MCP Server to the agent's Tools handle
  4. Set serverUrl to https://mcp.stripe.com
  5. Add MCP_API_KEY to your Environment Variables with your Stripe secret key

The agent can now list customers, create charges, check subscription status, and use any other tool the Stripe MCP server exposes.

Common Gotchas

  • Server must be reachable: The MCP server URL must be accessible from where the workflow runs (your runner's machine for CLI mode, or Tensorify's cloud for Managed mode).
  • Lazy tool discovery: MCP tools are discovered on the first agent request, not at workflow startup. If the MCP server adds new tools, restart the workflow to pick them up.
  • Latency: Each MCP tool call is a network request to the external server. Factor this into your agent's timeout and iteration limits.

See Also

On this page