An MCP (Model Context Protocol) server that provides comprehensive browser automation and QA testing capabilities. This server integrates with desplega.ai to offer automated testing, session monitoring, batch test execution, and intelligent test guidance using AAA (Arrange-Act-Assert) framework templates.
Modes:
- 📟 stdio - Standard MCP transport for local integrations (default)
- 🌐 HTTP/SSE - StreamableHTTP transport for remote access and web integrations
- 🔄 tunnel - Persistent WebSocket tunnel for backend-initiated tasks
Learn more: Check out our comprehensive MCP integration guide for detailed setup instructions and advanced usage patterns.
# Run with stdio transport (for MCP clients)
npx @desplega.ai/qa-use-mcp
# Run with HTTP transport (for web/remote access)
npx @desplega.ai/qa-use-mcp --http --port 3000
# Run persistent tunnel (for backend-initiated tasks)
npx @desplega.ai/qa-use-mcp tunnel- MCP Client Configuration (stdio mode)
- HTTP Transport Mode (SSE)
- Tunnel Mode
- Features
- Installation
- Development
- Available Tools
The server requires a desplega.ai API key - you can get one by using the register_user tool or by signing up at desplega.ai.
Standard configuration for most MCP clients:
{
"mcpServers": {
"desplega-qa": {
"command": "npx",
"args": ["-y", "@desplega.ai/qa-use-mcp@latest"],
"env": {
"QA_USE_API_KEY": "your-desplega-ai-api-key"
}
}
}
}Optional: Add
"QA_USE_REGION": "us"to theenvsection to use the US region for faster tunnel connections from North America. If not set, defaults to automatic region selection.
Claude Code
Use the Claude Code CLI to add the QA-Use MCP server (guide):claude mcp add desplega-qa npx @desplega.ai/qa-use-mcp@latest --env QA_USE_API_KEY=your-desplega-ai-api-keyFor US region (optional):
claude mcp add desplega-qa npx @desplega.ai/qa-use-mcp@latest --env QA_USE_API_KEY=your-desplega-ai-api-key --env QA_USE_REGION=usOr add without environment variables and configure them later through the interactive setup:
claude mcp add desplega-qa npx @desplega.ai/qa-use-mcp@latestClaude Desktop
Add to yourclaude_desktop_config.json:
{
"mcpServers": {
"desplega-qa": {
"command": "npx",
"args": ["-y", "@desplega.ai/qa-use-mcp@latest"],
"env": {
"QA_USE_API_KEY": "your-desplega-ai-api-key"
}
}
}
}Cline
Follow https://docs.cline.bot/mcp/configuring-mcp-servers and use the config provided above.Codex
Follow the configure MCP guide using the standard config from above. You can also install the QA-Use MCP server using the Codex CLI:codex mcp add desplega-qa -- npx @desplega.ai/qa-use-mcp@latestCopilot / VS Code
Follow the MCP install guide, with the standard config from above. You can also install the QA-Use MCP server using the VS Code CLI:code --add-mcp '{"name":"desplega-qa","command":"npx","args":["-y","@desplega.ai/qa-use-mcp@latest"],"env":{"QA_USE_API_KEY":"your-desplega-ai-api-key"}}'Cursor
Or install manually:
Go to Cursor Settings -> MCP -> New MCP Server. Use the config provided above.
Continue
Add to your Continueconfig.json:
{
"mcpServers": {
"desplega-qa": {
"command": "npx",
"args": ["-y", "@desplega.ai/qa-use-mcp@latest"],
"env": {
"QA_USE_API_KEY": "your-desplega-ai-api-key"
}
}
}
}Gemini CLI
Install the QA-Use MCP server using the Gemini CLI.Project wide:
gemini mcp add desplega-qa npx @desplega.ai/qa-use-mcp@latestGlobally:
gemini mcp add -s user desplega-qa npx @desplega.ai/qa-use-mcp@latestAlternatively, follow the MCP guide and use the standard config from above.
Gemini Code Assist
Follow the configure MCP guide using the standard config from above.JetBrains AI Assistant & Junie
Go to Settings | Tools | AI Assistant | Model Context Protocol (MCP) -> Add. Use the config provided above.
The same way @desplega.ai/qa-use-mcp can be configured for JetBrains Junie in Settings | Tools | Junie | MCP Settings -> Add. Use the config provided above.
Zed
Add to your Zed settings:{
"mcpServers": {
"desplega-qa": {
"command": "npx",
"args": ["-y", "@desplega.ai/qa-use-mcp@latest"],
"env": {
"QA_USE_API_KEY": "your-desplega-ai-api-key"
}
}
}
}Enter the following prompt in your MCP Client to check if everything is working:
Initialize QA server and test the login form at https://app.example.com
Your MCP client should initialize the server, set up browser automation, and start testing the specified form.
Note
The MCP server will start browser and tunnel resources automatically when needed. First-time setup requires running init_qa_server with interactive=true or providing your desplega.ai API key.
- Browser Management: Launch and control Playwright browser instances with headless/headed modes
- Tunneling: Create public tunnels for browser WebSocket endpoints using localtunnel
- API Integration: Full integration with desplega.ai API for comprehensive QA testing workflows
- Session Management: Create, monitor, and control multiple QA testing sessions with real-time status
- Smart session lifecycle management with automatic cleanup
- Up to 10 concurrent browser sessions with clear error handling
- 30-minute default TTL with automatic deadline refresh on interaction
- Background cleanup task for expired sessions
- Progress Monitoring: Real-time progress notifications with MCP timeout protection (25s max per call)
- Batch Test Execution: Run multiple automated tests simultaneously with dependency management
- Interactive Elicitation: Intelligent prompts when remote sessions need user input to continue
- Test Discovery: Search and list automated tests with pagination and filtering
- Test Run Analytics: View test execution history with performance metrics and flakiness scores
- AAA Framework Templates: Pre-built prompts for login, forms, e-commerce, navigation, and comprehensive testing scenarios
- User Registration: Built-in user registration system for new desplega.ai accounts
- Comprehensive Documentation: Built-in MCP resources with guides, workflows, and best practices
In addition to the standard MCP stdio transport, QA-Use can run with StreamableHTTP transport using Server-Sent Events (SSE). This mode implements the official MCP Streamable HTTP specification and is useful for web-based integrations, remote access, or when you need HTTP-based MCP connectivity.
| Feature | stdio (default) | HTTP/SSE | Tunnel |
|---|---|---|---|
| Use Case | Local MCP clients (Claude Desktop, Cline, etc.) | Web apps, remote access, API integrations | Backend-initiated tasks, CI/CD |
| Setup | Configured in MCP client settings | Start server, connect via HTTP | Single command, auto-registers |
| Authentication | Via environment variables | Bearer token on each request | Via environment variables |
| Network | Local process only | Can be exposed remotely | Tunneled to backend |
| Protocol | Native MCP stdio | MCP over HTTP with SSE | WebSocket via localtunnel |
| Browser | On-demand | On-demand | Persistent with heartbeat |
| Best For | Desktop IDE integrations | Microservices, web dashboards, custom clients | Backend-controlled testing, CI/CD pipelines |
Run the server with the --http or --api flag:
# Default port (3000)
npx @desplega.ai/qa-use-mcp --http
# Custom port
npx @desplega.ai/qa-use-mcp --http --port 8080
# Show help
npx @desplega.ai/qa-use-mcp --helpAll MCP endpoints (except /health) require authentication via Bearer token with a valid desplega.ai API key:
# Establish SSE connection
curl -N -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:3000/mcpGet your API key by:
- Using the
register_usertool - Signing up at desplega.ai
This server implements the MCP Streamable HTTP transport specification:
GET /health
# No authentication required
# Returns server status and version# Establish SSE connection for receiving messages
GET /mcp
Headers: Authorization: Bearer YOUR_API_KEY
# Send JSON-RPC messages to the server
POST /mcp
Headers:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Body: JSON-RPC 2.0 message
# Close session
DELETE /mcp
Headers:
Authorization: Bearer YOUR_API_KEY
MCP-Session-ID: <session-id># Start SSE stream in one terminal
curl -N -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:3000/mcp
# In another terminal, send initialize message
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "test-client",
"version": "1.0.0"
}
}
}'# List available tools
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
# Start automated test session
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "start_automated_session",
"arguments": {
"task": "Test login functionality"
}
}
}'Any MCP client that supports the StreamableHTTP transport can connect to this server. You'll need to:
- Configure the client with the HTTP endpoint:
http://localhost:3000/mcp - Add authentication header:
Authorization: Bearer YOUR_API_KEY - The client will automatically handle SSE streams and JSON-RPC messaging
Note: Most current MCP clients (Claude Desktop, Cline, etc.) use stdio transport by default. The HTTP mode is primarily for:
- Custom integrations and web applications
- Remote server deployments
- Microservices architectures
- API gateways and proxies
When running in HTTP mode:
- ✅ Always use HTTPS in production (consider using a reverse proxy like nginx)
- ✅ Protect your API key - it provides full access to your desplega.ai account
- ✅ Use firewall rules to restrict access to trusted IP addresses
- ✅ Consider rate limiting for public-facing deployments
- ✅ Monitor access logs for suspicious activity
Example nginx configuration for HTTPS:
server {
listen 443 ssl;
server_name qa-mcp.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# Required for SSE
proxy_buffering off;
proxy_read_timeout 24h;
}
}The HTTP mode is perfect for containerized deployments. Example Dockerfile:
FROM node:18-slim
# Install dependencies for Playwright
RUN apt-get update && apt-get install -y \
libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 \
libgbm1 libasound2 libxshmfence1 \
&& rm -rf /var/lib/apt/lists/*
# Install qa-use-mcp
RUN npm install -g @desplega.ai/qa-use-mcp
# Expose port
EXPOSE 3000
# Set API key via environment variable
ENV QA_USE_API_KEY=your-api-key-here
# Start in HTTP mode
CMD ["qa-use-mcp", "--http", "--port", "3000"]Run the container:
docker build -t qa-use-mcp .
docker run -d -p 3000:3000 \
-e QA_USE_API_KEY=your-api-key \
qa-use-mcpDeploy to Vercel for serverless hosting:
Quick setup:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prodVercel Build Settings:
- Build Command:
pnpm build - Output Directory:
dist - Install Command:
pnpm install
Environment Variables (set in Vercel dashboard):
QA_USE_API_KEY- Your desplega.ai API key
- Railway - Better for persistent connections
- Render - Supports long-running services
- Fly.io - Full control over processes
- Self-hosted VPS - No limits
See VERCEL_DEPLOYMENT.md for detailed deployment guide and limitations.
All modes are fully backward compatible. Running without flags uses the standard MCP stdio transport:
# Standard MCP mode (stdio) - default
npx @desplega.ai/qa-use-mcp
# HTTP transport mode (SSE)
npx @desplega.ai/qa-use-mcp --http
# Tunnel mode (persistent WebSocket)
npx @desplega.ai/qa-use-mcp tunnelAll modes support the complete MCP tools and functionality. The HTTP mode follows the official MCP Streamable HTTP specification.
The tunnel mode creates a persistent WebSocket tunnel that allows the desplega.ai backend to initiate browser automation tasks using your local browser. This is perfect for scenarios where you want the backend to control test execution while using your local environment's browser.
| Scenario | Best Mode |
|---|---|
| Backend-initiated tests | Tunnel ✅ |
| CI/CD pipelines with local browsers | Tunnel ✅ |
| Remote test execution on local environment | Tunnel ✅ |
| Interactive MCP client testing | stdio |
| Web dashboard integrations | HTTP/SSE |
- Start Tunnel: Creates a Playwright browser and localtunnel
- Register WebSocket: Sends the tunneled WebSocket URL to desplega.ai backend
- Heartbeat: Sends keepalive signals every 5 seconds to maintain the connection
- Backend Control: Backend can now initiate test sessions using your local browser
# Start tunnel with headless browser (default)
npx @desplega.ai/qa-use-mcp tunnel
# Start tunnel with visible browser
npx @desplega.ai/qa-use-mcp tunnel --visible🔧 QA-Use Tunnel Mode
====================
Mode: Headless
🔑 Validating API key...
✅ API key valid
🌐 Starting browser tunnel...
✅ Browser started
✅ Tunnel created
📡 WebSocket URL: wss://qa-use-123456.lt.desplega.ai/...
✅ Registered with backend
🔄 Heartbeat active (every 5s)
Press Ctrl+C to stop
[10:30:15] ✓ Heartbeat #1 sent
[10:30:20] ✓ Heartbeat #2 sent
[10:30:25] ✓ Heartbeat #3 sent
Set your API key before starting tunnel mode:
export QA_USE_API_KEY=your-desplega-ai-api-key
npx @desplega.ai/qa-use-mcp tunnelOptionally configure the US region for better tunnel performance from North America:
export QA_USE_API_KEY=your-desplega-ai-api-key
export QA_USE_REGION=us
npx @desplega.ai/qa-use-mcp tunnel--visible: Show browser window instead of headless mode (useful for debugging)
Run tunnel mode in your CI/CD pipeline to allow backend-initiated tests:
# .github/workflows/qa.yml
- name: Start QA Tunnel
run: |
export QA_USE_API_KEY=${{ secrets.QA_USE_API_KEY }}
npx @desplega.ai/qa-use-mcp tunnel &
sleep 10 # Wait for tunnel to establishKeep a tunnel running while developing to allow ad-hoc tests from the backend:
# Terminal 1: Keep tunnel running
npx @desplega.ai/qa-use-mcp tunnel
# Terminal 2: Trigger tests from backend via API/dashboard
# The backend will use your local browser through the tunnelWhen you need to see what's happening:
npx @desplega.ai/qa-use-mcp tunnel --visiblePress Ctrl+C to stop the tunnel. The server will:
- Stop sending heartbeats
- Close the tunnel
- Shutdown the browser
- Clean up resources
| Feature | stdio | HTTP/SSE | Tunnel |
|---|---|---|---|
| Control | Local MCP client | HTTP requests | Backend-initiated |
| Browser | On-demand | On-demand | Persistent |
| Heartbeat | N/A | N/A | Every 5s |
| Use Case | Desktop IDEs | Web apps | Backend tasks |
| Visibility | Configurable | Configurable | Headless default |
Install and run directly with npx:
npx @desplega.ai/qa-use-mcpOr install globally:
npm install -g @desplega.ai/qa-use-mcp
qa-use-mcp # or: desplega-qaClone the repository and install dependencies:
git clone <repository-url>
cd qa-use-mcp
pnpm installBuild the project:
pnpm buildStart the development server:
pnpm devThe server exposes the following MCP tools for browser automation and QA testing:
Ensure API key is set, validate authentication, and install Playwright browsers.
Parameters:
apiKey(string, optional): API key for desplega.ai (optional if QA_USE_API_KEY env var is set)
Register a new user account with desplega.ai and receive an API key.
Parameters:
email(string, required): Email address for registration
Update application configuration settings including base URL, login credentials, and viewport type.
Parameters:
base_url(string, optional): Base URL for the application being testedlogin_url(string, optional): Login page URL for the applicationlogin_username(string, optional): Default username for login testinglogin_password(string, optional): Default password for login testingvp_type(string, optional): Viewport configuration type: big_desktop, desktop, mobile, or tablet (default: desktop)
Get the current application configuration details including base URL, login settings, and viewport.
Parameters: None
Reset and cleanup all active browser sessions. This will kill all browsers and tunnels. Use this when you hit the maximum session limit or need to free up resources.
Parameters: None
Search and list all sessions (automated tests and development sessions) with pagination and filtering.
Parameters:
limit(number, optional): Maximum number of sessions to return (default: 10, min: 1)offset(number, optional): Number of sessions to skip (default: 0, min: 0)query(string, optional): Search query to filter sessions by task, URL, or status
Start an automated E2E test session for QA flows and automated testing. Returns sessionId for monitoring.
Parameters:
task(string, required): The testing task or scenario to executeurl(string, optional): Optional URL to test (overrides app config base_url if provided)dependencyId(string, optional): Optional test ID that this session depends on (must be a self test ID created by your app configuration)headless(boolean, optional): Run browser in headless mode (default: false for better visibility)
Start an interactive development session for debugging and exploration. Session will not auto-pilot and allows manual browser interaction.
Parameters:
task(string, required): Description of what you want to explore or debug. Can be a placeholder like "Waiting for user input"url(string, optional): Optional URL to start from (overrides app config base_url if provided)headless(boolean, optional): Run browser in headless mode (default: false for development visibility)
Monitor a session status. Keep calling until status is "closed". Will alert if session needs user input, is idle, or pending.
Parameters:
sessionId(string, required): The session ID to monitorwait(boolean, optional): Wait for session to reach any non-running state with MCP timeout protection (max 25s per call)timeout(number, optional): User timeout in seconds for wait mode (default: 60)
Interact with a session - respond to questions, pause, or close the session.
Parameters:
sessionId(string, required): The session ID to interact withaction(string, required): Action to perform: respond (answer question), pause (stop session), or close (end session)message(string, optional): Your response message (required for "respond" action, optional for others)
Search for automated tests by ID or query. If testId provided, returns detailed info for that test. Otherwise searches with optional query/pagination.
Parameters:
testId(string, optional): Specific test ID to retrieve detailed information for (if provided, other params ignored)query(string, optional): Search query to filter tests by name, description, URL, or task (ignored if testId provided)limit(number, optional): Maximum number of tests to return (default: 10, min: 1) (ignored if testId provided)offset(number, optional): Number of tests to skip (default: 0, min: 0) (ignored if testId provided)self_only(boolean, optional): Filter tests by app configuration. When true, only returns tests created by your application configuration. Default: false to allow running tests from other configs locally.
Execute multiple automated tests simultaneously.
Parameters:
test_ids(array, required): Array of test IDs to executeapp_config_id(string, optional): Optional app config ID to run tests against (uses API key default config if not provided)ws_url(string, optional): Optional WebSocket URL override (uses global tunnel URL by default)
Search automated test runs with optional filtering by test ID or run ID.
Parameters:
test_id(string, optional): Filter test runs by specific test IDrun_id(string, optional): Filter test runs by specific run IDlimit(number, optional): Maximum number of test runs to return (default: 10, min: 1)offset(number, optional): Number of tests to skip (default: 0, min: 0)
The server includes comprehensive MCP resources and prompts:
- Getting Started Guide: Complete setup and usage instructions
- Testing Workflows: Common patterns for interactive, batch, and development testing
- Tool Reference: Detailed documentation for all available MCP tools
aaa_test: Generate structured test scenarios using the Arrange-Act-Assert (AAA) framework with customizable parameters
Create a .env file in your project root or set the following environment variables:
# Required: Your desplega.ai API key
QA_USE_API_KEY=your-desplega-ai-api-key
# Optional: Region selection for tunnel and API routing
# Values: "us" | "auto"
# Default: "auto" (if not set)
# - "us": Uses lt.us.desplega.ai for localtunnel and routes to US region
# - "auto": Uses default lt.desplega.ai and automatic region routing
QA_USE_REGION=us
# Optional: Custom API endpoint (default: https://api.desplega.ai)
QA_USE_API_URL=https://api.desplega.ai
# Optional: Custom app URL (default: https://app.desplega.ai)
QA_USE_APP_URL=https://app.desplega.ai
# Optional: Custom tunnel host (overrides QA_USE_REGION setting)
TUNNEL_HOST=https://lt.desplega.aiThe QA_USE_REGION variable allows you to route your tunnel and API requests to specific regions:
- Not set (default): Uses automatic region selection (
lt.desplega.ai) QA_USE_REGION=us: Uses US-based tunnel host (lt.us.desplega.ai) and routes sessions to the US region. Recommended for users primarily testing from North America.QA_USE_REGION=auto: Explicitly sets automatic region selection (same as not setting it)
Example configuration for US region:
export QA_USE_API_KEY=your-api-key
export QA_USE_REGION=us
npx @desplega.ai/qa-use-mcpNote: If
QA_USE_REGIONis not set, the system automatically defaults to"auto"behavior.
# 1. Initialize server and install browsers
ensure_installed
# 2. Configure app settings (one-time setup)
update_configuration with base_url="https://app.example.com" and login_url="https://app.example.com/login" and login_username="[email protected]"
# 3. Start an automated test session
start_automated_session with task="Test user registration flow"
# 4. Monitor session progress
monitor_session with sessionId="session-123" and wait=true and timeout=300
# 5. Interact with session if needed (respond, pause, or close)
interact_with_session with sessionId="session-123" and action="respond" and message="[email protected]"# 1. Start an interactive dev session (no auto-pilot)
start_dev_session with task="Exploring the checkout flow" and url="https://app.example.com/cart"
# 2. Monitor and interact as needed
monitor_session with sessionId="dev-session-456"
# 3. Close when done
interact_with_session with sessionId="dev-session-456" and action="close"# 1. Find available tests
search_automated_tests with query="login" and limit=10
# 2. Run multiple tests simultaneously
run_automated_tests with test_ids=["login-test-1", "signup-test-2", "checkout-test-3"]
# 3. Monitor progress
search_sessions with limit=20
# 4. Check test run history
search_automated_test_runs with limit=50# Generate a structured test using AAA framework
Use prompt: aaa_test with test_type="login" and url="https://app.example.com/login" and feature="user authentication"# When you hit the 10 session limit or need to free up resources
reset_browser_sessions
# This will clean up all active browsers and tunnels
# Useful when sessions aren't closing properly or you need to restart freshUse the provided test scripts to test MCP server functionality:
# Test server initialization (uses env var if available)
./scripts/test-init.sh
# Test listing sessions
./scripts/test-list-sessions.sh
# Test starting a session
./scripts/test-start-session.sh
# Test with real API key from environment
node scripts/mcp-test.jsThe project is organized into modular components:
src/: Main MCP server implementation with comprehensive tool handlers- MCP protocol implementation with tools, resources, and prompts
- Session management and monitoring with timeout protection
- BrowserSession management with automatic lifecycle tracking
- Each session wraps browser + tunnel with TTL and deadline tracking
- Session types: 'dev', 'automated', and 'test_run'
- Automatic cleanup on expiration or completion
- Real-time progress notifications using MCP logging specification
- AAA framework prompt templates for structured testing
lib/browser/: Browser management functionality using Playwright- Headless and headed browser support
- WebSocket endpoint management for remote control
lib/tunnel/: Tunneling and port forwarding using localtunnel- Public tunnel creation for browser WebSocket access
- Automatic WebSocket URL conversion for remote testing
lib/api/: Complete API client for desplega.ai integration- Session lifecycle management (create, monitor, respond)
- Test discovery and execution
- Test run analytics and history
- User registration and authentication
- Batch test execution with dependency handling
- Limited monitoring calls to 25 seconds to prevent MCP timeouts
- Automatic continuation support for long-running sessions
- Real-time progress notifications during session monitoring
- Pre-built templates for login, forms, e-commerce, and navigation testing
- Comprehensive test scenarios for accessibility, performance, and mobile testing
- Dynamic argument support for customizable test generation
- Complete test run history with performance metrics
- Probabilistic Flakiness Score (PFS) tracking
- Execution timing and error tracking
- Filtering and pagination for large datasets
MIT