How to Set Up an MCP Server for Your AI Agent

July 28, 2026 · 8 min read

AI agents are only as capable as the tools you give them. The Model Context Protocol (MCP) is the standard for giving LLMs access to external services — and setting up an MCP server is the fastest way to turn your agent from a chatbot into a capable autonomous worker.

In this guide, I'll walk through exactly how to set up an MCP server that gives your AI agent real-world capabilities: solving captchas, rendering JavaScript pages, generating temp emails, and receiving SMS verification codes. You'll have a working server in under 10 minutes.

What Is MCP and Why Should You Care?

MCP (Model Context Protocol) is an open standard from Anthropic that lets AI models call external tools through a consistent interface. Think of it as "USB-C for AI tools" — one protocol, any model, any service.

Before MCP, connecting an AI agent to a web service meant writing custom integration code for every tool. With MCP, you write a server once, and any MCP-compatible client (Claude Desktop, Cursor, Continue, Zed) can use it immediately. No per-client rewrites.

The ecosystem is exploding. Claude Desktop added native MCP support in early 2025. Cursor shipped MCP integration in mid-2025. Hundreds of MCP servers now exist on GitHub and PyPI — for databases, APIs, file systems, and web automation.

What Your Agent Actually Needs

An autonomous AI agent hits four roadblocks that pure LLMs can't solve:

  1. Captchas. reCAPTCHA, hCaptcha, Turnstile — any site with bot protection blocks your agent cold. No amount of prompt engineering solves a captcha.
  2. JavaScript rendering. Modern sites are SPAs. Your agent's HTTP client gets an empty <div id="root"> and nothing else. You need a real browser.
  3. Email verification. Signing up for services requires confirming an email address. Your agent needs a disposable inbox.
  4. SMS verification. Phone verification is the hardest gate. Your agent needs a temporary phone number that can receive codes.

You could integrate five different APIs to solve these. Or you could use one MCP server that handles all of them — with a single API key, flat pricing, and no per-service setup.

Step-by-Step: Setting Up an MCP Server

1

Install the MCP server

pip install unblockapi-mcp

That's it. One pip install. No API keys to configure, no separate services to register. The package includes a FastMCP server with 11 tools pre-wired.

2

Get an API key (5 seconds)

curl -X POST https://api.unblockapi.com/api/v1/account/register/anonymous \
  -H "Content-Type: application/json"

Returns an API key instantly. No email, no password, no credit card. You get 5 free calls to test anything.

3

Configure Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "unblockapi": {
      "command": "python",
      "args": ["-m", "unblockapi_mcp"],
      "env": {
        "UNBLOCKAPI_KEY": "ub_your_key_here"
      }
    }
  }
}
4

Restart Claude Desktop

You'll see a hammer icon appear — that's MCP. Click it to see all 11 tools: solve_captcha, fetch_rendered_page, generate_temp_email, rent_temp_phone, take_screenshot, web_search, and more.

5

Try it

Ask Claude: "Go to example.com, solve the captcha, and tell me what's on the page." Your agent will navigate with a real browser, solve any captcha it finds, and return the rendered content.

For Cursor Users

Cursor added MCP support in version 0.45+. The setup is similar — add the server config to Cursor's MCP settings, and you get all 11 tools in your agent's tool palette inside the editor.

The difference from Claude Desktop: Cursor's agent can edit code based on what it finds. It can scrape a competitor's pricing page, solve their captcha, extract the data, and write it into your spreadsheet — all inside your IDE.

What You Can Build With an MCP-Connected Agent

Once your agent has browser rendering + captcha solving + temp email + SMS verification, the use cases expand dramatically:

Agent tip: Use session_create + session_navigate + session_fill + session_click for multi-step workflows. The browser session persists cookies and Cloudflare clearance across all steps — no getting blocked mid-flow.

Building Your Own MCP Server (Python)

If you want to build a custom MCP server that wraps your own logic around these tools, here's the pattern using FastMCP:

from fastmcp import FastMCP
import httpx

mcp = FastMCP("My Agent Tools")

@mcp.tool()
async def solve_captcha(site_url: str, site_key: str, captcha_type: str = "recaptcha_v2") -> str:
    """Solve a captcha on any website. Returns the solution token."""
    async with httpx.AsyncClient() as client:
        r = await client.post(
            "https://api.unblockapi.com/api/v1/captcha/solve",
            json={"type": captcha_type, "site_key": site_key, "site_url": site_url},
            headers={"X-API-Key": "ub_..."}
        )
        return r.json()["token"]

@mcp.tool()
async def fetch_page(url: str) -> str:
    """Fetch a fully JavaScript-rendered page (bypasses SPAs, Cloudflare)."""
    async with httpx.AsyncClient() as client:
        r = await client.post(
            "https://api.unblockapi.com/api/v1/browser/fetch",
            json={"url": url},
            headers={"X-API-Key": "ub_..."}
        )
        return r.json()["text"]

if __name__ == "__main__":
    mcp.run()

That's a complete MCP server in 25 lines. Two tools — captcha solving and browser rendering — ready for any MCP client.

Pricing: What It Actually Costs

Here's the real cost of running an agent with these capabilities:

Sign up and you get 5 free calls plus $0.25 credit. No credit card. A typical agent workflow (navigate → solve captcha → fill form → submit) costs about $0.25. That's 1 free workflow before you pay a cent.

Why Not Build This Yourself?

You could. Here's what you'd need:

Setting all that up takes days. Maintaining it takes weeks. The MCP server approach gives you all of it in one pip install with one API key. The economics are obvious — your time is worth more than $0.05 per call.

Pro tip: Use the browser/session endpoints for multi-step workflows. Create a session once, navigate through multiple pages, fill forms, click buttons — the browser retains cookies, localStorage, and Cloudflare clearance across all API calls. No session = new browser every request = Cloudflare re-challenges every time.

What's Next for MCP

MCP is still young, but the trajectory is clear. Anthropic is pushing it as the standard for AI-tool interaction. OpenAI is exploring similar protocols. The companies that build MCP-native tools today will own the distribution channel tomorrow.

If you're building AI agents — whether for internal automation, SaaS products, or research — setting up an MCP server is the highest-leverage 10 minutes you'll spend this week.

📚 More Guides

🤖 Building AI Agents with Claude + MCP → 🔐 5 Best Captcha Solver APIs for AI Agents → 🤖 How to Give Claude Web Superpowers with MCP → 🏗️ Building an Autonomous Web Agent: The Complete API Stack → 🆚 Best Captcha Solver API for AI Agents in 2026 → 🎮 Try the Live API Demo (no signup) →

Give your agent real tools — in 5 minutes

pip install unblockapi-mcp → configure Claude Desktop → done. 5 free calls, no credit card.

Get Free API Key pip install unblockapi-mcp