Afina

Download app

AppleWindows
EN
BlogAntidetect browsers

June 10, 2026

Afina MCP - 7 Real Automation Scenarios

Friday, 23:00. The Bybit registration script failed on 34 out of 50 accounts. The logs are 800 lines long. Launchpad opens tomorrow at 9:00. Before, that meant sitting there, scrolling, looking for the error, making edits, and restarting everything. This time, I wrote three sentences in chat and went to sleep.

The agent read the logs, found the cause (a 5-second timeout instead of the required 15 seconds), fixed the script, checked 4 accounts with problematic proxies, and sent me a summary. By 23:14, everything was ready.

That is what this article is about.

What MCP is and how an agent "sees" Afina - 3 minutes of theory

Our first article explained what an MCP server is, and the detailed MCP server guide shows how to configure it. Here, we will cover only what you need to understand before moving into practice.

MCP is not a plugin and not a set of bot commands. It is an API through which an AI agent (Claude, GPT, or any other agent) interacts with Afina the same way you do, only without a mouse. It can read account lists, create scripts, run proxy checks, and update modules. Everything you do manually in the interface, the agent does through API calls.

What the agent can actually do:

  • Read: accounts, scripts, logs, modules, proxies, databases, variables
  • Write: create and edit scripts, accounts, modules, task groups
  • Run: scripts on accounts, browser sessions, proxy checks
  • Analyze: error logs, proxy status, script structure
  • Fix: script parameters, module code, proxy assignments

What the agent cannot do: see encrypted passwords and API keys. It sees their names and metadata, but not their values. This is an intentional limitation: your secrets stay secret even from the agent.

How Afina starts the MCP server and how to connect an agent to it

What happens when Afina starts

When you launch Afina, it automatically starts a local HTTP REST API server. You do not need to configure anything extra: the server starts together with the app and listens on port 50778. If the port is busy, Afina automatically takes the next available port in the 50778-50787 range.

This server is the agent's entry point. As long as Afina is running, the API is available.

What afina-mcp is and where it comes from

afina-mcp is a separate npm package that is not bundled with Afina. It is an intermediary between the agent and the Afina API. You run it through npx directly from the command line, and it downloads automatically.

Interaction flow:

What afina-mcp is and where it comes from
  • Claude sends a JSON-RPC call to afina-mcp through stdin: {"method":"tools/call","params":{"name":"list_accounts"}}
  • afina-mcp translates it into an HTTP request to Afina with the x-api-key header
  • Afina returns data -> afina-mcp -> Claude receives the response

afina-mcp does not store state and does not keep logs. It lives exactly as long as the Claude session lasts.

What the agent sees through MCP

When the server is connected, Claude gets 92 tools. A few examples from a real connection:

  • list_accounts - full profile list: id, name, proxy, tags, groups, isRunning status
  • start_browser / stop_browser - start and stop a browser session for a specific profile
  • run_script / get_run_logs - run a script and read execution logs
  • create_module / update_module - write and update JS modules (files are stored on disk in data/modules/{UUID}/)
  • check_all_proxies - bulk check all proxies and update statuses in the database
  • create_task_group / start_task_group - schedule and start task groups

The agent cannot see encrypted passwords and tokens, only metadata. Your secrets are protected even from the agent.

Master prompt for connection

Copy the prompt below, insert your API key, and send it in any Claude client (Claude Code, Claude Desktop, Cursor, Cline). The agent will complete all steps itself:

Налаштуй підключення до Afina MCP сервера. Мій API-ключ Afina: [ВСТАВИТИ_КЛЮЧ] Afina запущена, сервер доступний на http://localhost:50778 Зроби наступне: 1. Виконай команду: claude mcp add afina --scope project -e AFINA_API_KEY=[ВСТАВИТИ_КЛЮЧ] -e AFINA_URL=http://localhost:50778 -- npx -y afina-mcp 2. Додай рядок .mcp.json до файлу .gitignore (або створи його, якщо не існує). 3. Перевір підключення: claude mcp list Якщо бачиш "afina: npx -y afina-mcp - ✓ Connected" - підключення успішне. 4. Нагадай мені перезапустити Claude Code - MCP-інструменти завантажуються тільки при старті нової сесії. Якщо Node.js не встановлено або Afina не запущена - повідом про це окремо.

Want to connect Afina to all your projects at once? Replace --scope project with --scope user, and MCP will become available globally.

What to check before sending the prompt:

