Skip to main content

Vision MCP Tools

Vision provides MCP (Model Context Protocol) tools for AI assistants to capture screenshots and run visual tests.

Available Tools

vision_capture

Take a screenshot of a URL.
{
  "name": "vision_capture",
  "arguments": {
    "url": "https://example.com",
    "browser": "chromium",
    "viewport": "desktop"
  }
}
Response:
{
  "snapshot_id": "snap_abc123",
  "url": "https://example.com",
  "browser": "chromium",
  "viewport": { "width": 1280, "height": 720 },
  "image_url": "https://storage.brainzlab.ai/snapshots/snap_abc123.png",
  "captured_at": "2024-01-15T10:30:00Z"
}

vision_compare

Compare a snapshot to its baseline.
{
  "name": "vision_compare",
  "arguments": {
    "snapshot_id": "snap_abc123"
  }
}
Response:
{
  "comparison_id": "cmp_xyz789",
  "status": "pending_review",
  "diff_percentage": 2.5,
  "threshold": 1.0,
  "passed": false,
  "baseline_url": "https://storage.brainzlab.ai/baselines/base_123.png",
  "snapshot_url": "https://storage.brainzlab.ai/snapshots/snap_abc123.png",
  "diff_url": "https://storage.brainzlab.ai/diffs/diff_xyz.png",
  "review_url": "https://vision.brainzlab.ai/compare/cmp_xyz789"
}

vision_test

Run a full visual test suite.
{
  "name": "vision_test",
  "arguments": {
    "pages": ["Homepage", "Pricing"],
    "base_url": "https://staging.example.com"
  }
}
Response:
{
  "run_id": "run_abc123",
  "status": "passed",
  "total_pages": 2,
  "passed": 2,
  "failed": 0,
  "pending_review": 0,
  "duration_seconds": 12.5,
  "results_url": "https://vision.brainzlab.ai/runs/run_abc123"
}

vision_approve

Approve changes and update baseline.
{
  "name": "vision_approve",
  "arguments": {
    "comparison_id": "cmp_xyz789",
    "reason": "Intentional header redesign"
  }
}
Response:
{
  "comparison_id": "cmp_xyz789",
  "status": "approved",
  "new_baseline_version": 4,
  "message": "Changes approved. New baseline created."
}

vision_list_failures

List failed comparisons needing review.
{
  "name": "vision_list_failures",
  "arguments": {
    "limit": 10
  }
}
Response:
{
  "comparisons": [
    {
      "id": "cmp_xyz789",
      "page": "Homepage",
      "diff_percentage": 2.5,
      "status": "pending_review",
      "captured_at": "2024-01-15T10:30:00Z",
      "review_url": "https://vision.brainzlab.ai/compare/cmp_xyz789"
    }
  ],
  "total": 1
}

Example Conversations

User: “Take a screenshot of our homepage” Assistant uses: vision_capture with url: "https://example.com" Response: “I’ve captured a screenshot of your homepage. You can view it here: [link]. The capture was taken at 1280x720 using Chromium.”
User: “Run visual tests on staging” Assistant uses: vision_test with base_url: "https://staging.example.com" Response: “Visual tests completed. 8 of 10 pages passed. 2 pages have visual differences that need review. You can review them here: [link]”
User: “Approve the homepage changes” Assistant uses: vision_approve with the comparison ID Response: “I’ve approved the homepage changes. The new screenshot is now the baseline (version 4).”

Setup

Add Vision MCP to your Claude Desktop or Cursor configuration:
{
  "mcpServers": {
    "brainzlab-vision": {
      "command": "npx",
      "args": ["-y", "@brainzlab/mcp-server"],
      "env": {
        "BRAINZLAB_SECRET_KEY": "your-secret-key",
        "BRAINZLAB_PRODUCTS": "vision"
      }
    }
  }
}