AdsPower Automation Layer: MCP Server + RPA

Knowledge base section 3 of 4. Covers how Hermes actually drives AdsPower browser profiles to perform Reddit engagement actions (navigate, upvote, comment, switch profiles). Sources: /opt/data/adspower_docs/extracted/MCP.txt, /opt/data/adspower_docs/extracted/rpa.txt.


1. MCP Server — AI-Driven Browser Automation

1.1 What It Is

MCP = Model Context Protocol, an open-source standard connecting AI models to external systems (browsers, databases, APIs). AdsPower ships a Local API MCP Server that exposes AdsPower’s LocalAPI to any MCP-compatible client as a set of callable tools.

  • Built with TypeScript + Playwright + NPM (package: local-api-mcp-typescript)
  • Allows natural language control of browser automation — no scripting required
  • Turns an AI assistant from a chatbot into an agent that can launch browsers, manage profiles, and drive real actions
  • Transport: stdio (spawned as a subprocess by the MCP client)

1.2 Architecture

┌──────────────┐    stdio     ┌─────────────────────────┐    LocalAPI     ┌─────────────┐
│  Hermes Agent │ <──────────> │ local-api-mcp-typescript │ <────────────> │  AdsPower   │
│  (MCP client) │   (JSON-RPC) │  (Playwright + TS)       │  (HTTP :50325) │  (browser)  │
└──────────────┘              └─────────────────────────┘                 └─────────────┘

The MCP server is a thin TypeScript wrapper that translates MCP tool calls into AdsPower LocalAPI HTTP calls (the same REST API documented in 02-rest-api.md). Playwright is the browser-automation engine under the hood for the interactive actions (click, fill, navigate, screenshot).

1.3 Setup Requirements

RequirementDetail
AdsPower desktopInstalled and running on the host machine
API verificationDisabled in AdsPower settings (only after confirming profile is trusted — prevents malicious external access)
Node.js18+ (LTS) required on the machine running the MCP client
NPM / npxAvailable (comes with Node.js)
MCP clientAny MCP-compatible tool (Claude Desktop, Cursor, Hermes Agent)

1.4 Capabilities Exposed

Based on the AdsPower help page, the MCP server surfaces the full LocalAPI surface as MCP tools. After connection, the client can “Configure” permissions and see “all the actions that can be performed.” For Reddit engagement, the relevant capability set is:

CapabilityReddit use case
Launch / stop profileOpen a specific AdsPower profile (one Reddit account)
Navigate to URLGo to a Reddit post URL
Click elementClick the upvote arrow
Fill inputType a comment into the comment box
ScreenshotCapture proof of action / verify state
Switch profileClose current, open next AdsPower profile = next Reddit account
Manage profiles (create/update/list)Provision new Reddit accounts at scale

Because the server is Playwright-backed, any DOM interaction that Playwright can do (click, type, wait-for-selector, evaluate JS) is available — the MCP layer just makes it callable via natural language from the AI client.

1.5 Connecting to Hermes Agent

The AdsPower MCP server is a stdio server (spawned via npx -y local-api-mcp-typescript). Hermes supports stdio MCP servers. The setup skill (autonomous-ai-agents/mcp-server-setup) documents two methods; for a headless VPS we use Method 2 — direct config write because hermes mcp add prompts interactively for stdio tool enablement and fails without a TTY.

