Build an MCP agent with no API key in 5 minutes
What you get: One agent with a chat model and two MCP tools, a clock and a calculator, that runs on a fresh install.
Needs: No API key · Time: 5 minutes · Nodes: 6
A manual trigger starts one Agent Orchestrator node. Its chat model is the built-in echo provider, and its tools come from the mock MCP server that runs inside L2M: get_current_time and calculator. Nothing needs a key, a network connection or a separate server. Echo is not a real model: it repeats the prompt back and never asks for a tool, so a local run makes one model call and ends. That proves the wiring works. To see the agent call tools, attach a real chat model.
Steps
Download mcp-agent-quickstart-flow.json, or take it from the samples folder on GitHub.
In the studio's workflow editor, import the file (see import and export).
Click Run in the editor, or call the run API with your own question. The API takes an API key from Settings → Account → API Keys:
bashcurl -X POST http://localhost:4000/api/workflows/wf-mcp-agent-quickstart/execute \ -H "Authorization: Bearer $L2M_API_KEY" \ -H "Content-Type: application/json" \ -d '{"user_prompt": "What is 2340 * 0.17?"}'Open the run in the execution history and click the Agent node to read its trace.
Then change one thing at a time (see below).
How it works
| Node | Type | Role |
|---|---|---|
| Manual Trigger | manual_trigger | Step in the run |
| Agent | agent_orchestrator | Step in the run |
| Output | output | Step in the run |
| Chat Model (echo) | llm_call | Attached to Agent on its chat_model port |
| MCP: get_current_time | mcp_tool | Attached to Agent on its tool port |
| MCP: calculator | mcp_tool | Attached to Agent on its tool port |
5 node types. Each type links to its config fields in the node reference.
What a run does
We imported the file into a fresh install and ran it with the question above. The run succeeded in well under a second:
- The Agent made one model call. The model was offered the two tools as
mock-mcp__get_current_timeandmock-mcp__calculator; L2M also adds a short note to the system prompt about its built-insession_cache_list,session_cache_getandagent_clarifytools. - Echo answered
Echo: What is 2340 * 0.17?. The agent stopped after 1 iteration withstopReason: "final_answer", and the Output node returned that text asresult. - The two MCP Tool nodes are marked as used by the agent: they supplied the tool definitions. No tool ran, because echo asked for none.
An empty question fails the run: the agent's user prompt template is {{user_prompt}}, and with nothing in it the Agent stops with "Agent Orchestrator user prompt is empty after template rendering".
See the loop with tool calls
The demo's copy of this workflow plays an echo run too, so it shows no tool calls either. The demo's Support agent workflow plays a run recorded with a scripted stand-in model, so the demo needs no key. In that run the agent calls a knowledge-base tool once and a calculator tool twice before it answers: open it in the demo.
Make it yours
- Replace the echo chat model node with a real one (OpenAI, Anthropic, Ollama or any OpenAI-compatible endpoint) on the agent's
chat_modelport. A model that supports tool calling can then call the clock and the calculator. - Replace the mock MCP tools with a server from your MCP server registry, such as a filesystem or database server.
- Write your own system prompt on the agent node, and raise
maxIterations(4 in the sample) only if the task needs more steps.
Make it safer
These controls are optional; the recipe runs without them.
calculatorhas no read-only annotation, so L2M counts it as a write tool. Turn on the workflow's No write tools setting and it is blocked for the agent, while the clock stays. See MCP tool policy.- Require a person's approval before write tools run: see human approval for agent tool calls.
- Cap model spend with a budget.