smithery.ai

flutter-control-and-screenshot

Guide on how to control a Flutter app using flutter_driver via MCP and capture screenshots.

First seen Apr 1, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,359 B
  • docs SUMMARY.md 129 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Flutter Driver Control & Screenshot

This skill outlines the process of adding flutter_driver support to a Flutter application, launching it via the Dart MCP server, controlling it (tapping, finding widgets), and capturing screenshots (handling Web/Desktop specific constraints).

Prerequisites

  1. Dart MCP Server: Ensure the dart-mcp-server is active.
  2. Flutter Project: You need a working Flutter project.

Step 1: Add Dependency

Add flutterdriver to the devdependencies in your pubspec.yaml.

dev_dependencies:
  flutter_driver:
    sdk: flutter

Run dart pub get or use the mcpdart-mcp-serverpub tool.

Step 2: Create Driver Entry Point

Create a separate entry point, typically test_driver/app.dart, to enable the driver extension without polluting main.dart.

[!IMPORTANT]
Replace yourapppackage_name with the actual name of your package as defined in pubspec.yaml.

// test_driver/app.dart
import 'package:flutter_driver/driver_extension.dart';
import 'package:your_app_package_name/main.dart' as app; // Import your main app

void main() {
  // Enable the extension
  enableFlutterDriverExtension();

  // Run the app
  app.main();
}

Step 3: Launch App via MCP

Use the mcpdart-mcp-serverlaunch_app tool.

  • target: test_driver/app.dart
  • device: chrome (or macos, linux, windows)
  • root: Absolute path to your project root.

Note: The tool returns a DTD URI (Data Tooling Daemon) and a PID. Save these.

Step 4: Connect to DTD

Use mcpdart-mcp-serverconnectdarttooling_daemon with the URI returned from the launch step.

{
  "uri": "ws://127.0.0.1:..."
}

Step 5: Web Screenshot Strategy (Browser Subagent)

If running on Web (Chrome), flutterdriver's screenshot command may not work or may not be supported directly in all environments. A robust fallback is to use the browsersubagent.

  1. Get App URL: Use mcpdart-mcp-servergetapplogs with the app's PID. Look for lines like A Dart VM Service on Chrome is available at: http://127.0.0.1:XXXXX. The app logs usually contain the local HTTP URL.
  2. Navigate & Snapshot: Call browser_subagent.

- Task: "Navigate to [URL]. Wait for render. Take a screenshot."

Step 6: Control the App (Flutter Driver)

Use mcpdart-mcp-serverflutter_driver to interact with the app.

  • Get Widget Tree: mcpdart-mcp-servergetwidgettree (useful to find keys/labels).
  • Tap:

``json { "command": "tap", "finderType": "ByText", "text": "Settings" } ``

  • Scroll, Enter Text, etc. are also available.

Step 7: Cleanup

Always stop the app when done to free up ports and resources.

  • Use mcpdart-mcp-serverstop_app with the PID.

Example Workflow

  1. Launch test_driver/app.dart.
  2. Connect DTD.
  3. Log Check: Find localhost URL.
  4. Browser Subagent: Navigate & Screenshot (Home/Dashboard).
  5. Flutter Driver: Tap "Tasks" tab.
  6. Browser Subagent: Screenshot (Tasks).
  7. Flutter Driver: Tap "Settings" tab.
  8. Browser Subagent: Screenshot (Settings).
  9. Stop App.