Adding Live Search to AI Agents with MCP
Add live search to AI agents with MCP. Connect Claude, Cursor, n8n or LangChain to a SERP API and a Webpage API for current results and clean page text.
On this page What the agent actually needs
Independent and reader-supported. Some links may earn us a commission; it never changes our rankings. Editorial policy
Most language models are only as current as their training cut-off. That is fine for general reasoning. It is a problem the moment an agent has to answer “what ranks for this keyword today,” “what did this page just change,” or “what are people seeing in this city right now.”
The usual fix is to bolt on live web access: a search API for results, and a page-extraction API for the content behind those results. MCP (Model Context Protocol) is the piece that makes that access feel like a native tool in Claude, Cursor, n8n or LangChain, instead of another custom integration you have to maintain.
This is a builder’s guide to that setup: how to connect a hosted MCP server, when to call a SERP API directly, and how to turn a result URL into clean text. The examples use Thordata’s MCP Server, SERP API and Webpage API, because those are documented for this exact stack. The same pattern applies to any provider that gives you structured search results and readable page content.
What the agent actually needs
A useful live-search agent does two jobs, not one.
- Search. Ask Google, Bing, Yandex or DuckDuckGo for a query, in a specific country or language if needed, and get structured results (title, URL, snippet) as JSON.
- Read. Fetch one or two of those URLs and turn the page into clean HTML or Markdown the model can actually use.
If you only do the first step, the agent can cite links but not quote the page. If you only do the second, it has to be handed a URL. Most production agents need both.
A hosted MCP server covers the search side inside MCP-aware clients. A Webpage API covers the read side. Some platforms also offer a native n8n node or a LangChain tool, which is the same data with a different handle.
Platform facts worth checking on any provider, and that Thordata currently publishes for this stack: 100M+ IPs across 190+ countries, 99.9% uptime on its residential network, and official LangChain, LlamaIndex, n8n and MCP integrations.
Connect MCP in Cursor and Claude
You need an API token from the provider dashboard first. Thordata’s dashboard gives you the hosted MCP URL to use. The config looks like this:
{
"mcpServers": {
"thordata": {
"type": "http",
"url": "YOUR_THORDATA_MCP_URL"
}
}
}
To get a token, create a Thordata account and copy the MCP connection details from your dashboard.
In Cursor, add that as a custom MCP server under Tools and Integrations. Once the client discovers the tools, you can ask for a live search in plain language, for example: “Search Google for the latest MCP specification and return titles, URLs and snippets.”
Claude Desktop’s integration can also use npx mcp-remote to reach the hosted server:
{
"mcpServers": {
"thordata": {
"command": "npx",
"args": [
"mcp-remote",
"YOUR_THORDATA_MCP_URL"
]
}
}
}
Use the exact URL and method your dashboard gives you. After you save the config, restart the client, then approve the first tool call when the app asks.
Under the hood, the useful MCP tools are simple. list_engines lists the available engines, search runs a query, and history and statistics let you review past searches and usage. Thordata’s MCP search covers Google (25 result types), Bing (6), Yandex and DuckDuckGo, and accepts parameters such as query, location and response mode:
{
"name": "search",
"arguments": {
"engine": "google",
"params": {
"q": "coffee shops",
"location": "Austin, TX"
}
}
}
You do not normally write that JSON by hand in Claude or Cursor. The client does, after you describe the task. The point of MCP is that the agent picks the tool and fills the fields.
n8n: a node for fixed flows, MCP for agents
If the job is scheduled and deterministic — daily rank checks, a keyword list, a Slack alert — a native node is usually the better fit. Thordata’s n8n integration offers a community node that takes explicit parameters and returns JSON you can pass to later nodes:
{
"q": "coffee",
"gl": "us",
"hl": "en",
"num": 10
}
If the job is an AI agent inside n8n, use the MCP client node instead, and point it at the hosted MCP URL from your dashboard:
YOUR_THORDATA_MCP_URL
The same API key and data source sit behind both paths. The difference is control: the node runs the query you configured; the MCP path lets the agent decide when a search is needed.
LangChain: SDK for a single agent, MCP to share the tool
LangChain gives you the same split. For a prototype, wrap search as an in-process tool:
pip install langchain-thordata
import os
os.environ["THORDATA_API_KEY"] = "your-api-key"
from langchain_thordata import ThorDataSearchTool
from langchain_openai import ChatOpenAI
tool = ThorDataSearchTool()
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
model_with_tools = llm.bind_tools([tool])
response = model_with_tools.invoke("Search for coffee")
print(response)
For a service that several agents can share, connect LangChain to the hosted MCP server with the official adapter:
pip install langchain-mcp-adapters
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"thordata": {
"url": "YOUR_THORDATA_MCP_URL",
"transport": "http",
}
})
tools = await client.get_tools()
You can then pass tools into create_agent. The official product page also shows a compact JSON shape for organic results (title, link, description) plus optional SERP features such as “people also ask.” That stable field list is what you want in an agent: less cleaning, fewer invented fields.
LlamaIndex has a documented integration on the same pattern, which is useful if the next step is RAG rather than a tool-calling loop.
When to call the SERP API yourself

