Developer guide

Connect your AI agent framework to the live web over MCP

Your agent framework can already talk to remote MCP servers. Point it at UnblockingAPI's hosted server and the model gets three tools: unblock_fetch to read any page through residential proxies and a real browser, find_templates to turn known sites into JSON, and get_build_guide for building apps on the API. No tool schemas to write.

5 min read

What you need

  • The endpoint https://mcp.unblockingapi.com/mcp (Streamable HTTP).
  • Your UnblockingAPI key, sent as Authorization: Bearer <key>. Keep it in an environment variable on the server.
  • An MCP client timeout of 200 seconds or more: a browser render can take a couple of minutes.

Vercel AI SDK

createMCPClient from @ai-sdk/mcp connects over HTTP and hands the tools straight to generateText or streamText. Close the client when the call is done.

import { generateText, stepCountIs } from "ai";
import { createMCPClient, type MCPClient } from "@ai-sdk/mcp";

let mcp: MCPClient | undefined;
try {
  mcp = await createMCPClient({
    transport: {
      type: "http",
      url: "https://mcp.unblockingapi.com/mcp",
      headers: { Authorization: `Bearer ${process.env.UNBLOCKINGAPI_KEY}` },
    },
  });

  const result = await generateText({
    model: "anthropic/claude-sonnet-5.5",
    tools: await mcp.tools(),
    stopWhen: stepCountIs(5),
    prompt: "Get the Google results for 'espresso machine' and list the top five.",
  });
  console.log(result.text);
} finally {
  await mcp?.close();
}

LangChain

MultiServerMCPClient loads the tools as LangChain tools for any agent. The adapters package is moving into langchain[mcp]; the configuration stays the same.

import asyncio, os
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent

async def main():
    client = MultiServerMCPClient({
        "unblockingapi": {
            "transport": "http",
            "url": "https://mcp.unblockingapi.com/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['UNBLOCKINGAPI_KEY']}"},
        }
    })
    tools = await client.get_tools()
    agent = create_agent("anthropic:claude-sonnet-5-5", tools)
    reply = await agent.ainvoke({"messages": "Read https://example.com and summarise it."})
    print(reply["messages"][-1].content)

asyncio.run(main())

Claude API

Anthropic's Messages API can connect to the server for you - no client in your code at all. One mcp_servers entry with your key as the token; see the Claude API guide.

No code

Workflow tools connect the same way: n8n's MCP Client Tool, or any assistant from the list of apps - most of them sign in with your account instead of a key.

Frequently asked questions

Why MCP instead of calling the REST API?

When the model decides what to fetch, MCP hands it ready-made tools with descriptions it already understands: no tool schema to write, and templates are discoverable through find_templates. When your own code decides, the REST API or an SDK is simpler.

Do I need OAuth in my own code?

No. Server-side agents send your API key as a bearer token. OAuth sign-in is for apps that act on behalf of other users, like Claude.ai or Cursor.

Some calls time out

A fetch that falls back to a real browser can take up to about three minutes. Raise your MCP client's request timeout to at least 200 seconds, or lower settle_ms in the tool call when you don't need the page to settle.

What does it cost?

1 credit per successful fetch; failures and template lookups are free. New accounts get 500 free credits with no credit card.

Give your agent a real browser.

Test the fetching layer before building your parser. Start with 500 free credits and no credit card. See pricing for credit packs from €10.

One successful request is one credit. No multipliers for rendering, proxies or retries.

Related guidesBrowse all guides

How to scrape public property listing pages

Fetch JavaScript-rendered property listing pages with country-level routing and parse the returned HTML.

How to scrape e-commerce product pages and pricing data

Fetch public product pages through UnblockingAPI, parse pricing and product details from the returned HTML.

How to scrape JavaScript-rendered pages

Use real browser rendering to fetch pages that load content dynamically through client-side JavaScript.

How to scrape hundreds of websites every day without breaking your pipeline

Separate fetching from parsing, queue small jobs, validate content and work out monthly credits before you buy.

A ZenRows alternative: credit multipliers compared

Compare ZenRows and UnblockingAPI on published rates, with worked examples at three volumes and where ZenRows may be the better fit.

A Bright Data alternative with flat per-request pricing

Compare Bright Data Web Unlocker and UnblockingAPI on published rates, with worked examples and where Bright Data is the better fit.

Bulk domain rating checker: Ahrefs DR for hundreds of domains

Check Ahrefs Domain Rating, backlinks and linking websites for a list of domains with one API call each - curl, Python, CSV export and daily DR tracking.

How to give your AI app live web data

Build a fetch tool for your agent, clean pages for the model and keep RAG sources fresh with rendered, unblocked page fetches.

Scraping API cost at scale: estimate monthly credits for 500,000 requests

Count requests, find the credit multiplier, price the credits and leave headroom, with a worked example for 500,000 requests a month.