Skip to content

Commit 46b6b9d

Browse files
author
GitLab CI
committed
feat: add serve command — zero-config WebMCP server with hot reload detection
- flutter-skill serve <url> — auto-discovers all interactive elements - Exposes as MCP-compatible REST API (tools/list, tools/call) - DOM MutationObserver for real-time tool updates - Hot reload detection: Vite HMR, Webpack HMR, React Fast Refresh, Flutter Web - Zero config, zero dependencies, zero code changes needed - Supports --headless, --no-launch, --cdp-port, --port flags - Text snapshot + screenshot endpoints - CORS enabled for browser-based MCP clients
1 parent e486cc1 commit 46b6b9d

3 files changed

Lines changed: 508 additions & 0 deletions

File tree

bin/flutter_skill.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:flutter_skill/src/cli/setup_priority.dart';
88
import 'package:flutter_skill/src/cli/doctor.dart';
99
import 'package:flutter_skill/src/cli/init.dart';
1010
import 'package:flutter_skill/src/cli/demo.dart';
11+
import 'package:flutter_skill/src/cli/serve.dart';
1112

1213
void main(List<String> args) async {
1314
if (args.isEmpty) {
@@ -21,6 +22,7 @@ void main(List<String> args) async {
2122
print(' inspect Inspect interactive elements');
2223
print(' act Perform actions (tap, enter_text, scroll)');
2324
print(' screenshot Take a screenshot of the running app');
25+
print(' serve <url> Zero-config WebMCP server — any site → AI tools');
2426
print(' test <url> Zero-config web testing — launch Chrome + CDP');
2527
print(' doctor Check installation and environment health');
2628
print(' setup Install tool priority rules for Claude Code');
@@ -90,6 +92,9 @@ void main(List<String> args) async {
9092
case 'report-error':
9193
await runReportError(commandArgs);
9294
break;
95+
case 'serve':
96+
await runServe(commandArgs);
97+
break;
9398
case 'test':
9499
// Convenience wrapper: `flutter-skill test <url>` → `server --url=<url>`
95100
if (commandArgs.isEmpty) {

lib/src/bridge/cdp_driver.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,11 @@ class CdpDriver implements AppDriver {
11551155
return null;
11561156
}
11571157

1158+
/// Public CDP method call — used by serve command and external callers.
1159+
Future<Map<String, dynamic>> call(String method,
1160+
[Map<String, dynamic>? params]) =>
1161+
_call(method, params);
1162+
11581163
Future<Map<String, dynamic>> _call(String method,
11591164
[Map<String, dynamic>? params]) async {
11601165
if (_ws == null || !_connected) {

0 commit comments

Comments
 (0)