MCP is convenient inside a chat client. It is not always what you want in a backend job, a test suite or a tightly specified pipeline. In those cases, call the SERP API directly and keep the JSON.
Thordata’s SERP API authenticates with your API token and returns structured results from Google, Bing, Yandex and DuckDuckGo. A minimal request looks like this (take the exact auth header from Thordata’s docs):
curl -X POST https://scraperapi.thordata.com/request \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "YOUR_AUTH_HEADER: YOUR_API_TOKEN" \
-d "engine=google" \
-d "q=pizza" \
-d "json=1"
Set engine to bing, yandex or duckduckgo when you want a second opinion on the same query. Ask for JSON when an agent or a workflow will consume the results; ask for HTML only if you need the raw page.
On pricing, Thordata bills SERP usage per successful result. The public packs, last updated November 12, 2026, start at $18 for 15,000 responses ($1.20 per 1,000) and fall to $0.70 per 1,000 at 1,000,000. New users get 500 free credits on sign-up, with no credit card required. MCP is not a separate product line; it settles against that underlying API.
Read the page behind the result
Search results are not the article. Once the agent has a URL, send it to a Webpage API and request Markdown if the next step is summarization, classification or RAG:
curl --request POST "https://webpage.thordata.com/request" \
--header "YOUR_AUTH_HEADER: YOUR_WEBPAGE_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"url": "https://example.com/article",
"type": "markdown",
"isjson": "1"
}'
A successful JSON body includes code, url, response_time, html and, when requested, markdown. Check code inside the body, not only the HTTP status. In Thordata’s docs, 200 means the content was collected; 300 means no usable content, and that request is not charged.
Two practical limits are worth designing for. Webpage tokens are not the same as SERP or proxy tokens, so do not reuse keys across products. And this kind of API is meant for public pages. Login walls, CAPTCHAs and aggressive anti-bot checks can return nothing useful. In that case, fail clearly and move on, rather than letting the model invent the missing text.
A simple pattern that holds up

For most agent-builder work, the reliable loop is:
- The user asks a question that depends on the current web.
- The agent calls live search (MCP tool, LangChain tool, n8n node or SERP API) with a tight query and, if it matters, a country or language.
- The agent picks one to three URLs from the structured results, not ten.
- The Webpage API returns Markdown for those URLs.
- The model answers with citations, and refuses to fill gaps the APIs did not return.
Keep the first version that simple. Add scheduling, geo tests and multi-engine comparison once the loop is stable.
Live search does not make an agent “smarter.” It makes it current. MCP is the cleanest way to give Claude, Cursor, n8n and LangChain that capability, as long as you also extract the pages you cite, and as long as you treat missing results as missing, not as an invitation to guess.
Found this useful? Share it with someone comparing AI tools.