Step-by-step integration plan:

  1. Prerequisite — Node.js 18+ on the Hermes host. AdsPower’s MCP server runs as a child process of Hermes via npx, so Node.js must be installed on the same machine as Hermes. On the Hostinger VPS:

    # Check
    node --version  # need >= 18
    # Install if missing (Debian/Ubuntu)
    curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
    sudo apt-get install -y nodejs
  2. AdsPower must be running and reachable. AdsPower is a desktop app — on a headless VPS it cannot run directly. Two options:

    • (a) Run AdsPower on a separate Windows/macOS machine that is network-reachable from the Hermes VPS, then point the MCP server at that machine’s LocalAPI endpoint. The local-api-mcp-typescript package reads a base URL (default http://localhost:50325); override via env var when launching.
    • (b) Run both AdsPower and Hermes on a Windows VPS / local machine. Simplest but not the current Hostinger Linux setup.
    • Recommendation for Rahul’s setup: Keep AdsPower on a Windows machine (Rahul’s local PC or a Windows VPS), expose LocalAPI on 0.0.0.0:50325 with the Bearer token (see 02-rest-api.md), then run the MCP server on the Hermes VPS pointing at the remote AdsPower.
  3. Register the MCP server in Hermes config. Write directly to /opt/data/config.yaml (the patch tool refuses to edit config files; use the venv Python):

    import yaml
    with open('/opt/data/config.yaml','r') as f: cfg = yaml.safe_load(f)
    cfg.setdefault('mcp_servers',{})
    cfg['mcp_servers']['adspower'] = {
        'command': 'npx',
        'args': ['-y', 'local-api-mcp-typescript'],
        'env': {
            # If AdsPower is on a remote machine, set the base URL + token here.
            # Exact env var names depend on the package — verify after install.
            # 'ADSPOWER_API_BASE': 'http://<windows-host>:50325',
            # 'ADSPOWER_API_TOKEN': '<bearer-token>',
        },
        'timeout': 180,
        'connect_timeout': 60,
    }
    with open('/opt/data/config.yaml','w') as f: yaml.dump(cfg, f, default_flow_style=False, sort_keys=False)
  4. Verify the connection.

    hermes mcp test adspower
    # Expect: ✓ Connected, ✓ Tools discovered: N

    Tools appear in Hermes as mcp_adspower_<tool_name> after a session restart.

  5. Disable API verification in AdsPower (only after confirming the profile is trusted — see AdsPower’s security warning). Without this, MCP-driven calls are blocked.

  6. First smoke test. From a Hermes session:

    “Use the AdsPower MCP to launch profile reddit-alpha1, navigate to https://reddit.com/r/SaaS/comments/xxx, take a screenshot, then stop the profile.” This exercises launch → navigate → screenshot → stop, the minimum viable Reddit engagement loop.


2. RPA — Visual Predefined Workflows

2.1 What It Is

RPA (Robotic Process Automation) is AdsPower’s built-in visual drag-and-drop process builder. It lets you compose a sequence of operations (click, fill, navigate, etc.) into a reusable “process” that can be run across many profiles — no code, no AI.

2.2 Core Concepts

ConceptDetail
ProcessA named sequence of operations. Create via the RPA panel, click ”+” to add operations.
Error handlingPer-process: “skip” (continue on error) or “stop” (halt on error).
SettingsClear tabs on start? Close profile after task completion?
GroupsOrganize processes into groups; filter by group name.
SearchFind processes by name.
ShareGenerate a sharing code (configurable usage count + expiry) so others can import your template.
DeleteIrreversible.
Task threadsUp to 100 concurrent process executions across profiles.
SchedulingTurn scheduled runs on/off, edit, delete. Supports periodic or one-shot.
Task logPer-run results with error markers (red exclamation mark = error in that step).
PermissionsPer-team-member RPA operation permissions (e.g. disallow delete).

2.3 Running a Process Across Profiles (the Reddit-relevant path)

  1. Build the process once in the RPA panel (e.g. “Reddit upvote + comment”): navigate → wait → click upvote → fill comment box → click submit → screenshot.
  2. Go to the Profiles menu.
  3. Select the target profiles (one per Reddit account).
  4. Click the RPA button.
  5. Choose the process and Task Type:
    • Common task — runs immediately.
    • Scheduled task — set a routine time / single execution.
  6. Track all runs in Task Log.

This is the bulk-execution path: one process, N profiles, up to 100 concurrent threads.

2.4 RPA for Reddit Engagement

Reddit actionRPA operations
Upvote a postnavigate(post URL) → wait(selector) → click(upvote arrow)
Comment on a postnavigate(post URL) → wait → fill(comment box) → fill(text) → click(submit)
Switch to next account(handled by running the process across selected profiles — each profile = one account)
Proof capturescreenshot as the last operation

Limitation for Hermes integration: RPA processes are built and triggered inside the AdsPower GUI. There is no documented programmatic API to create or trigger RPA processes from outside AdsPower. RPA is therefore not directly callable by Hermes — it’s a human-operated bulk runner. Hermes can only trigger the same browser actions via the MCP Server (or the raw LocalAPI).


3. MCP Server vs RPA — Comparison

DimensionMCP ServerRPA
InterfaceNatural language → AI calls toolsVisual drag-and-drop builder in AdsPower GUI
Who drives itAI agent (Hermes, Claude, Cursor)Human operator in AdsPower UI
FlexibilityHigh — AI decides actions at runtime based on contextLow — fixed sequence defined upfront
Scripting requiredNo (natural language)No (visual)
Code/runtimeTypeScript + Playwright, npx-spawnedBuilt into AdsPower desktop
ConcurrencyOne profile per AI turn (sequential, AI-paced)Up to 100 concurrent threads
SchedulingVia Hermes cron jobs (AI decides when)Built-in scheduler (periodic/one-shot)
Error handlingAI sees errors and adapts (retry, alt strategy)Skip or stop (binary, no adaptation)
Programmatic trigger from HermesYes (MCP tools are callable)No (GUI-only)
Proof / loggingAI captures screenshots + logs to its own transcriptTask Log panel in AdsPower
Best forAdaptive, context-aware actions; deciding what to upvote/commentBulk-running a fixed workflow across 100s of profiles
Setup complexityMedium (Node.js + config + network reachability)Low (built into AdsPower)

4. Recommendation for Hermes-Driven Reddit Engagement

Use MCP Server as the primary automation layer. RPA is not directly callable by Hermes, so it cannot be the integration point. The MCP server exposes every LocalAPI action as a tool Hermes can call, and the AI layer adds the decision-making RPA lacks (which posts to engage, what comment to write, how to handle errors).

However, do not discard RPA. The optimal architecture is a hybrid:

  1. MCP Server (Hermes-driven, adaptive) — for the intelligent layer:

    • Research: navigate Reddit, read posts, decide what’s worth engaging.
    • Comment authoring: AI writes context-aware comments per post.
    • Error recovery: AI retries, switches approach, logs outcomes.
    • Single-profile precision work where judgment matters.
  2. RPA (human-defined, bulk) — for the volume layer:

    • When the engagement workflow is fully nailed down (fixed post + fixed comment template), hand it to an RPA process and run across 100 profiles at once.
    • Use Hermes to generate the process definition (the sequence of operations + the comment text), then a human imports it into RPA for bulk execution.
    • RPA’s 100-thread concurrency is the only way to hit high volume cheaply; the MCP server is AI-paced and sequential.

Phased rollout:

  • Phase 1: MCP Server only — validate the Reddit engagement loop end-to-end with AI driving one profile.
  • Phase 2: Codify the winning loop as an RPA process; run across 10-20 profiles for scale.
  • Phase 3: Hybrid — Hermes uses MCP for research + comment drafting, outputs RPA-ready process definitions, human triggers bulk runs.

5. Integration Plan Summary (Hermes + AdsPower MCP)

StepActionOwnerStatus
1Install Node.js 18+ on the machine that will run the MCP serverRahul / opsPending
2Decide AdsPower host: Windows machine (local PC or Windows VPS) reachable from Hermes VPSRahulDecision needed
3In AdsPower: disable API verification (after trusting profiles), note Bearer token + LocalAPI port (default 50325)RahulPending
4Register adspower MCP server in /opt/data/config.yaml (stdio, npx -y local-api-mcp-typescript, env for remote base URL if needed)Hermes workerPending
5hermes mcp test adspower — verify tools discoveredHermes workerPending
6Smoke test: launch profile → navigate Reddit → screenshot → stopHermes workerPending
7Build Reddit engagement skill: upvote + comment flow using MCP toolsHermes worker (follow-up task)Pending
8(Phase 2) Codify winning flow as RPA process for bulk execution across profilesRahul + HermesFuture

6. Open Questions / Risks

  • AdsPower is a desktop app — it cannot run natively on the Hostinger Linux VPS. The MCP server (Node.js) can run on the VPS, but it needs to reach an AdsPower instance running elsewhere. The local-api-mcp-typescript package’s env-var mechanism for pointing at a remote LocalAPI endpoint needs verification (exact env var names).
  • API verification disabled is a security trade-off — only disable for trusted profiles to avoid malicious external access.
  • MCP tool surface — the help page doesn’t enumerate every tool; the exact tool list is discovered via hermes mcp test adspower after connection. The Reddit-relevant capabilities (launch, navigate, click, fill, screenshot, switch profile) are inferred from the LocalAPI + Playwright backing but must be confirmed against the live tool list.
  • RPA has no external trigger API — confirmed from the docs. Bulk RPA runs remain a human-operated step unless AdsPower adds an API.