WhatHow to check
Afina is runningicon in the system tray
Node.js >= 18node --version in the terminal
API key copiedAfina -> Settings -> API key
Claude Code installedclaude --version

Seven independent cases with Afina MCP

No chronology and no theory. Seven real tasks: concrete prompts, concrete results. Each case is standalone.

Proxy check: live or dead

A pool of 20 proxies. Some activities have completed successfully, some proxies occasionally drop, and some simply hang. Before launching a new activity, you need to know the state of the proxy pool and remove anything unusable without checking everything manually.

Before: open the proxy list, start a bulk check, wait, review results manually, find and delete the dead ones.

Now - one request:

Перевір усі проксі в Afina. Скільки живих, скільки мертвих? Покажи список мертвих - я їх видалю.

The agent replies:

"Check completed. Out of 20 proxies: 18 are live, 2 are not responding. Dead: 91.211.33.62, 64.7.251.207.

Proxy check: live or dead

Result: an exact list of live and dead proxies in seconds. Deleting the dead ones takes two manual clicks in the Afina UI. One

200 profiles with geo split and tiers - one prompt

Preparation for a new activity. 200 accounts: unique names, correct geo-based proxies, matching time zones and languages, and four tier groups.

Before: open the form 200 times, enter parameters, select proxies, save. Several hours of work.

Now:

Створи 200 акаунтів з такими налаштуваннями: Назви: ACC1 до ACC200 Розбивка по гео і тирам: - ACC1–50: проксі з групи "pl-proxies", таймзона Europe/Warsaw, мова: English - Tier 1 - ACC51–100: проксі з групи "de-proxies", таймзона Europe/Berlin, мова: English - Tier 2 - ACC101–150: проксі з групи "ua-proxies", таймзона Europe/Kyiv, мова: Ukrainian - Tier 3 - ACC151–200: проксі з групи "ua-proxies", таймзона Europe/Kyiv, мова: Ukrainian - Tier 4 Створи чотири групи: "Tier 1", "Tier 2", "Tier 3", "Tier 4". Поклади відповідні 50 акаунтів у кожну. Перед збереженням покажи перші 5 акаунтів кожного тиру - я підтверджу.

Agent:

"Prepared 200 accounts. First 5 by tier: Tier 1 -> ACC1 (pl.x.x.1, Europe/Warsaw, en) ... ACC5 Tier 2 -> ACC51 (de.x.x.1, Europe/Berlin, en) ... ACC55 Tier 3 -> ACC101 (ua.x.x.1, Europe/Kyiv, uk) ... ACC105 Tier 4 -> ACC151 (ua.x.x.51, Europe/Kyiv, uk) ... ACC155 Confirm?"

You answer "yes", and a few minutes later all 200 profiles are in the system, distributed across groups with the correct parameters.

200 profiles with geo split and tiers - one prompt

Starting the activity: task groups

The profiles are ready. Now it is time to run the script. The "Bybit promo" activity on the first hundred accounts, 10 in parallel, daily window 09:00-15:00, through task groups.

Створи групу задач "Bybit promo" для акаунтів ACC1 до ACC100. Запускай по 10 акаунтів паралельно. Повторна спроба при помилці: 1 раз. Вікно запуску: 09:00–15:00 щодня. Таймаут на один скрипт: 30 хвилин. Рандомізуй порядок акаунтів при кожному запуску.

Behind the scenes, the agent configures the exact task group parameters: timeFrom: "09:00", timeTo: "15:00", activeSession: 10, timeout: 30, repeatCount: 1, isRepeatable: true. These are the same fields spread across tabs in the interface; the agent sets them in one request, and randomization is enabled through the shuffle parameter.

Something failed. Agent, investigate

The first batch has finished. You open your phone and see a pile of error notifications. 34 out of 50 accounts failed. The cause is unknown.

Before: open the logs for each account one by one, scroll through hundreds of lines, find the pattern, make fixes.

Now - three steps:

Step 1. Read the logs:

Прочитай логи групи задач "Bybit promo". Скільки задач завершились з помилкою? Що за помилки і на яких кроках? Згрупуй по типу.

Agent:

"34 tasks failed. Breakdown by type:

  • 30 accounts: step "Wait for captcha button", error: element not found (timeout 5000ms). Cause: the timeout is too short for Bybit Puzzle to load.
  • 4 accounts: network error: proxy connection refused. These are proxies, not the script."

