How to Add Web Search to Langflow (MCP)
Langflow lets you build AI agents on a visual canvas: an Agent component, a chat model, and tools wired into its Tools port. Out of the box the model only knows what it was trained on. To answer questions about this week's release, a changelog or today's news, the agent needs live web search. Langflow is an MCP client, so you can plug in any Model Context Protocol server as a tool. This guide adds Langflow web search with the AgentSearch MCP server and the MCP Tools component.
Search works right away with no API key, no signup and no wallet: 25 free searches per IP in total, then pay per call. The 25 is a lifetime allowance, not a daily one, and it never resets.
What we actually ran (November 27, 2026): Langflow 1.13.4 (the latest release on PyPI) in a fresh Python virtual environment on Linux, with @agentsearchhq/agentsearch-mcp 1.8.7 and Node.js 24. We added the server in the Langflow UI through Settings → MCP Servers → Add MCP Server, both with the JSON tab and the STDIO fields. Langflow listed it as "8 tools". We then added it to the Simple Agent starter flow from the MCP sidebar and turned on Tool Mode, and the component showed the server's tools under Actions. We also made one real free search through Langflow's own MCP stdio client. We did not run a chat model in the Playground, and we didn't test Windows, Docker or Langflow Desktop.
What the agent gets (and what it costs)
The server exposes eight tools. All of them showed up in Langflow:
agentsearch_web_search, agentsearch_extract, agentsearch_search_and_read,
agentsearch_news_search, agentsearch_render, agentsearch_screenshot,
agentsearch_review_lookup, agentsearch_review_submit
For research agents, these three matter most:
| Tool | What it does | Cost |
|---|---|---|
agentsearch_web_search |
Live web search, up to 5 results with title, URL and a text snippet | 25 free searches per IP in total (never resets), then $0.003 per call |
agentsearch_extract |
Any public URL as clean markdown | Free trial: 5 a day per IP, then $0.002 per call |
agentsearch_search_and_read |
Search plus the page text of the top hits, in one call | 10 free calls per IP in total, then $0.005 per call |
There's no account and no API key at any tier, and no minimum spend. Paid calls use x402: the API answers with a 402 and a price, the MCP server signs a small USDC payment on Base, and you're only charged when a usable answer comes back. The other tools cover news ($0.003 per call), JavaScript-heavy pages (Web Render), screenshots and a free board of agent-written reviews of web tools.
Before you start
- Langflow running locally or on your own server. We used 1.13.4, installed with
uv pip install langflowand started withuv run langflow run. - Node.js (an LTS release) with
npxon thePATHof the Langflow process, because the server runs withnpx. Langflow's docs say this explicitly: to usenpxMCP servers you need Node.js, and in Docker you have to install Node.js inside the image and rebuild. - A chat model set up on the Agent component that supports tool calling. Search itself needs no extra key.
Step 1: Register the MCP server
In Langflow, MCP servers are registered once and then reused in any flow. Open the add dialog one of two ways:
- Click your profile icon, select Settings, open MCP Servers, and click Add MCP Server.
- Or, in the flow editor, click MCP in the left sidebar, and then click Add MCP Server at the bottom.
The Add MCP Server dialog has three tabs: JSON, STDIO and Streamable HTTP/SSE. Use either of the first two.
JSON tab. Paste this into the box and click Add Server:
{
"mcpServers": {
"agentsearch": {
"command": "npx",
"args": ["-y", "@agentsearchhq/agentsearch-mcp"]
}
}
}
This is the same mcpServers shape most MCP clients use, so a block you already have from another client usually pastes as is. The key (agentsearch) becomes the server name.
STDIO tab. Fill in the fields instead:
- Name:
agentsearch - Command:
npx - Arguments:
-yin the first box. Click + next to Arguments and put@agentsearchhq/agentsearch-mcpin the second. Each argument gets its own box. - Environment Variables: leave empty for free search.
Click Add Server. Langflow starts the server to check it. The first run downloads the package, so give it a few seconds. When it connects, the server appears under Added MCP Servers as agentsearch with 8 tools.
The -y tells npx to install without asking, since nobody can answer a prompt from a background process. Langflow's command checks allow -y for npx.
Step 2: Add the MCP Tools component to your flow
Open your flow (or start from the Simple Agent template), and then:
- Click MCP in the left sidebar. Your registered servers are listed under MCP Servers.
- Click + next to
agentsearch, or drag it onto the canvas. Langflow adds an MCP Tools component with MCP Server already set toagentsearch. - Select the component and turn on Tool Mode in its header menu. The Tool dropdown is replaced by an Actions list (we saw
AGENTSEARCH_WEB_SEARCH,AGENTSEARCH_EXTRACT,AGENTSEARCH_SEARCH_AND_READ,AGENTSEARCH_NEWS_SEARCHand "+4 more"), and the output becomes Toolset. - Connect the MCP Tools component's Toolset port to the Agent component's Tools port.
- Make sure the Agent has Chat Input and Chat Output attached. The Simple Agent template already does.
You don't have to search for "MCP Tools" in the Components list. In recent Langflow versions, you add it from the MCP sidebar, which is also what Langflow's docs describe.
The Simple Agent template comes with a couple of tools already connected. You can keep them next to AgentSearch or remove them. The agent picks tools by their descriptions, and each AgentSearch tool's description says what it's for.
Step 3: Try it in the Playground
Open Playground and ask something the model can't know from training data:
Search the web for the latest Langflow release notes, read the release page,
and list the three biggest changes. Cite the URLs.
The agent sees each tool's own arguments: query, max_results, freshness, include_domains and more for search, and url and max_chars for extract. A good pattern is to search first and then read only the page you need.
Here's what one real free search through Langflow's MCP client returned for Langflow MCP Tools component STDIO with max_results: 3 (trimmed):
{
"query": "Langflow MCP Tools component STDIO",
"result_count": 3,
"results": [
{
"title": "MCP Tools",
"url": "https://docs.langflow.org/mcp-tools",
"domain": "docs.langflow.org"
},
{
"title": "MCP Tools",
"url": "https://docs.langflow.org/1.8.0/mcp-tools",
"domain": "docs.langflow.org"
},
{
"title": "Use Langflow as an MCP client",
"url": "https://docs.langflow.org/mcp-client",
"content": "MCP Tools component in STDIO mode Test your flow to make sure the MCP server is connected and the selected tool is used by the agent.",
"domain": "docs.langflow.org"
}
]
}
Results are snippets, not whole pages. For full pages, use Extract or Search + Read.
Going past the free tier: pay per call with x402
When the 25 free searches are used up, add a wallet. Use a new, dedicated wallet holding a few dollars of USDC on Base, never your main one. The MCP server reads these environment variables:
| Variable | What it does |
|---|---|
AGENTSEARCH_WALLET_PRIVATE_KEY |
Key of the dedicated wallet. Turns on the paid tools. |
AGENTSEARCH_MODE=paid |
Also makes search paid ($0.003 per call). A wallet key alone keeps search on the free tier. |
AGENTSEARCH_MAX_TOTAL_ATOMIC |
Spend cap per server session in USDC atomic units (default 1000000, which is $1.00). |
AGENTSEARCH_MAX_PER_CALL_ATOMIC |
Optional lower cap per call. |
Keep the key in a Langflow global variable, not in the server config. Langflow can fill an MCP server's environment variable from a global variable:
- Click your profile icon, select Settings, and open Global Variables. Create a Credential variable, for example
AGENTSEARCH_WALLET_KEY, with the dedicated wallet's key as its value. - Edit the
agentsearchserver: in Settings → MCP Servers, click ... next to it and select Edit. Under Environment Variables, add the keyAGENTSEARCH_WALLET_PRIVATE_KEYand, as its value, type the name of your global variable:AGENTSEARCH_WALLET_KEY. - Add
AGENTSEARCH_MODE=paidandAGENTSEARCH_MAX_TOTAL_ATOMIC=200000($0.20 per session) the same way, and click Update Server.
As JSON, the same server looks like this. AGENTSEARCH_WALLET_KEY is the global variable's name, not the key itself:
{
"mcpServers": {
"agentsearch": {
"command": "npx",
"args": ["-y", "@agentsearchhq/agentsearch-mcp"],
"env": {
"AGENTSEARCH_WALLET_PRIVATE_KEY": "AGENTSEARCH_WALLET_KEY",
"AGENTSEARCH_MODE": "paid",
"AGENTSEARCH_MAX_TOTAL_ATOMIC": "200000"
}
}
}
}
We checked the substitution with a small test server that recorded its own environment. When an environment value matched a global variable's name, the server process received the variable's stored value, not the name. When you open the server again with Edit, Langflow shows the environment values as ********.
Live prices on November 27, 2026, from AgentSearch's own x402 API at api.agentsearchhq.com: search $0.003, news $0.003, extract $0.002, search-and-read $0.005, paid in USDC on Base. No signup, no API key, no minimums. We loaded this paid config with a dummy key and Langflow listed the 8 tools. We didn't run a paid call for this post. New to per-call payments? Read x402 pay-per-call APIs for AI agents.
Gotchas we hit
Variables you export in your shell don't reach the server. Langflow starts a STDIO server with only a few basics (PATH, HOME, USER and a couple of others) plus what you put under Environment Variables. Our test server didn't see anything else from the shell that started Langflow. Set everything the server needs in the server config or through global variables.
Some variable names are refused. Langflow blocks environment variables that can change how a runtime loads code. Adding NODE_OPTIONS failed with "Environment variable 'NODE_OPTIONS' is not allowed for security reasons". The AgentSearch variables above are accepted.
The Environment Variables field has no global-variable picker. In the STDIO tab, the Headers value boxes have a globe icon for choosing a global variable, but the Environment Variables value boxes don't. Type the variable's name by hand, as shown above.
Langflow 1.13 wants a superuser password at startup. Our first langflow run stopped with "Username and password must be set. Set LANGFLOW_SUPERUSER_PASSWORD before starting Langflow." Recent official packages default to LANGFLOW_AUTO_LOGIN=false, so set LANGFLOW_SUPERUSER_PASSWORD (and LANGFLOW_SUPERUSER if you don't want the default username langflow) before the first start, then sign in.
Troubleshooting
Run the server by itself. Run npx -y @agentsearchhq/agentsearch-mcp in a terminal. A healthy server prints a line starting agentsearch-mcp listening on stdio to stderr and waits (Ctrl+C to stop). On npx: command not found or an engine error, install a Node.js LTS release where Langflow runs. In Docker, that means inside the container image.
Server shows an error or timeout in Settings → MCP Servers. The first npx run downloads the package. Langflow waits up to 60 seconds for a server to connect by default (LANGFLOW_MCP_SERVER_TIMEOUT). You can also install the package globally (npm i -g @agentsearchhq/agentsearch-mcp) and register it with Command agentsearch-mcp and no arguments. Slow tool calls have a separate Tool Execution Timeout (seconds) setting on the MCP Tools component.
The agent doesn't use the tools. Check that Tool Mode is on and that the Toolset port is connected to the Agent's Tools port. Also check that the Agent's model supports tool calling.
HTTP 429 from search or extract. You've used the free allowance: the 25 lifetime searches for your IP, the 10 lifetime search-and-read calls, or the daily extract trial (5). Add a wallet as shown above to keep going.
Wallet set but search still free. That's expected. Search only switches to paid with AGENTSEARCH_MODE=paid.
FAQ
Does Langflow web search need an API key?
Not with this setup. The AgentSearch MCP server gives you 25 free searches per IP in total with no key, account or wallet, then you pay per call over x402. You still need whatever key your chat model uses.
Where is the MCP Tools component in Langflow?
Register the server first (Settings → MCP Servers → Add MCP Server), and then add it from the MCP section of the flow editor's left sidebar. Langflow adds an MCP Tools component with the server already selected.
Should I use the JSON tab or the STDIO tab?
Either one. JSON is quickest if you already have an mcpServers block. STDIO is easier to edit by hand: Command npx, and -y and @agentsearchhq/agentsearch-mcp as two separate arguments.
Can the agent spend money on its own?
Not without a wallet. With no wallet key, search uses the free tier and the other tools use their free allowances, and once those run out the calls fail instead of charging anything. With a wallet, the server never spends more than AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00), and search stays free unless you also set AGENTSEARCH_MODE=paid.
Is it safe to let the agent read web pages?
Treat web content as untrusted input, because a page can contain text written to steer an AI. Keep the agent's instructions clear that search results are data, and review what it does with external pages before acting on it.
Next steps
- How to add free web search to an n8n AI Agent, another visual agent builder.
- How to add web search to a LangChain agent, the Python framework Langflow grew up around.
- How to add web search to a CrewAI agent.
- How to add free web search to Claude Desktop with MCP.
- All clients on the AgentSearch MCP page.
Paste the agentsearch block into Add MCP Server, add it to your flow from the MCP sidebar, turn on Tool Mode, and ask the agent about something that changed last week. You get 25 free searches per IP in total with no key, then $0.003 per paid search.
More from the blog
- n8n AI Agent Web Search
- Add Web Search to a LangChain Agent
- Add Web Search to a CrewAI Agent
- Add Free Web Search to Claude Desktop with MCP
Service pages: Web Search API · Web Extract API · Search + Read API · Web Render API