Agentic coding
There are three ways to put an AI agent to work on browserscale, and they fit together. Studio builds the automation for you: it explores the site, writes the code and runs it. The MCP server hands any agent a live cloud browser it can look at and act in, one call at a time. And your own coding agent can write against the SDK, with these docs as Markdown to read from.
The MCP server serves three kinds of work with the same tools, and a conversation can move between them freely. An agent in a chat gets a task done in a real browser: look something up, fill something in, carry something through. A coding agent helps with a program you wrote on the SDK, by attaching to the session that program runs in and looking at the page it is stuck on. And a flow worked out by hand becomes a script: the server remembers the calls that were made and hands them back as Go or TypeScript lines.
- MCP endpoint:
https://mcp.browserscale.cloud/mcp(Streamable HTTP). Authenticate with anAuthorization: Bearer <your-api-key>header. https://mcp.browserscale.cloud/— without/mcp— is a human-readable list of the tools. It is not the endpoint; pointing a client at it will not work.- The API key belongs in your client config as a header. It is never a tool argument, so it never enters the model's context.
- Each tool is one SDK call;
sdk_callreaches every other method, anddocs_readanddocs_searchread these docs. networkshows what a step sent and got back, andhistoryreturns what was done in a session, as a flow or as SDK code in Go or TypeScript.sessionslists every session on your key, so an agent can attach to one your program is running or left behind.- Want the automation without writing the code? Use Studio. Writing it with your own agent? Every docs page is also Markdown: add
.mdto its URL, or start from/llms.txt.
The MCP server
browserscale runs a hosted MCP server, so there is nothing to install and nothing to keep running.
| Endpoint | https://mcp.browserscale.cloud/mcp |
| Transport | Streamable HTTP (a remote MCP server, not stdio) |
| Auth | Authorization: Bearer <your-api-key> |
| Tool overview | mcp.browserscale.cloud — for humans, not for clients |
Connecting a client
Nearly every MCP client wants the same three things: a name, the URL and a map of headers. The file it lives in and the exact field names differ per client, so check yours — but the shape is this:
{
"mcpServers": {
"browserscale": {
"url": "https://mcp.browserscale.cloud/mcp",
"headers": {
"Authorization": "Bearer sk_your_api_key"
}
}
}
}
Two things worth being precise about:
- Use the
/mcppath. The bare host serves a page that lists every tool with its full description. That page exists so you (or an agent reading the web) can see what the server offers without connecting. A client pointed athttps://mcp.browserscale.cloud/will not speak MCP. - The key travels as a header, never as an argument. No tool takes an
apiKeyparameter; the server reads it off the request. That is what keeps your key out of the model's context window and out of the conversation log.
How sessions work
Nothing is tied to the connection: the session id travels with every call, so a session outlives the conversation that rented it and can be picked up from another client.
rentstarts a browser, opens its first tab and returns asessionIdand a live-view link, where you can watch the browser and take it over with mouse and keyboard. Without a proxy the session uses a managed one in the country you pass, or a random country without one. With your own proxy, country, timezone and language follow its exit IP.- Every other tool takes that
sessionId. Tools that work on a page also take an optionalpageId; without it they act on the tab in front, the one a person would be looking at. stopends the session, and its billing with it.
A session is billed by use while it runs, and ends on its own once its
minutes are up (30 by default), so a forgotten one does not bill
forever. Calling stop when the flow is done frees the browser and its
proxy immediately.
Nothing says the session has to have been rented over MCP. sessions lists
every session running on your key, whoever rented it, which is what makes
live debugging work: the agent can pick up a session your program is
running right now — or the half-finished state a failed run left behind —
and inspect or drive the real page instead of reconstructing what happened
from a stack trace. Attaching doesn't disturb what runs in the session.
The tools
| Group | Tools |
|---|---|
| Sessions | sessions, rent, stop, tabs (list, switch, open, close) |
| Looking | navigate, wait, observe, screenshot, evaluate, network |
| Acting | click, fill, type, press_key, select, hover, scroll, solve_captcha |
| Several at once | steps |
| Everything else | sdk_call |
| What was done | history |
| Docs | docs_read, docs_search |
Each tool is one SDK call, named in its description, and its errors carry
the same codes a program gets. sdk_call covers the rest of the Go SDK by
name — reactions, cookies and storage, auth sessions, request
interception, captcha auto-solve and so on — and a wrong call answers with
the method's real signature. steps runs a stretch that is already known,
such as a form's fields followed by the submit and its wait, in one call.
docs_read and docs_search give the agent these pages, so it checks an
API instead of guessing one.
The network log
A session rented over MCP records its traffic from the first request.
network after a step lists what completed since the last action, without
page assets: what a click or a submit really sent and what came back,
which is the quickest way to tell why a step did nothing. It also shows
one exchange in full with its bodies, and searches URLs, headers and
bodies for a text, such as where a token comes from. See
Network for the SDK calls behind it.
History and code
The server remembers the calls made through it in a session. history
returns them in order, in one of three forms:
flow: what happened, call by call, with what each acted on, how it went and where the page was.goorts: the same calls as the lines a program on the SDK contains. Failed calls are comments, and calls that only looked are left out.
Both mark the places where an action followed another with only looking in
between: there the agent saw the page was ready, and a script has to wait
for it. With echo set on rent, every result carries its own line, for
writing code along the way.
The history and the network log are the server's memory of the calls made through it, not a store: calls your own program made aren't in them, and they start over after about an hour without a call. Every tool works without them.
Prompts
Clients that show MCP prompts offer three starting points. They are shortcuts for wording, not modes; the tools are the same in all of them.
| Prompt | For |
|---|---|
browser_task | A task to get done in a browser. |
browser_script | A flow worked out in a browser and returned as a Go or TypeScript script. |
browser_debug | A program on the SDK that misbehaves; takes the session id if it still runs. |
What it is good at
- Getting a task done on a site that has no API, with the live view open for the parts that are yours, such as a login.
- Attaching to a live run to see what the code is actually looking at:
the page with
observe, ascreenshotwhen the logs do not explain it, the traffic withnetwork. - Proving a selector resolves to exactly one element —
evaluatethe expression you are about to bake intoclick, and check the count. - Racing every outcome a step can have in one
wait, to learn which ones the site actually produces. - Finding the JSON API behind a page in the network log, which is often a cleaner source than the page.
For work that repeats, a program is cheaper than an agent: it runs without
a model in the loop. history is the bridge from one to the other.
From a flow to code
With Studio
Studio runs the whole loop for you. Its agent settles a brief with you, explores the site in a live browser and writes down a map of it, then builds the automation from that map, runs it and fixes what broke. The browser and these docs are built in, so there is nothing to connect. The result is a plain Go module in a folder of its own.
With your own coding agent
Any coding agent that speaks MCP can do the same in your own repository:
- Connect the MCP server as above, so the agent can look at the real page.
- Give it the docs. Every page here is also Markdown at the same URL
with
.mdadded, for example/docs/guides/waiting.md./llms.txtlists them all and/llms-full.txtis every page in one file. Over MCP,docs_readanddocs_searchserve the same pages. - Have it walk the flow in the browser. One pass by hand shows what
the site really does, and
historywithgoortsthen returns the calls that worked as source lines, with the missing waits marked. - Let it run its own work. When a run fails, the session it left
behind is still in
sessions, so the agent can look at the page the code was stuck on.
A first prompt can be as plain as this:
Use the browserscale MCP server to sign in to portal.example once, by hand,
and open the open invoices of one company. Then take the history as Go and
write a program with browserscale-go that collects them for every company
in companies.csv. Use targets that hold on the next load, and race every
outcome a step can have in one Wait.
The program it writes uses the SDK directly; see the Quickstart for its shape in Go and TypeScript.
Gotchas
https://mcp.browserscale.cloud/is not the endpoint. The endpoint ishttps://mcp.browserscale.cloud/mcp. The bare host is a human-readable tool overview.stopwhat yourent. Sessions expire after their minutes, but an abandoned one holds a browser and a proxy until then.- With your own proxy, leave
countryandtimezoneempty. They follow the exit IP; setting them overrides what the proxy implies. - Actions go to the tab in front. A link or script that opens a new tab
brings it to the front, so the next call without a
pageIdacts there. Pass apageIdto stay on a tab, ortabsto switch. observedoesn't wait. After anavigateor a step that changes the page,waitfor what the next step needs first.- The client's key and the program's key are two places. The MCP key lives in your agent's client config; the program it writes needs its own, for example from an environment variable.
- Studio — an automation from a description, without writing the code.
- Reading the page —
GetObservation, the SDK method behind theobservetool. - Targeting elements — how to pick a target that still works tomorrow, which is what you want the agent baking into code.
- Cookies, storage & sessions — carrying a logged-in identity between runs.
- mcp.browserscale.cloud — the full tool list with descriptions.