Web Agent MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Web Agent MCPOpen https://example.com and take a screenshot of the page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Web Agent MCP
An MCP server for browser automation built with TypeScript and Playwright.
Web Agent MCP gives AI coding agents access to a real browser through MCP tools. The browser runs on your machine, while the MCP server can be exposed over HTTPS using ngrok so remote coding agents can connect to it.
Features
Web Agent MCP currently provides tools for:
Web navigation
Page inspection
Semantic page inspection
Clicking and typing
Form filling
Selecting options
Scrolling
Keyboard actions
Hovering
Screenshots
Waiting
Browser history
Multiple tabs
Structured extraction
File upload and download
Waiting for elements, text, and navigation
Browser permissions
Browser sessions
Browser profiles
Remote browser connections
Multi-step browser tasks
Related MCP server: Real Browser MCP
How it works
The basic setup looks like this:
AI Coding Agent
|
| MCP over HTTPS
v
ngrok
|
| http://localhost:3000
v
Web Agent MCP
|
v
Playwright
|
v
Chromium BrowserThe MCP server listens on port 3000.
The MCP endpoint is:
http://localhost:3000/mcpWhen ngrok is running, the coding agent connects to:
https://YOUR-NGROK-DOMAIN/mcpThe browser itself stays on the machine running Web Agent MCP.
Requirements
Before starting, install:
Node.js 20 or newer
Git
GitHub account
ngrok
A coding agent that supports MCP
Playwright is included as a project dependency.
Clone the Repository
To create your own copy of the project, clone the repository:
git clone https://github.com/sankalpsinghcoder-ai/web-agent-mcp.gitMove into the project:
cd web-agent-mcpIf you want to use a different directory name:
git clone https://github.com/sankalpsinghcoder-ai/web-agent-mcp.git my-web-agent
cd my-web-agentIf you want your own independent GitHub repository, you can fork the repository on GitHub and then clone your fork.
Install Dependencies
Install the Node.js dependencies:
npm installInstall the Chromium browser used by Playwright:
npx playwright install chromiumBuild the Project
Build the TypeScript project:
npm run buildThe compiled files will be placed in:
dist/Run the MCP Server
For development:
npm run devFor the compiled version:
npm startThe server runs on:
http://localhost:3000The MCP endpoint is:
http://localhost:3000/mcpThe health endpoint is:
http://localhost:3000/healthYou can open the health endpoint in a browser to check that the server is running.
Expected response:
{
"status": "ok",
"service": "web-agent-mcp",
"version": "0.2.0"
}Expose the MCP Server with ngrok
Because coding agents need to reach the MCP server over the network, expose port 3000 using ngrok.
First, make sure the MCP server is running:
npm run devKeep that terminal open.
Open a second terminal and run:
ngrok http 3000ngrok will give you an HTTPS forwarding URL similar to:
Forwarding https://example-name.ngrok-free.app -> http://localhost:3000Your MCP URL is:
https://example-name.ngrok-free.app/mcpUse that /mcp URL when configuring your coding agent.
Do not use only:
https://example-name.ngrok-free.appThe MCP endpoint is:
https://example-name.ngrok-free.app/mcpKeep Both Terminals Running
You need both processes running:
Terminal 1
npm run devTerminal 2
ngrok http 3000The flow is:
Coding Agent
|
v
https://example-name.ngrok-free.app/mcp
|
v
ngrok
|
v
localhost:3000/mcp
|
v
Web Agent MCP
|
v
Playwright
|
v
ChromiumIf you stop ngrok, remote coding agents will no longer be able to connect.
Configure Web Agent MCP
Replace:
YOUR_NGROK_URLwith the HTTPS URL generated by ngrok.
For example:
https://example-name.ngrok-free.app/mcpAntigravity
Antigravity supports remote MCP servers through serverUrl.
Open the MCP configuration in Antigravity and add:
{
"mcpServers": {
"web-agent": {
"serverUrl": "https://YOUR_NGROK_URL/mcp"
}
}
}For example:
{
"mcpServers": {
"web-agent": {
"serverUrl": "https://example-name.ngrok-free.app/mcp"
}
}
}In Antigravity IDE, MCP servers can be managed from the MCP Servers section. Custom servers can also be added through the raw mcp_config.json configuration.
Antigravity CLI supports global and workspace MCP configuration. The global configuration is:
~/.gemini/config/mcp_config.jsonA workspace configuration can be placed at:
.agents/mcp_config.jsonAfter adding the server, reload the MCP configuration and verify that web-agent is connected.
Reference: https://antigravity.google/docs/mcp
Cursor
Cursor supports remote Streamable HTTP MCP servers.
For a project-specific configuration, create:
.cursor/mcp.jsonAdd:
{
"mcpServers": {
"web-agent": {
"url": "https://YOUR_NGROK_URL/mcp"
}
}
}For example:
{
"mcpServers": {
"web-agent": {
"url": "https://example-name.ngrok-free.app/mcp"
}
}
}Cursor also supports a global MCP configuration at:
~/.cursor/mcp.jsonAfter saving the configuration, restart or reload Cursor if necessary and check that the server appears in the MCP tools.
Cursor CLI uses the same MCP configuration as the IDE.
Reference: https://docs.cursor.com/context/model-context-protocol
Claude Code
Claude Code supports remote HTTP MCP servers.
Run:
claude mcp add --transport http web-agent https://YOUR_NGROK_URL/mcpFor example:
claude mcp add --transport http web-agent https://example-name.ngrok-free.app/mcpThen check the configured MCP servers:
claude mcp listThe web-agent server should appear in the list.
Claude Code's current remote HTTP configuration uses the MCP URL directly.
Reference: https://code.claude.com/docs/en/mcp
VS Code / GitHub Copilot
VS Code supports HTTP MCP servers through mcp.json.
For a project-level configuration, create:
.vscode/mcp.jsonUse:
{
"servers": {
"web-agent": {
"type": "http",
"url": "https://YOUR_NGROK_URL/mcp"
}
}
}For example:
{
"servers": {
"web-agent": {
"type": "http",
"url": "https://example-name.ngrok-free.app/mcp"
}
}
}Save the file and start the MCP server from VS Code.
You can verify the connection through:
Command Palette
-> MCP: List ServersThe server should appear as:
web-agentReference: https://code.visualstudio.com/docs/agents/reference/mcp-configuration
GitHub Copilot CLI
GitHub Copilot CLI supports remote HTTP MCP servers.
Run:
copilot mcp add --transport http web-agent https://YOUR_NGROK_URL/mcpFor example:
copilot mcp add --transport http web-agent https://example-name.ngrok-free.app/mcpThe configuration is stored in the Copilot MCP configuration.
You can also inspect the configuration manually.
Reference: https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers
Other MCP Clients
If your coding agent supports Streamable HTTP MCP servers, use:
https://YOUR_NGROK_URL/mcpThe exact configuration format depends on the client.
The important values are:
Transport: Streamable HTTP
URL: https://YOUR_NGROK_URL/mcpDo not use the local URL when configuring a remote coding agent:
http://localhost:3000/mcpUse the ngrok HTTPS URL instead:
https://YOUR_NGROK_URL/mcpAvailable MCP Tools
Navigation
browser_navigate
browser_back
browser_forward
browser_reloadPage inspection
browser_inspect
browser_inspect_semantic
browser_read
browser_get_element
browser_extractInteraction
browser_click
browser_type
browser_fill_form
browser_select
browser_scroll
browser_keyboard
browser_hoverScreenshots and waiting
browser_screenshot
browser_wait
browser_wait_for_element
browser_wait_for_text
browser_wait_for_navigationTabs
browser_new_tab
browser_switch_tab
browser_close_tab
browser_list_tabsFiles
browser_upload_file
browser_downloadBrowser state
browser_permissions
browser_session
browser_profile
browser_remoteHigh-level tasks
browser_taskExample
Once everything is running, give your coding agent a normal browser task such as:
Visit my GitHub profile at github.com/sankalpsinghcoder-ai, explore the profile and repositories, open a few relevant repositories, inspect their README and available information, and give me a concise summary of what you found.The agent can decide which browser operations are needed and use the MCP server to perform them.
Development
Start the development server:
npm run devBuild:
npm run buildRun the compiled version:
npm startRun ngrok:
ngrok http 3000Project Structure
web-agent-mcp/
├── src/
│ └── index.ts
├── dist/
├── package.json
├── package-lock.json
├── tsconfig.json
└── .gitignoredist/ is generated during the build and should not normally be committed to Git.
Configuration
The server uses port 3000 by default.
You can change the port with the PORT environment variable.
For example:
PORT=4000 npm run devOn Windows PowerShell:
$env:PORT=4000
npm run devIf you change the port, expose the same port through ngrok:
ngrok http 4000Security
This project currently exposes a browser-control MCP server through HTTP.
If you run:
ngrok http 3000the MCP endpoint becomes reachable from the internet through the ngrok URL.
This means anyone who has access to the MCP URL may potentially be able to connect to the server and use the available browser tools, depending on the MCP client's behavior.
Do not expose this setup publicly for sensitive browsing.
In particular, do not use an unauthenticated public tunnel while:
logged into personal accounts
accessing banking or financial websites
accessing private company systems
handling passwords or authentication tokens
accessing sensitive files
using a browser profile containing private sessions
The current project is intended primarily for development and testing.
Authentication and stronger access control should be added before using the server as a public service.
Troubleshooting
MCP server does not start
Run:
npm install
npm run buildIf the build succeeds, run:
npm run devPlaywright browser does not start
Install Chromium:
npx playwright install chromiumngrok connection does not work
Check that the MCP server is running first:
http://localhost:3000/healthThen start ngrok:
ngrok http 3000Make sure the MCP client uses:
https://YOUR_NGROK_URL/mcpand not just:
https://YOUR_NGROK_URLThe coding agent cannot see the tools
Check:
The Node server is running.
ngrok is running.
The ngrok URL is correct.
/mcpis included in the URL.The MCP server is enabled in your coding agent.
The coding agent has reloaded its MCP configuration.
Roadmap
The project is being developed toward a more capable browser agent with:
Better semantic DOM understanding
Stable element identification
Structured page extraction
More reliable browser actions
Better waiting and synchronization
Authentication and session handling
Browser profiles
Remote browser support
Multi-step browser tasks
Improved recovery when pages change
More reliable agent-driven workflows
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Issues and pull requests are welcome.
If you find a browser action that does not work reliably on a particular website, include:
The tool being used
The website or type of page
What was expected
What actually happened
The relevant error message
This makes it easier to reproduce and fix the problem.
This server cannot be deployed
Maintenance
Related MCP Connectors
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Hyperbrowser MCP — wraps the Hyperbrowser AI-agent browsing API
Scrape, crawl and search the web for AI agents via MCP.
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI to control browsers via natural language for web automation, testing, and data scraping. Supports Chrome-based browsers and integrates with any MCP-compatible AI tool.172-
- AlicenseNot gradedqualityDmaintenanceProvides a real browser that bypasses bot detection (Cloudflare, Turnstile) for AI agents, enabling navigation, clicking, typing, screenshots, and data collection through MCP tools.83 npmMIT
- AlicenseBqualityAmaintenanceProvides AI agents with a real browser environment for web automation, memory, and secure credential management through 15 MCP tools.15MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to control and interact with a Chrome browser via MCP, providing tools for navigation, screenshots, clicking, form filling, content extraction, and tab management.-