surfsky-mcp

v0.0.9
surfsky-mcp Checked 4 days ago Published 12 hours ago

MCP server for the Surfsky antidetect cloud browser: scrape, browse and automate bot-protected sites from any MCP host.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

surfsky_status Account status

Check the Surfsky account this server uses: credentials, plan limits, proxy quota, and the sessions this server owns (id, seconds idle, idle timeout). Starts no browser. Use it when a tool returns an auth, quota or plan_full error, or before starting parallel sessions to see how many the plan allows.

surfsky_session_start Start a session

Start a cloud browser session and return its session_id. The hosted server needs it before any browser tool. A local server needs it only for a saved profile, a proxy location, a fingerprint OS, a second browser in parallel, or a session of your own when other agents share the server; otherwise the browser tools share a default session. The session bills per minute until surfsky_session_stop or idle_timeout seconds without a tool call: stop it when the task is done. It opens on about:blank; call surfsky_navigate next. The result's live_url lets the user watch the browser and act in it: give it…

ParameterTypeDescription
archstringFingerprint CPU architecture, with os.
block_resourcesarrayResource types not downloaded: faster and less proxy traffic, but screenshots and layout lose them.
citystringProxy exit city, with country.
countrystringProxy exit country code, for example US.
dialogsstringAnswer to alert, confirm and prompt dialogs: 'dismiss' (default) or 'accept'. Answered dialogs are reported in the next result.
idle_timeoutintegerSeconds without a tool call before the server stops the session (default 300).
osstringFingerprint operating system. Not with profile_uuid.
os_versionstringFingerprint OS version, with os.
profile_uuidstringSaved profile to load: its cookies and logins come with it and are saved back on a normal stop. Only a uuid the user gave you. Not with os, os_version or arch.
proxystringOmit for the account default. 'premium': residential pool; 'mobile': mobile pool; 'shared': free pool, tests only; or your own proxy URL (user:pass@host:port), then without country, region and city.
regionstringProxy exit state or region, with country.

surfsky_session_stop Stop a session

Stop a session and its billing. Use it when a task is done, or to clean up a leaked session found with surfsky_session_list. Safe to repeat. A saved profile's cookies and logins are stored on a normal stop. Stopping the default session is fine: the next browser tool call starts a fresh one.

ParameterTypeDescription
session_id *stringThe session to stop: any session id on the account.

surfsky_session_list List sessions

List the account's running sessions: session_id, profile_uuid, started_at, active_seconds, whether this server started it (owned) and whether it is this server's default. Use it to find leaked sessions to stop.

surfsky_navigate Navigate

Open a URL in the session's active tab (or go back, forward or reload) and return where it landed: final url, HTTP status, navigated, and a snapshot of the first 80 visible interactive elements with @N refs for surfsky_act; surfsky_snapshot with find= or a higher limit lists the rest. Use it for a page that needs clicks, scrolling, a form or a login; to only read a page, surfsky_scrape is cheaper and starts no session. A bot challenge page is passed, captcha solves are billed where the account pays for solving, and note reports it; a captcha on an ordinary page is never solved here. If note sa…

