MCP Integration
MCP tools are represented by mcp_tool nodes and exposed to agents as callable tool definitions.
Concepts: What is MCP? explains the Model Context ProtocolModel Context Protocol (MCP): An open protocol that lets AI applications discover and use tools, data and prompt templates from separate servers through one standard set of JSON-RPC messages. from the start. Too many tools explains why to keep each agent's tool list short.
Built-in MCP adapters
An adapter is how L2M reaches a server. Pick one when you register a server or configure an MCP Tool node inline.
| Adapter id | For | Notes |
|---|---|---|
http_mcp | A remote server over Streamable HTTP | Secret or OAuth credentials, or per-user delegated credentials. |
stdio_mcp | A local server L2M starts as a child process (npx, node, python3, ...) | Speaks JSON-RPC over stdin and stdout; can run in a container sandbox. |
mock-mcp | Demos and local checks | Time, calculator and knowledge-base tools, a tool that asks the person a question and one that asks the model for a completion, plus resources and a prompt. No network. |
l2m-tools | Built-in agent tools | Wikipedia, SearXNG and SerpAPI web search and Wolfram Alpha, served by the API itself. |
l2m-workflow | Workflow tools | Another workflow, called by an agent as a tool. |
snapshot_mock | Offline tests | A stub generated from a registered server's accepted tool snapshot; answers from a cassette or from each tool's output schema. See Testing MCP workflows. |
The rate limits, concurrency limits and circuit breaker set on a registered server apply to servers using http_mcp, stdio_mcp, mock-mcp or l2m-tools. A community package can add more adapters with registerMCPAdapter (see Community nodes).
Protocol versions
http_mcp and stdio_mcp speak both MCP eras: servers that open a session with initialize (protocol versions up to 2025-11-25) and servers that speak 2026-07-28. By default L2M opens a server with initialize, and switches to 2026-07-28 by itself when a server only speaks that version. Each server's Protocol version setting (protocolMode: legacy, auto or modern) and the deployment default MCP_CLIENT_PROTOCOL_DEFAULT change that. See MCP 2026-07-28 support.
How it works
- Configure MCP node endpoint/auth
- Discover tool list from server
- Select one, many, or all tools
- Attach MCP node(s) to agent
toolport - Agent runtime passes tool schemas to model
- Model invokes tools dynamically during loop
MCP tool policy decides which tools each role may call, and the agent loop explains how calls and results flow.
Setting up an MCP Tool node for a real endpoint
Use an MCP Tool node attached to the Agent tool port.
- Open the MCP node config.
- Set
MCP Server AdaptertoHTTP MCP Server (http_mcp). - Set
Endpointto your MCP server URL. - Set
Request Timeout (ms)for the tool's latency (for large fetches use60000to300000). - Set
Authentication(None,BearerorBasic) and choose anAuth Secretif needed. - Click
Discover Tools, then select the discovered tool. - To expose every discovered tool to the agent, set
Tools To IncludetoAll discovered tools (agent decides).
Notes:
mock-mcpis a demo adapter and always returns the demo toolsget_current_time,calculatorandlookup_kb.- For a new adapter implementation, select
Custom Adapter IDand register the adapter inpackages/mcp-sdk/src/index.ts. - If a server exposes many large tool schemas, model context limits can be hit. The runtime compacts tool schemas, truncates oversized tool outputs in conversation memory, and caps the tool metadata sent to the model.
- Every tool an MCP Tool node selects is sent to the model, so for large servers prefer
Select multiple tools. A keyword shortlist by prompt relevance applies only to an agent with no MCP Tool or Workflow Tool node, whose tools come from its inlinemcpServersconfig; Supervisor workers are always offered.
Best practices
- Keep selected tool set minimal per workflow
- Use concise tool descriptions
- Validate discovery output before enabling
all tools - Register servers in the MCP server registry rather than inline, so health checks, snapshots and policy apply