Repository navigation
ai browser agent local llm
A local model changes exactly one thing about this browser: where the model runs. invisible_playwright_mcp's own interface only ever calls OpenRouter, there is no local-model flag. To actually drive this browser with a model on your own machine, you attach it to an assistant or client that already runs one, over the same MCP connection Claude Code uses.
uvx invisible-playwright-mcp ui --openrouter-key ... reaches OpenRouter and nowhere else. That is not
a default that can be pointed elsewhere with a flag: src/invisible_playwright_mcp/llm.py hardcodes the
OpenRouter base URL, and the ui command refuses to start at all without a key. If
you came here hoping for --ollama, it does not exist in the current source.
The library underneath has the opposite property: invisible_playwright, the plain
Python package this interface talks to over MCP, carries no model at all. Local, in
the sense that the weights never leave your machine, is not a setting on invisible_playwright_mcp's own
interface. It is a different door: an assistant or client that already runs a model
locally, most commonly through something like Ollama's own API, attaching this same
browser to it exactly the way any other MCP client would. Ollama has served tool
calls since 2024, exposing them through a tools parameter on its chat API and
answering with a tool_calls response, and its OpenAI-compatible endpoint accepts
the same shape, which is what makes this route possible at all. Which desktop
clients wire a local model to MCP changes fast enough that naming one here would
age badly; check your client's own documentation for MCP support before planning
around it.
The attachment mechanics do not change based on where the model lives. The Claude Code walkthrough documents the exact shape, even though Claude Code's own model is hosted rather than local:
claude plugin marketplace add oss-invisible/playwright_mcp
claude plugin install invisible-playwright-mcp@oss-invisibleTwo commands, once, and the browser's tools show up in that client from then on. A
client built around a local model takes the equivalent command or config screen for
adding an MCP server; the package on the other end, invisible_playwright_mcp, the
tool names it exposes, and the roughly quarter-gigabyte engine it downloads on first
use are identical regardless of what is asking. The server has no idea whether the
model calling it runs on your GPU or on someone else's, and that is by design: it
only ever sees tool calls.
The best model for an MCP browser agent, and what it really costs lays out what this task actually exercises: well-formed tool calls on every turn, instructions followed closely enough to know when a task is actually done, and long, messy context made mostly of extracted page text. Every word of that applies to a local model, and two of the three get harder at smaller scale.
Context length is the first one to clear. A structural read of an ordinary page is thousands of characters on its own, and in a resent-transcript loop that one read is paid again on every later turn, so a model that runs out of room partway through a task cannot finish it regardless of how well it reasons. Read the context window of the exact model tag you are pulling, not the family's headline number, and compare it against a real page read rather than a hello-world prompt. The second is patience across turns: a real task rarely finishes in one or two calls, and local inference on ordinary hardware is commonly slower per turn than a well-provisioned hosted API, so the wait compounds turn over turn more than it would against a fast one.
Size the machine for the model, not for the browser. The browser side of this is small and measured: what a self-hosted AI agent costs to run puts it at 613 MB of disk and about 900 MB of memory, which is a rounding error next to the weights you are about to load.
Be honest about the failure mode before it costs an afternoon of debugging the wrong thing. After enough turns of a growing, resent transcript, a smaller model tends to repeat a click it already tried, lose a constraint from the original instruction, or declare the task finished with steps still undone. These are the same model-side symptoms the diagnostic page lists for any model; a smaller local one just hits them sooner and more often, because the same growing context that eventually strains a frontier model strains a smaller one several turns earlier. That is not a defect in the browser: the page loaded, the tool call worked, the model simply lost the thread of its own multi-step task.
Even a local model that stumbles on turn eighteen already delivered its real benefit on turn one: the page content it read went to a process on your own machine and nowhere past it. The OpenRouter route sends that same text to whichever provider ends up serving the model you picked, simply by routing a request to a hosted API. For a page you would not want logged on a third party's servers, an internal dashboard, an account page, anything sensitive, a local model is the one route where that stays true regardless of how capable the model turns out to be. That is a reason to accept a weaker model on purpose, not to expect a strong one.
The model-free replay described on
browser problem or model problem? fits a local
setup well, because it shares the same premise: nothing sent anywhere, nothing spent.
Run the failing step against the invisible_playwright library directly, no model
attached. If the failure reproduces, no model change, local or hosted, will fix it. If
the replay goes through cleanly, the local model is the variable, and the next move is
a larger local model, or one hosted run on the same task and seed, before concluding
the whole local approach is the wrong fit.
Can I use a local model with invisible_playwright_mcp's own interface? No. uvx invisible-playwright-mcp ui only
ever calls OpenRouter, hardcoded in the source. A local model means attaching this
browser to a different client over MCP instead.
What does a local model actually buy me for browser agent work? Mostly privacy: page content stays on your machine instead of reaching whichever provider serves a hosted model. Capability is usually the trade, not the goal.
Why does a local model seem to forget the task partway through? The transcript grows every turn, and a smaller model's grip on an early instruction or tool result tends to loosen sooner than a larger one's. The same demand hits every model; a smaller one just fails sooner.
Do I need Ollama specifically? Not by requirement. Any client that speaks MCP for tools and already has a local model sorted, however it serves that model, attaches this browser the same way. Which clients currently do that changes too fast to name reliably here.
How do I know if a bad run is the local model or the browser? Replay the failing step with no model against the library: if it reproduces, the browser side is at fault regardless of any model; if not, the model was the variable.
See also: running an agent unattended on a schedule for the other half of the running question, The best model for an MCP browser agent, and what it really costs, Browser problem or model problem?, and How to use a Playwright MCP server with Claude Code.
Retrieved 2026-09-05.
-
oss-invisible/playwright_mcp, this repository's README,
src/invisible_playwright_mcp/llm.py(the hardcoded OpenRouter base URL and default model) andsrc/invisible_playwright_mcp/cli.py(theuicommand's key requirement and its own note that driving the browser without a model at all is theinvisible_playwrightlibrary's job).
From the invisible_playwright_mcp wiki. This interface has never had a local-model flag to remove; the local route has always run through a different client entirely, and that is worth saying plainly before anyone goes looking for a setting that isn't there.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- A stealth browser MCP, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- What is an agentic browser? Definition and the two kinds
- Open-source agentic browsers: the three layers, compared
- Choosing an MCP server for browser automation: four axes
- Stealth MCP servers compared: Camoufox, nodriver, Patchright
- Playwright MCP alternatives, and the three you don't need
- Autonomous browser agents: the four rungs of autonomy
- What is actually free in the AI browser agent stack
- browser-use on GitHub: what the repo actually gives you
- Playwright MCP vs Chrome DevTools MCP: different jobs
- How to choose among MCP servers: a map by category
- Which MCP servers are worth adding to Claude Code
- MCP on GitHub: finding servers and judging them fast
- MCP vs an API: the decision, and what the wrapper costs
- MCP alternatives: when the protocol is the wrong shape
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Playwright MCP session blocked: four causes, four fixes
- Playwright MCP and captchas: what actually gets you past
- Cloudflare and a browser MCP server: what is being read
- Can an AI agent solve a captcha? The honest answer
- Getting an AI agent to fill out forms
- The best model for an MCP browser agent, and what it really costs
- Browser problem or model problem?
- How to use a Playwright MCP server with Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- How to let Claude Desktop control a browser
- How to add a browser to Cursor as an MCP server
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- How to add a browser to Cline as an MCP server
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why
- Playwright MCP vs the Playwright CLI: which fits when
- Playwright MCP: browser is already in use, and the fix
- Playwright MCP best practices: four decisions that matter
- Playwright MCP with a proxy, and the three leaks it leaves
- A browser MCP server in GitHub Copilot: setup and limits
- Using a browser MCP server for web scraping: the pattern
- Which LLM for browser automation: the four properties
- How to build a browser agent, and what to take instead
- Getting an AI agent to log into a website: three routes
- MCP tools, resources and prompts: who controls each
- How many MCP tools is too many? The context arithmetic
- How to build an MCP server: the decisions, not the scaffold
- Local or remote MCP server: what changes, and what does not
- Writing an MCP client in Python: the thirty-line version
- Self-hosted AI agent: what one actually costs to run
- How long an AI browser agent takes per step, measured
- Text, HTML, snapshot or screenshot: what the agent should read
- Giving an AI browser agent a stopping condition
- Keeping an AI browser agent out of destructive actions
- Why did the AI agent click the wrong thing
- When the page changes under the AI agent
- Running one AI agent task across a list of sites
- Seeing a page as it appears in another country
- Getting data out of a dashboard with no export button
- Two browsers in one session: main and support
- Finding the dead links on a site with an AI agent
- Filling a CRM record from a company's website
- One form submission per spreadsheet row, with an AI agent
- Dated screenshots of a page as evidence
- Checking order and delivery status with an AI agent
- Reading a PDF that opens inside the browser
- Summarising a long page or thread with an AI agent
- Collecting every image on a page with its caption
- Collecting event and course listings with an AI agent
- Cancelling a subscription with an AI agent
- What an AI agent can and cannot do inside an iframe
- Shadow DOM and an AI agent: you can click it, you cannot read it
- How to add a browser to Codex as an MCP server
- What a page snapshot costs, per control
- How to let Gemini CLI use a browser
- Native selects and the ones that only look like selects
- Clicking by selector or by coordinates
- How long the agent waits before it gives up
- What a second browser costs
- Uploading a file with an AI agent, and why this one cannot
- Watching the agent work, and when it is worth it
- When not to use an AI browser agent
- Agent or script: deciding once instead of every time
- Using the keyboard instead of the mouse
- Secrets in an agent task: where they end up
- What an agent run should log
- Deduplicating what an AI agent collects
- Normalising values across sites
- Validating an AI agent's output
- Reading a table with an AI agent
- Driving a site's own search and filters
- The task works headed and fails headless
- How to let the AdaL CLI use a browser