Step 2. Fix the script:

Виправ таймаут у скрипті Bybit Registration з 5000 до 15000ms для кроку "Очікування капча-кнопки".

The agent finds the right block in the script's JSON structure and changes the parameter. It confirms: "Timeout updated. 5000 -> 15000ms."

Step 3. Handle the proxies:

Знайди 4 акаунти, що впали з помилкою proxy connection refused. Перевір їхні проксі.

Agent:

"Accounts: ACC7, ACC19, ACC34, ACC41. Checked the proxies: all 4 are not responding. Do you want to assign new ones from the "pl-proxies" group?"

Так, призначи нові унікальні.

Diagnosis + fix + proxy replacement: 5 minutes, three natural-language requests. Before, this took at least an hour.

Telegram debugging: so errors no longer fail silently

The timeout is fixed. But next time, something else may happen, and you will have to scroll through logs again. The right solution is to configure Telegram notifications on every red branch of the script, so every error arrives in chat immediately.

The "Bybit Registration" script has 15 red branches: error paths. Adding a Telegram block to each one manually takes several hours.

Відкрий скрипт "Bybit Registration". Знайди всі червоні (error) гілки - тобто блоки, які ведуть по шляху помилки. До кожної червоної гілки додай блок відправки в Telegram з таким шаблоном повідомлення: #️⃣ | Bybit Registration ℹ️ | 🔴 Помилка 🐛 | Крок: {назва блоку} 📋 | {деталь помилки} 👤 | Акаунт: ${accountName}
Telegram debugging: so errors no longer fail silently

The agent reads the script structure, finds all 15 red connections, and inserts blocks with the correct parameters. Each block knows which step produced the error: the name and details come from the execution context.

Now every error on every account arrives in chat, with the script, step, and account name. Nothing fails silently.

The API changed. Updating the module without breaking the signature

The captcha-solving service changed its API endpoint. The module GEETEST MODULE (or your custom captcha_solver) stopped working. All scripts that use it are failing.

Why modules are not just JS files

Before explaining how the agent solves this, there is an important technical nuance that makes Afina different from "just running a file".

Every JS module in Afina is signed with the Ed25519 cryptographic algorithm based on the MD5 hash of all module files: index.js, package.json, settings.json. If any file is changed outside the system, the signature becomes invalid, and the script executor returns a signature_invalid error. No script will run the module without a current signature.

This protects against unauthorized changes: even if someone gets disk access and edits code directly, the signature breaks and the module is blocked.

After every legitimate code update, you must always run resign: recalculate the signature for the new file state. Without resign, the module is blocked.

The agent knows this and runs resign automatically. This is the key point.

Оновіть модуль captcha_solver - 2captcha змінив ендпоінт. Старий: api.2captcha.com/in.php Новий: api.2captcha.com/createTask Після оновлення - одразу resign.

Agent:

  1. Opens the module code: reads index.js
  2. Finds the old endpoint and replaces it with the new one
  3. Calls resign_module: recalculates the signature for the updated file state
  4. Confirms: "Endpoint updated, resign completed. All scripts that use this module will now run with the new API."
Why modules are not just JS files

Writing a module from scratch through the agent

Another convenient scenario is when the module does not exist yet. You do not need to describe all the technical logic. It is enough to give a name, task, fields, and a documentation link; the agent will handle the request format itself:

Напиши JS-модуль "2captcha_geetest_solver": - Що робить: відправляє Geetest-капчу на розв'язання через 2captcha і повертає токен - Поля налаштувань: apiKey (рядок, обов'язкове) - Вхідні параметри: imageBase64 (рядок) - Документація: 2captcha.com/api-docs Розберися з форматом запитів за документацією. Після створення - resign.

The agent reads the documentation, determines the correct endpoints and request format, writes index.js with full logic, settings.json with parameter descriptions, and package.json with dependencies, then calls create_module and resign_module. The module appears in the library and can be connected to any script through the executeModule block.

Module library audit

If you have accumulated many modules, the agent helps clean things up:

Покажи всі модулі. Є серед них застарілі версії або ті, що не використовуються в жодному скрипті?

The agent reviews the list and compares module hashes with their calls in scripts. It finds "dead" versions that remained after updates.

WebRTC does not work. Investigating through the agent

A client complains: "WebRTC does not turn on in Afina." The proxy seems to be SOCKS5 with UDP from DataImpulse, but browserleaks.com/webrtc shows a problem.