ParameterTypeDescription
gostringHistory step instead of a URL.
session_idstringSession from surfsky_session_start; omit for the current one.
snapshotbooleanInclude a snapshot of interactive elements (default true).
timeoutnumberSeconds to wait for the navigation (default 30).
urlstringURL to open; https:// is added when missing. Give url or go.
wait_untilstringLoad state that ends the navigation: 'load' (default); 'domcontentloaded' (faster on heavy pages; then surfsky_wait for what you need); 'commit' (first response); 'networkidle' (busy pages never reach…

surfsky_snapshot Snapshot elements

List the visible interactive elements (links, buttons, inputs, selects) and headings of the active tab as '[@N] role "name"' rows, with value, checked, options and disabled where present, and href for links that share a name; @N is a target for surfsky_act. Refs belong to this tab and URL: after a navigation an old ref fails with stale_ref. find narrows the list without renumbering. Iframe and shadow-root contents are not listed; they appear as '[--] iframe ... (content not reachable)'. For the page text use surfsky_read.

ParameterTypeDescription
detailsbooleanAdd every link's href and each row's CSS selector.
findstringCase-insensitive substring matched against each element's role, name, href and CSS selector; a|b matches either.
interactive_onlybooleanList only elements that can be acted on, without headings.
limitintegerMaximum rows (default 500); the result says how many more matched.
session_idstringSession from surfsky_session_start; omit for the current one.

surfsky_read Read page

Read the active tab as markdown (default), plain text, cleaned html or a list of links. Use it after surfsky_navigate or surfsky_act to get the page's text; for a URL that needs no clicks or login, surfsky_scrape does the same without a session. selector restricts the output to one element; with limit, to the first N matches, for repeated items like result cards. Content longer than max_chars is cut at a line boundary with a marker: raise max_chars or pass selector for the rest.

ParameterTypeDescription
formatstring'markdown' (default), 'text' (rendered innerText; ignores only_main_content), 'html' (without scripts and styles) or 'links' (absolute, deduplicated, in document order).
limitintegerWith selector: read the first N matching elements (at most 100) as separate items.
max_charsintegerCut each text after this many characters (default 10000, at most 200000).
only_main_contentbooleanKeep the main or article content; drop navigation, headers, footers, asides and forms.
selectorstringCSS selector, @N from a snapshot of this page, or text=words (the first visible element whose name contains the words). No XPath.
session_idstringSession from surfsky_session_start; omit for the current one.

surfsky_screenshot Screenshot

Capture the active tab as an image: the viewport as JPEG, or PNG for the full page or one element (selector). Take one only when the user asks for an image or the answer depends on how the page looks: a layout, a chart, or a captcha or canvas the text tools cannot read. Not to check that an action worked: its result already carries the page state. For what can be clicked use surfsky_snapshot; for content, surfsky_read.

ParameterTypeDescription
full_pagebooleanCapture the whole scrollable page as PNG instead of the viewport.
selectorstringCSS selector, @N from a snapshot of this page, or text=words (the first visible element whose name contains the words). No XPath.
session_idstringSession from surfsky_session_start; omit for the current one.

surfsky_evaluate Evaluate JavaScript

Run JavaScript in the active tab and return its JSON result: an expression, or a function called with args; a returned promise is awaited, so an async function can poll for a condition. Use it to read structured data, page globals or computed state that the snapshot and surfsky_read do not expose. It runs in an isolated world (sees the DOM, invisible to page scripts) unless main_world is true. Do not click or set values here: that fires synthetic events bot detection flags and skips the site's handlers; input goes through surfsky_act. Results over 30000 characters are cut.

ParameterTypeDescription
expression *stringA JavaScript expression, or a function (arrow or function keyword) that receives args.
argsarrayJSON values passed to the function as arguments.
main_worldbooleanRun in the page's main world (its globals; the page can observe the call) instead of the isolated world.
session_idstringSession from surfsky_session_start; omit for the current one.

surfsky_act Act on the page

Perform input on the active tab with human-like mouse and keyboard, then return the page state (url, navigated, changed) and a fresh snapshot with @N refs. Use it for every click, form entry and keypress; pass steps to run a known sequence (fill a form, then submit) in one call. Actions: click, dblclick, hover (target); fill (target, text: replaces the value); type (target, text: appends keystrokes; target '@focused' types into the focused element without clicking); press (key); select (target, value); scroll (target scrolls it into view, delta_y scrolls the page, neither scrolls most of a scr…

ParameterTypeDescription
actionstringThe action to perform; or pass steps.
delta_ynumberPixels to scroll the page: positive down, negative up.
keystringKey for press: Enter, Tab, Escape, Backspace, ArrowDown, or a combination like Control+A.
modifiersarrayModifier keys held during click, dblclick or press.
session_idstringSession from surfsky_session_start; omit for the current one.
snapshotbooleanInclude a snapshot of interactive elements (default true).
stepsarrayUp to 20 actions run in order, instead of action: objects with the same fields (action, target, text, key, value, modifiers, delta_y). After a step that changes the page, target by CSS selector or tex…
targetstringCSS selector, @N from a snapshot of this page, or text=words (the first visible element whose name contains the words). No XPath.
textstringText for fill or type.
timeoutnumberSeconds allowed per action, including finding the element (default 10, at most 30).
valuestringOption for select: its value attribute or its visible label.

surfsky_wait Wait for the page

Wait until the active tab meets a condition, then return its url and title. Use it for content that loads after an action or after a domcontentloaded navigation; actions settle on their own, so do not wait after every step. Several conditions are waited one after another, each with the full timeout; one not met in time fails with a timeout error and leaves the page as it is. For a condition only script can check, use surfsky_evaluate with an async function that polls.

ParameterTypeDescription
gonebooleanWith selector: wait until it is absent or has no layout box.
secondsnumberFixed sleep in seconds, after the other conditions.
selectorstringElement to wait for: a CSS selector (also for elements that do not exist yet), or @N or text=words, which must resolve now.
session_idstringSession from surfsky_session_start; omit for the current one.
textstringString the page's visible text must contain.
timeoutnumberSeconds allowed per condition (default 30).
url_containsstringSubstring the page URL must contain.

surfsky_tab Manage tabs

Manage the tabs of a session: list (index, id, url, title, active), new (opens a tab and makes it active), switch, close. Use list then switch when a click opened a popup or a target=_blank link: the new page is another tab. Refs belong to a tab: take surfsky_snapshot after switching. The session's first tab cannot be closed; navigate it instead. The cloud allows five tabs per session.

ParameterTypeDescription
action *stringlist; new (optionally at url); switch (tab); close (tab, default the active one).
session_idstringSession from surfsky_session_start; omit for the current one.
tabstringTab for switch or close: its index from the last list, or its id (a prefix is enough).
urlstringFor new: URL to open in the new tab.

surfsky_scrape Scrape a URL

Fetch one URL and return it as markdown (default), cleaned html or links, with the final url, HTTP status and title. Use it whenever you only need to read a page: the Scraping API serves it from a pre-started browser behind a residential proxy and passes challenge pages and captchas, with no session to stop. profile_uuid, proxy, country, region, city or os start a throwaway browser for this call instead: slower, so pass them only when needed. For a page that needs clicks, a form or an interactive login, use surfsky_navigate and surfsky_act. A 200 with a short page may be a challenge page: read…

ParameterTypeDescription
url *stringURL to fetch; https:// is added when missing.
block_resourcesarrayResource types not downloaded: faster and less proxy traffic, but screenshots and layout lose them.
citystringProxy exit city, with country.
countrystringProxy exit country code, for example US.
formatsarrayAny of markdown, html, links, screenshot. Default: markdown; add screenshot only when the user asks for an image (viewport JPEG).
max_charsintegerCut each text after this many characters (default 10000, at most 200000).
only_main_contentbooleanKeep the main or article content; drop navigation, headers, footers, asides and forms.
osstringFingerprint operating system. Not with profile_uuid.
profile_uuidstringSaved profile to load: its cookies and logins come with it and are saved back on a normal stop. Only a uuid the user gave you. Not with os, os_version or arch.
proxystringOmit for the account default. 'premium': residential pool; 'mobile': mobile pool; 'shared': free pool, tests only; or your own proxy URL (user:pass@host:port), then without country, region and city.
regionstringProxy exit state or region, with country.
timeoutnumberSeconds to wait for the navigation (default 30).
wait_forstringCSS selector to wait for before reading, for content that appears after load.
wait_untilstringLoad state that ends the navigation: 'load' (default); 'domcontentloaded' (faster on heavy pages; then surfsky_wait for what you need); 'commit' (first response); 'networkidle' (busy pages never reach…