Glance
An MCP server that gives Claude Code real browser control for web automation, testing, and screenshots.
README
<p align="center"> <img src=".github/assets/glance-logo.png" alt="Glance" width="80" /> </p>
<h1 align="center">Glance</h1>
<p align="center"> <strong>AI-powered browser automation for Claude Code</strong><br/> <em>by <a href="https://debugbase.io">DebugBase</a></em> </p>
<p align="center"> <a href="https://www.npmjs.com/package/glance-mcp"><img src="https://img.shields.io/npm/v/glance-mcp?color=blue&label=npm" alt="npm" /></a> <a href="https://github.com/DebugBase/glance/blob/main/LICENSE"><img src="https://img.shields.io/github/license/DebugBase/glance" alt="License" /></a> <a href="https://github.com/DebugBase/glance/stargazers"><img src="https://img.shields.io/github/stars/DebugBase/glance?style=social" alt="Stars" /></a> <a href="https://discord.gg/RyGk6HP7Uy"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a> </p>
<p align="center"> Navigate, click, screenshot, test — all from your terminal. </p>
What is Glance?
Glance is an MCP server that gives Claude Code a real browser. Instead of guessing what your web app looks like, Claude can actually see it, interact with it, and test it.
You: "Test the login flow on localhost:3000"
Claude: *opens browser* *navigates* *fills form* *clicks submit*
*takes screenshot* *verifies redirect* *checks for errors*
"Login flow works. Found 1 console warning about..."
Features
- 30 MCP tools for complete browser control
- Inline screenshots — Claude sees what the browser sees
- Accessibility snapshots — full page structure as text
- Test scenario runner — define multi-step tests in JSON
- 12 assertion types — exists, textContains, urlEquals, and more
- Session recording — record and replay browser sessions
- Visual regression — pixel-level screenshot comparison
- Network & console monitoring — catch errors and failed requests
- Security controls — URL allowlist/denylist, rate limiting, JS execution policies
- Headed mode — watch the browser in real-time
Quick Start
1. Install
npm install -g glance-mcp
Or add directly to Claude Code:
claude mcp add glance -- npx glance-mcp
2. Configure
Add to your .mcp.json:
{
"mcpServers": {
"glance": {
"command": "npx",
"args": ["glance-mcp"],
"env": {
"BROWSER_HEADLESS": "false"
}
}
}
}
3. Use
Just ask Claude to interact with your web app:
"Open localhost:3000 and take a screenshot"
"Test the signup flow with invalid email"
"Check if the pricing page has all three tiers"
"Run a visual regression test on the dashboard"
Tools Reference
Browser Control (19 tools)
| Tool | Description |
|---|---|
browser_navigate |
Navigate to a URL |
browser_click |
Click an element (CSS selector or text) |
browser_type |
Type into an input field |
browser_hover |
Hover over an element |
browser_drag |
Drag and drop between elements |
browser_select_option |
Select from a dropdown |
browser_press_key |
Press a keyboard key |
browser_scroll |
Scroll the page or to an element |
browser_screenshot |
Capture a screenshot (returned inline to Claude) |
browser_snapshot |
Get the accessibility tree as text |
browser_evaluate |
Execute JavaScript in the page |
browser_console_messages |
Read console logs and errors |
browser_network_requests |
Monitor network activity |
browser_go_back |
Navigate back |
browser_go_forward |
Navigate forward |
browser_tab_new |
Open a new tab |
browser_tab_list |
List all open tabs |
browser_tab_select |
Switch to a tab |
browser_close |
Close the browser |
Test Automation (7 tools)
| Tool | Description |
|---|---|
test_scenario_run |
Run a multi-step test scenario |
test_scenario_status |
Check running scenario status |
test_assert |
Run a single assertion |
test_fill_form |
Auto-fill a form |
test_auth_flow |
Test a login/signup flow |
test_watch_events |
Watch for DOM/network events |
test_stop_watch |
Stop watching events |
Session & Visual (4 tools)
| Tool | Description |
|---|---|
session_start |
Start recording a session |
session_end |
End and save a session |
session_list |
List recorded sessions |
visual_baseline |
Save a visual baseline |
visual_compare |
Compare against baseline |
Test Scenarios
Define multi-step test scenarios in JSON:
{
"name": "Login Flow",
"steps": [
{ "name": "Go to login", "action": "navigate", "url": "http://localhost:3000/login" },
{ "name": "Enter email", "action": "type", "selector": "input[type='email']", "value": "user@test.com" },
{ "name": "Enter password", "action": "type", "selector": "input[type='password']", "value": "password123" },
{ "name": "Click submit", "action": "click", "selector": "button[type='submit']" },
{ "name": "Wait for redirect", "action": "sleep", "ms": 2000 },
{ "name": "Verify dashboard", "action": "assert", "type": "urlContains", "expected": "/dashboard" },
{ "name": "Screenshot result", "action": "screenshot", "screenshotName": "post-login" }
]
}
Assertion Types
| Type | Description |
|---|---|
exists |
Element exists in DOM |
notExists |
Element does not exist |
textContains |
Element text contains value |
textEquals |
Element text equals value |
hasAttribute |
Element has attribute with value |
hasClass |
Element has CSS class |
isVisible |
Element is visible |
isEnabled |
Element is enabled |
urlContains |
Current URL contains value |
urlEquals |
Current URL equals value |
countEquals |
Number of matching elements |
consoleNoErrors |
No console errors |
Configuration
All configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
BROWSER_HEADLESS |
true |
Run browser in headed mode |
BROWSER_SESSIONS_DIR |
.browser-sessions |
Directory for screenshots and sessions |
BROWSER_SECURITY_PROFILE |
local-dev |
Security profile (local-dev, restricted, open) |
BROWSER_VIEWPORT_WIDTH |
1280 |
Browser viewport width |
BROWSER_VIEWPORT_HEIGHT |
720 |
Browser viewport height |
BROWSER_TIMEOUT |
30000 |
Default timeout in ms |
BROWSER_CHANNEL |
— | Browser channel (e.g., chrome, msedge) |
Security Profiles
| Profile | URL Access | JS Execution | Rate Limit |
|---|---|---|---|
local-dev |
All HTTP/HTTPS | Always | 60/min |
restricted |
localhost only | Disabled | 30/min |
open |
Everything | Always | 120/min |
How It Works
graph LR
A["Claude Code<br/>(Agent)"] -- "MCP stdio<br/>tools & results" --> B["Glance<br/>(MCP Server)"]
B -- "Playwright<br/>automation API" --> C["Browser<br/>(Chromium)"]
C -- "screenshots<br/>DOM snapshots" --> B
B -- "inline images<br/>a11y trees" --> A
- Claude Code connects to Glance via MCP (stdio transport)
- Claude calls tools like
browser_navigate,browser_screenshot - Glance translates these into Playwright commands
- Screenshots are returned as base64 images — Claude literally sees the page
- Accessibility snapshots give Claude the full DOM structure as text
Real-World Usage
Glance has been battle-tested on production apps:
- DebugBase (debugbase.io) — 12 scenarios, 104 test steps, 97% pass rate
- GitScribe AI — 16 scenarios, 196 test steps, 96% pass rate
Requirements
- Node.js 18+
- Playwright-compatible browser (auto-installed)
Development
git clone https://github.com/DebugBase/glance.git
cd glance
npm install
npx playwright install chromium
npm run build
npm start
Claude Code Integration
Agent: e2e-tester
Glance ships with a Claude Code agent definition for comprehensive browser testing. The agent knows all 30 tools and follows a structured test workflow: navigate, screenshot, assert, report.
You: "Test the entire login flow on localhost:3000"
Agent: Opens browser → navigates → fills forms → clicks → screenshots → asserts → reports
Skill: /glance-test
Quick E2E test runner. Just provide a URL:
/glance-test https://myapp.com
The skill will:
- Navigate to the URL
- Screenshot and snapshot the page
- Discover all navigation links
- Test each page with assertions
- Check console for JS errors
- Generate a pass/fail report
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。