How WebRTC actually works in Afina

WebRTC, QUIC, and WebTransport are enabled automatically if the SOCKS5 proxy truly supports UDP tunneling. There is no manual toggle: the system detects proxy capabilities by itself.

The problem is different: many residential proxy providers claim UDP support, but in practice UDP traffic is not tunneled correctly. The symptom: on browserleaks.com/webrtc, WebRTC Public IP does not match Remote IP. That is a leak.

Checking this manually for 200 accounts is unrealistic. With MCP, it is one request:

Перевір усі проксі в групі "Main". Для кожного вкажи: статус (живий/мертвий), підтримка UDP, країна, затримка. Покажи окремо ті, де UDP не підтверджений.

The agent calls check_all_proxies and returns a structured report:

"Out of 60 proxies in the "Main" group: 58 are live. UDP is confirmed for 38 of them, not confirmed for 20. List without UDP: [87.x.x.x, 91.x.x.x, ...]"

Акаунти з групи "Main", що мають проксі без UDP - перемісти в групу "no-udp-proxies". Призначи їм проксі зі списку "datacenter-udp".

The agent iterates through accounts, checks their current proxies, moves those that need replacement, and assigns new ones without duplicates.

How WebRTC actually works

Practical takeaway: residential UDP proxies, including DataImpulse, often do not provide real UDP tunneling. Datacenter SOCKS5+UDP proxies, such as ProxyWing, are more stable for WebRTC/QUIC. Twilio Network Test can be unreliable: it may show a UDP error where the ProxyWing test passes cleanly.

RabbyWallet: checking balances on five accounts without a script

You need to quickly check the RabbyWallet balance on 5 accounts. One time, without writing a script.

Solution - an AI session in the browser:

Відкрий по черзі акаунти ACC1, ACC2, ACC3, ACC4, ACC5. Для кожного: 1. Запусти браузер 2. Відкрий розширення RabbyWallet 3. Розблокуй гаманець - використай змінну пароля rabby_pass 4. Прочитай загальний баланс у доларах і зафіксуй 5. Закрий браузер Після всіх п'яти - виведи підсумкову таблицю: акаунт → баланс.

The agent does this:

  1. start_browser - starts ACC1 with its fingerprint, proxy, cookies
  2. Opens RabbyWallet through the extension
  3. Uses the value of the rabby_pass variable to unlock the wallet
  4. get_page_text - reads the text of the wallet panel
  5. Finds the balance and stores it
  6. stop_browser - closes the session
  7. Repeats for ACC2-5

Agent:

"Done. Balances: ACC1 - $34.76 browser closed."

No script, no code. Just a conversation.

RabbyWallet: checking balances on five accounts without a script

OKX Boost: checking current activities

A similar scenario, but this time you need a list of activities on the platform, not a balance:

Відкрий профіль ACC101. Зайди на okx.com/boost. Знайди всі активні завдання та активності на сторінці. Зроби скріншот і поверни мені список: назва активності, умова, термін дії. Закрий браузер.

The agent starts the browser, loads the OKX Boost page, reads its content through get_page_text, runs take_screenshot, and returns a structured list:

"The following activities are active on OKX Boost now:

  1. Web3 Task Marathon - 3 tasks, reward: 10 OKB each, until June 20
  2. Invitation Bonus - +20 OKB per referral, no expiration
  3. Liquidity Mining Campaign - minimum deposit $100, APY up to 18%, until June 30 Screenshot added."

If something goes wrong, the agent does not stay silent: "A verification modal appeared; here is what the browser saw", and sends a screenshot for analysis.

Bonus: profile migration in 5 minutes

If you are moving to Afina from another antidetect browser, the agent transfers all profiles automatically.

Імпортуй усі профілі з Dolphin Anty в Afina. Поклади в групу "migrated-dolphin-june". Після міграції - перевір проксі кожного профілю і відзнач ті, що не проходять перевірку.

The agent connects to the Dolphin API, gets the full profile list, transfers them one by one, runs proxy checks, and returns a report:

"148 profiles migrated successfully. 2 - cookie parsing error (file is damaged). 12 have non-working proxies; I marked them with the "proxy-error" tag. Show the list?"

Migration is supported from:

  • AdsPower - through adspower_import_profiles
  • Dolphin Anty - through dolphin_import_profiles
  • Vision - through vision_import_profiles

And if you need to transfer an authorized session without logging in again:

