OLTestStack
MCP server that enables AI agents to automate browser testing via Chromium, providing tools for navigation, interaction, and inspection.
README
OLTestStack — AI Browser Testing Framework
MCP server that exposes high-level browser automation tools for AI agents. Internally drives Chromium via Puppeteer/CDP; externally presents flat, stateless MCP command payloads.
git clone https://github.com/openlearnia/OLTestStack.git
cd OLTestStack
Requirements
- Bun 1.0+ (or Node.js 20+)
- Chromium (bundled with Puppeteer, or set
CHROMIUM_EXECUTABLE_PATH) - Docker (optional, for PostgreSQL persistence)
Ports
| Service | Host port | Container port | Notes |
|---|---|---|---|
| PostgreSQL | 5433 | 5432 | Non-default; avoids local Postgres conflicts |
| App health HTTP | 8081 | 8081 | Optional; only when HEALTH_PORT is set or Docker app profile runs |
MCP transport remains stdio (no TCP port for MCP).
Quick start (local MCP)
bun install
bun run typecheck
bun run dev
Docker + PostgreSQL quickstart
Persistence is optional. Active browser/page sessions stay in-memory for speed; recordings and test reports flush to Postgres on browser close when enabled.
# 1. Start Postgres (host port 5433)
cp .env.example .env
bun run docker:up
# 2. Apply migrations
bun run db:migrate
# 3. Enable persistence and start MCP server
export PERSIST_RECORDING=true
export DATABASE_URL=postgresql://oltest:oltest@localhost:5433/olteststack
bun run dev
Stop infrastructure:
bun run docker:down
Optional: run the app container with health endpoint on 8081:
docker compose --profile app up -d
curl http://localhost:8081/health
Run migrations inside Docker:
docker compose --profile migrate up migrate
Production warning: Default credentials in
.env.example(oltest/oltest) are for local development only. ChangePOSTGRES_USER,POSTGRES_PASSWORD, andDATABASE_URLbefore deploying.
Run the MCP server
bun run dev
Or after building:
bun run build
bun run start
The server communicates over stdio — do not pipe logs to stdout (stderr only for diagnostics).
When PERSIST_RECORDING=true, the server validates DATABASE_URL at startup and writes reports/events to PostgreSQL on browser.close.
Cursor MCP configuration
Add to your Cursor MCP settings (.cursor/mcp.json or Cursor Settings → MCP):
{
"mcpServers": {
"olteststack": {
"command": "bun",
"args": ["run", "dev"],
"cwd": "/Users/kartikbazzad/OLTestStack",
"env": {
"PERSIST_RECORDING": "false"
}
}
}
}
Replace cwd with the absolute path to this project on your machine. Set PERSIST_RECORDING=true and DATABASE_URL if you want Postgres persistence.
Available tools (V1 partial — 19 of 22)
| Category | Tools |
|---|---|
| Browser | browser.launch, browser.close |
| Page | page.create, page.navigate, page.reload, page.close |
| Elements | page.elements, page.find |
| Actions | page.click, page.type, page.press, page.scroll |
| Inspection | page.screenshot, page.snapshot, page.text, page.html |
| Monitoring | page.network, page.console |
| Waiting | page.wait |
Planned (5): assert.exists, assert.text, assert.url, assert.network, test.run
Example flow
browser.launch → page.create → page.navigate → page.find → page.type → page.click → page.wait → page.screenshot → browser.close
Environment variables
| Variable | Default | Description |
|---|---|---|
BROWSER_HEADLESS |
true |
Default headless mode |
CHROMIUM_EXECUTABLE_PATH |
auto | Custom Chromium binary |
DEFAULT_TIMEOUT_MS |
30000 |
General operation timeout |
DEFAULT_NAVIGATION_TIMEOUT_MS |
30000 |
Navigation/reload timeout |
SCREENSHOT_DIR |
./screenshots |
Screenshot output directory |
DATABASE_URL |
— | PostgreSQL connection string (localhost:5433 in dev) |
PERSIST_RECORDING |
false |
Persist recordings/reports to Postgres on flush |
DB_PORT |
5433 |
Documented default host port for local Docker Postgres |
HEALTH_PORT |
— | Optional HTTP health server (8081 in Docker) |
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB |
oltest / oltest / olteststack |
Docker Compose Postgres credentials |
Project structure
src/
├── core/ # Types, errors, registry, config, recording
├── cdp/ # Puppeteer CDP adapter
├── db/ # Drizzle schema, migrations runner, persistence
├── domain/ # Business logic (browser, page, elements)
├── health/ # Optional HTTP health endpoint
└── mcp/ # MCP server, tool registration
Scripts
| Script | Description |
|---|---|
bun run dev |
Start MCP server (stdio) |
bun run build |
Compile TypeScript to dist/ |
bun run typecheck |
Type-check without emit |
bun run test |
Run tests |
bun run docker:up |
Start Postgres via Docker Compose |
bun run docker:down |
Stop Docker Compose services |
bun run db:migrate |
Apply Drizzle SQL migrations |
bun run db:generate |
Generate migrations from schema |
bun run db:studio |
Open Drizzle Studio (DB GUI) |
Documentation
Agent-focused guides for MCP setup, tool reference, workflows, and Cursor skills:
- Guides index
- MCP Server Setup — install, configure Cursor/Claude, troubleshoot
- MCP Tools Reference — schemas, examples, error codes
- Agent Workflows — recommended patterns for AI agents
- Skills — Cursor Agent Skills for browser testing
Cursor setup: project skills (.cursor/skills/) and subagents (.cursor/agents/) ship with the repo; OLTestStack rules live at user level (~/.cursor/rules/olteststack-mcp-usage.mdc, olteststack-typescript.mdc) — see Guides index.
What's next
Phases 5–12 add user actions (page.click, page.type), inspection, monitoring, waiting, assertions, recording reports, and test.run orchestration. See docs/plans/v1-implementation-plan.md.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。