Connect MCP servers to agents

Direct answer: Put credentials on Connections, drop one MCP Server node per server, aggregate them with MCP Registry, and wire the registry into the AI Agent tools handle. The compiler registers each linked MCP server for the agent at run time.

Tensorify keeps secrets off the canvas (workspace connections / env vars) and keeps the agent graph readable: one tools edge into a registry instead of many parallel tool edges.


Preferred graph

[AI Agent] --tools--> [MCP Registry] --servers--> [MCP Server: Linear]
                                      --servers--> [MCP Server: Flexx]
  1. On Connections, connect OAuth providers or create bearer env vars once.
  2. Drop MCP Registry and wire the agent tools handle to it.
  3. Drop MCP Server nodes (one per server), set provider/URL/auth, wire registry servers → each server.
  4. Export/compile walks registry → servers and registers each MCP for the agent.

Step-by-step

1. Connections

In the app, open Connections (workspace-scoped):

  • Add Linear, GitHub, Flexx, or a custom MCP URL
  • Prefer OAuth where available; otherwise store a token as a workspace env var and reference it by name on the server node

Server nodes bind to a connector or env var name, not a pasted secret in the graph.

2. AI Agent

  1. Create or open a workflow
  2. Add an AI Agent node
  3. Configure model and system prompt as usual

3. MCP Registry

  1. Add an MCP Registry node
  2. Connect AI Agent → tools to the registry

The registry aggregates servers so the agent config stays minimal (one tools edge).

4. MCP Server nodes

Plugin: @tensorify/mcp-tool-provider (UI label: MCP Server).

For each external server:

  1. Drop an MCP Server node
  2. Choose a preset (Linear / GitHub / Flexx) or Custom URL
  3. Set auth: connector binding or apiKeySecret = name of a workspace env var (not the raw token)
  4. Connect MCP Registry → servers to this node

Repeat for every MCP server the agent should use.

5. Test and deploy

  1. Use Run to selected on the agent with a prompt that should invoke a tool
  2. Inspect tool calls and outputs on the canvas
  3. Deploy (Managed or CLI runner)

Legacy paths (still supported)

  • Wire an MCP Server directly to the agent tools handle (no registry)
  • Agent settings.mcpServers JSON still compiles until fully migrated — prefer the graph above

This guide is outbound MCP (your agent calls Linear/Flexx/etc.).

Persona overview: AI agents on Tensorify.


FAQ

Why not put the API key on the node?
So secrets stay in Connections / env vars, rotate without editing the graph, and never ship inside exported TSL by accident.

Can one agent use multiple MCP servers?
Yes. One registry, many MCP Server nodes on the servers handle.

What if a tool does not appear?
Confirm the workflow is saved, the server node auth resolves, and the upstream MCP lists tools successfully. Check run logs on the agent node for registration errors.


Next steps


TSL (Code mode / agents)

Prefer MCP Registry (not legacy MCP Server / mcp-tool-provider):

import Api from @tensorify/api-trigger:1.0.0
import Agent from @tensorify/ai-agent:1.0.0
import Registry from @tensorify/mcp-registry:1.0.0
import Return from @tensorify/return:3.0.0

node api @tensorify/api-trigger:1.0.0 {
    path = "/agent"
    allowedMethods = ["POST"]
    responseMode = "use-workflow-response"
}

node tools @tensorify/mcp-registry:1.0.0 {
    # Configure server list / connection refs in UI; agents: get_plugin_manifest
}

node agent @tensorify/ai-agent:1.0.0 {
    provider = "openai"
    model = "gpt-4o"
    systemPrompt = "You can use MCP tools from the registry."
    maxIterationsMode = "unlimited"
    _secret_bindings = { OPENAI_API_KEY: "OPENAI_API_KEY" }
}

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

api.POST -> agent.message
tools.tools -> agent.tools
agent.response -> out.input
On this page