Експортуй куки з поточної вкладки Chrome і встанови їх для акаунта ACC101.

The profile opens already authorized.

Comparison: before and after

TaskBeforeWith the MCP server
Create 200 accounts with geo split, proxies, and tiersSeveral hours of manual form fillingOne prompt, the agent sets all parameters
Start the "Bybit promo" activity on 100 accountsManually configure a task group field by fieldOne request: 10 in parallel, 09:00-15:00, 30 min timeout, randomization
Check 200 proxies and find dead onesStart manually, wait, analyze, delete one by onecheck_all_proxies -> the agent returns the dead list; deletion takes 2 clicks in the UI
Check RabbyWallet balance on 5 accountsOpen each browser, unlock manually, inspectAI session with password from a variable: one prompt -> balance table
Check activities on OKX BoostOpen browser, go there, inspect manuallyThe agent opens it, reads the page, returns a structured list
Write a JS module for a new APISpend an hour reading docs, writing code, resign manuallyDocumentation link -> agent writes it, resigns automatically
Update a module after an endpoint changeOpen, edit, manually resignOne prompt -> edit + resign
Read logs and find the error causeScroll through hundreds of lines manuallyThe agent reads, groups by type, explains the cause
Add a Telegram notification to 15 red branchesSeveral hours manually, block by blockOne request, the agent inserts all blocks
UDP/WebRTC diagnostics for 87 proxiesManual testing is unrealisticcheck_all_proxies + bulk account replacement

Where to start right now - 5 actions in 5 minutes

If the MCP server is already connected and you have not tried any of this yet, here is the fastest start:

  1. Check proxies - write in chat: "Перевір усі проксі в Afina і скажи, скільки живих і мертвих". This is safe and immediately shows how it works.

  2. Read logs - find any task group and write: "Прочитай логи останнього запуску і скажи, що пішло не так".

  3. Look at a script - write: "Покажи список скриптів і для одного з них поясни, що він робить". The agent reads the structure and explains the logic.

  4. Module audit - write: "Покажи всі модулі. Є серед них дублікати?".

  5. One-time AI session - start a profile and ask the agent to find something on the page. No script, no code, just a conversation.

FAQ — Frequently Asked Questions

Is it safe to give an agent access to Afina?

Yes, with several important caveats. The agent never sees encrypted key and password values, only their names. Account deletion is soft only (data can be restored) unless you explicitly request "permanent deletion". It is better to run destructive actions with confirmation: "show the list before deletion - I will confirm".

Can the agent break a script if I ask it to edit one?

The Afina MCP server has a built-in validator: before saving a script, it checks the structure, automatically connects unlinked blocks, and fixes small JSON errors. Even if the agent does something not quite right, the validator will not allow an invalid structure to be saved.

Why do I need to run resign after updating a module? Is it not automatic?

Resign is intentionally not automatic. If the system signed files on every change without confirmation, protection against unauthorized changes would not make sense. Resign is your explicit "I know about these changes and confirm them". Through the agent, this happens in one request, but confirmation remains with the human.

What does activeSession: 0 mean in a task group?

The value 0 means there is no limit on parallel sessions: the script will run on as many accounts at the same time as the system has resources for. For most activities, it is better to set a specific number (5-10) to avoid overloading the system.

If the agent starts a browser, will it close it itself?

Yes, if you ask. But it is better to say explicitly: "close browser after the task" so the session does not remain open. Unclosed browser sessions consume resources.

Can I ask the agent to write a script "from scratch", and will it be correct?

The agent reads the internal documentation afina://docs/rpa-blocks and knows the structure of Afina blocks. It writes simple and medium scripts correctly: clicks, forms, conditions, timeouts. For very complex scripts with non-standard logic, it is better to describe the structure in detail or ask the agent to show the result before saving. The MCP validator provides an additional safety layer.

Are npm dependencies supported in modules?

Yes. If the agent writes a module with an npm dependency, such as axios, it declares it in package.json. After create_module, the system installs dependencies automatically.

Related terms

Continue reading onAutomation scripts — Browser profiles | Afina Browser
Vladyslav Shestakov

Hello! I'm Vladyslav Shestakov - a data analysis and automation expert at Afina. Focused on web automation, product support, and development. I have experience in cryptocurrency, machine learning, and creating custom bots and automation tools. Combining technical expertise with continuous self-improvement and integration of modern technologies to make working with Web3 efficient and understandable.