Skip to main content

MCP

Connects to an arbitrary Model Context Protocol (MCP) server — stdio subprocess or HTTP+SSE — and dynamically exposes whatever tools that server provides to the agent. Hundreds of community MCP servers exist for databases, APIs, filesystems, browsers, and more.

Add to an agent node's tools array with _node_type: "tool-mcp". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
transportNoTransport to use: stdio (default) or http (also accepts sse).
commandYes (stdio)Full command to start the MCP server subprocess, e.g. npx @modelcontextprotocol/server-postgres.
envNo (stdio)Comma-separated KEY=VALUE pairs to add to the subprocess environment.
urlYes (http)URL of the HTTP/SSE MCP server.
bearer_tokenNo (http)Optional token sent as Authorization: Bearer <token>.
{
"name": "mcp",
"_node_type": "tool-mcp",
"transport": "stdio",
"command": "npx @modelcontextprotocol/server-postgres"
}

How tool discovery works

Unlike other connectors, MCP has no fixed tool list in the source — tools are discovered live from the target MCP server at agent setup time:

  1. Connect. For transport: "stdio", OrcFlows starts command as a subprocess (with any extra env vars merged into its environment) and speaks JSON-RPC 2.0 over its stdin/stdout. For transport: "http"/"sse", it sends JSON-RPC 2.0 POST requests to url, with Authorization: Bearer <bearer_token> if set.
  2. Initialize. Sends an initialize request (protocol version 2024-11-05) followed by an notifications/initialized notification (stdio only).
  3. List tools. Sends a tools/list request. The server responds with an array of tool definitions, each with a name, description, and JSON Schema inputSchema.
  4. Wrap and expose. Each discovered tool is wrapped as an Eino BaseTool whose name, description, and parameters (including which are required) come directly from the server's inputSchema — JSON Schema types integer/number, boolean, array, and object map to the corresponding agent parameter types, everything else maps to string.
  5. Invoke. When the agent calls a discovered tool, OrcFlows sends a tools/call request with name and arguments, and returns the concatenated text content of the response (or an "Error from MCP server: ..." message if the server reports an error).

If the server returns zero tools, or command/url is missing, the connector setup fails with an error.

Because the tool set comes entirely from the target server, the actions filter on the tools entry works the same way as for other connectors — it filters by whatever tool names the MCP server reports.

Example configurations

The file's doc comment lists these example MCP servers as command values for stdio transport:

CommandProvides
npx @modelcontextprotocol/server-postgresPostgreSQL queries
npx @modelcontextprotocol/server-filesystemFile read/write
npx @modelcontextprotocol/server-githubGitHub API
npx @modelcontextprotocol/server-slackSlack API
npx @modelcontextprotocol/server-brave-searchBrave web search
npx @modelcontextprotocol/server-puppeteerBrowser automation
npx mcp-server-sapSAP HANA / OData
npx @modelcontextprotocol/server-google-adsGoogle Ads (community)

stdio transport

{
"name": "postgres",
"_node_type": "tool-mcp",
"transport": "stdio",
"command": "npx @modelcontextprotocol/server-postgres",
"env": "DATABASE_URL={{ secret.DATABASE_URL }}"
}

HTTP/SSE transport

{
"name": "remote_mcp",
"_node_type": "tool-mcp",
"transport": "http",
"url": "https://mcp.example.com/v1",
"bearer_token": "{{ secret.MCP_BEARER_TOKEN }}"
}

Next