How to Set Up an MCP Server for Your AI Agent
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:
- Captchas. reCAPTCHA, hCaptcha, Turnstile — any site with bot protection blocks your agent cold. No amount of prompt engineering solves a captcha.
- 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. - Email verification. Signing up for services requires confirming an email address. Your agent needs a disposable inbox.
- 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
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.
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.
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"
}
}
}
}
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.
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:
- Automated account creation. Agent signs up for SaaS trials, verifies email, solves captchas — hands you working credentials.
- Competitor monitoring. Agent scrapes competitor pricing pages daily, even ones behind Cloudflare. No manual checking.
- Form automation. Agent fills and submits any web form — job applications, government paperwork, registration flows.
- Data enrichment. Agent looks up company info across multiple sites, solving captchas and rendering JS as needed.
- End-to-end testing. Agent tests signup flows including email verification and captcha solving — real browser, real results.
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:
- Captcha solve: $0.10 flat — any type (reCAPTCHA, hCaptcha, Turnstile, 40+ more). No per-type pricing games.
- Browser fetch: $0.05 — full JS rendering, Cloudflare bypass included.
- Temp email: $0.05 — disposable inbox + poll for verification codes.
- SMS verification: $0.50 — rent a temp number + receive the code.
- Screenshot: $0.05 — full-page capture at any viewport.
- Web search: $0.05 — real-time search results.
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:
- A fleet of headless browsers (Playwright/Selenium infrastructure)
- Accounts with captcha solving services (2Captcha, Anti-Captcha, etc.)
- Integration with temp email providers (mail.tm, Guerrilla Mail)
- Integration with SMS activation services (LegitSMS, SMS-Activate)
- Proxy rotation to avoid IP bans
- Session management for Cloudflare bypass
- Error handling, retries, and fallback logic across all of the above
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.