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 plan details.

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