Skip to main content
Glama

Deti Google Flow MCP Plugin (@deti/google-flow-mcp)

English documentation · Changelog · License (MIT)

Plugin MCP chuẩn kho plugin Deti (transport stdio, khai báo tại deti-plugin.json) để tạo ảnh (Nano Banana) và tạo video (Veo / Omni Flash) bằng Google Flow qua hồ sơ trình duyệt Chromium cục bộ tách biệt — không cần API key tạo media, không lưu mật khẩu Google.


Tính năng chính

  • Máy chủ MCP chuẩn stdio với tiền tố flow_, JSON Schema đầu vào đầy đủ (enum cho model, tỉ lệ, độ phân giải), outputSchema + structuredContent, và annotations (readOnlyHint, destructiveHint, openWorldHint).

  • Tạo ảnh & video bất đồng bộ không treo lượt: mọi lời gọi MCP hoàn tất trong ≤ 30 giây; video trả jobId ngay kèm hỗ trợ notifications/progress (khi client có progressToken) và hỏi lại qua flow_job_status.

  • Chạy ẩn (headless) mặc định: mọi thao tác bình thường chạy nền hoàn toàn; chỉ khi cần đăng nhập (flow_account_login) mới mở cửa sổ trình duyệt thu nhỏ / nằm sau (không chiếm focus, nhấp nháy trên thanh tác vụ) và tự đóng phiên headless trùng hồ sơ trước đó.

  • Tách dữ liệu khỏi mã nguồn: hồ sơ trình duyệt, cookie, phiên đăng nhập, danh sách job và tệp đầu ra mặc định lưu trong DETI_PLUGIN_DATA_DIR.

  • Bảo mật & an toàn: không log cookie / token / email, không viết cứng tài khoản hay đường dẫn máy, trả mã lỗi rõ (needs_login, quota_exceeded, timeout, blocked_prompt…) mà không lộ stack trace.


Related MCP server: google-flow-mcp

Yêu cầu môi trường

  • Node.js >= 20 (khuyến nghị Node 22+)

  • Trình duyệt nhân Chromium đã cài sẵn trên máy (Google Chrome, Chromium, Brave, hoặc Microsoft Edge) — không cần tải Chromium riêng của Playwright

  • Tuỳ chọn: ffprobe trong PATH (để đo thêm codec và thời lượng video; ảnh vẫn tự đọc được width/height mà không cần ffprobe)


Cài đặt

1. Cài từ trang quản trị Deti (Khuyến nghị)

Plugin khai báo đầy đủ tại deti-plugin.json. Khi cài từ kho plugin Deti, hệ thống tự chạy:

npm ci
npm run build

và kiểm tra sức khoẻ bằng công cụ flow_doctor.

2. Cài đặt & biên dịch cục bộ trên máy bất kỳ

npm ci
npm run build

Chạy thử & kiểm tra

Kiểm tra bằng MCP Inspector CLI

# Liệt kê danh sách công cụ & JSON Schema
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list

# Kiểm tra môi trường (Node, trình duyệt, thư mục dữ liệu, phiên đăng nhập)
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/call --tool-name flow_doctor

Chạy bộ kiểm thử tự động

npm run check

Chạy bằng CLI cục bộ (tuỳ chọn)

npm run doctor
npm run cli -- browser detect
npm run cli -- account list
npm run cli -- job list --limit 10

Bộ công cụ MCP (flow_*)

Công cụ

Mục đích

Quyền mặc định trong deti-plugin.json

flow_generate_image

Tạo ảnh mới (mặc định nano-banana, các model hoạt động: nano-banana-2-1, nano-banana-pro, nano-banana-2-lite)

allow

flow_generate_video

Tạo video mới (mặc định omni-flash → omni-1-2-flash hỗ trợ 3–15s; hoặc veo-3-1-lite / veo hỗ trợ 4/6/8s, aspectRatio, resolution, inputImage, outputDir)

allow

flow_job_status

Tra trạng thái job (queued | running | done | failed), progress %, danh sách tệp kết quả files

allow

flow_account_status

Kiểm tra phiên đăng nhập Google Flow hiện tại hoặc xác nhận login vừa hoàn tất

allow

flow_account_login

Mở cửa sổ trình duyệt nằm sau (không lấy focus) để đăng nhập Google Flow, trả waiting_for_login

askAdmin

flow_account_logout

Đăng xuất và xoá sạch hồ sơ trình duyệt / cookie của tài khoản

askAdmin

flow_doctor

Kiểm tra Node.js, Chrome/Edge, FFprobe, thư mục dữ liệu và trạng thái phiên

allow

flow_inspect_account

Soi danh sách model, tỉ lệ, thời lượng và mức upscale thực tế trên workspace

ask

flow_list_jobs

Liệt kê các job đã lưu (lọc theo tài khoản, trạng thái, loại media)

ask

flow_upscale_video

Upscale video đã hoàn tất lên 1080p, 2x, 4k hoặc highest_available

ask

flow_download_job

Tải lại đúng tệp kết quả của job theo định danh đã ghi nhận

ask


Biến môi trường

Biến

Mặc định

Ý nghĩa

DETI_PLUGIN_DATA_DIR

Thư mục dữ liệu người dùng theo HĐH

Thư mục dữ liệu của plugin (ưu tiên cao nhất): lưu profiles/, jobs/, outputs/, diagnostics/

FLOW_MCP_DATA_DIR

(dùng khi chưa đặt DETI_PLUGIN_DATA_DIR)

Biến tương thích ngược cho thư mục dữ liệu

FLOW_MCP_BROWSER_EXECUTABLE

Tự dò Chrome / Chromium / Brave / Edge

Đường dẫn tuyệt đối tới tệp thực thi trình duyệt

FLOW_MCP_HEADLESS

auto

auto / 1 (chạy ẩn mặc định, chỉ hiện cửa sổ nền khi flow_account_login); 0 (hiện cửa sổ khi gỡ lỗi)

FLOW_MCP_LOG_LEVEL

info

Mức log ghi ra stderr: debug, info, warn, error, silent

FLOW_MCP_INITIAL_WAIT_SECONDS

15

Trần chờ ban đầu cho tạo ảnh (1–25 giây, luôn giữ tổng thời gian lệnh ≤ 30 giây)


Giới hạn

  1. Cần trình duyệt Chromium cục bộ: máy chạy plugin phải có sẵn Google Chrome, Chromium, Brave hoặc Microsoft Edge.

  2. Cần tài khoản Google có quyền truy cập Google Flow: lần đầu sử dụng (hoặc khi phiên hết hạn), quản trị viên/người dùng cần đăng nhập tương tác qua flow_account_login.

  3. Phụ thuộc giao diện web Google Flow: plugin điều khiển Google Flow qua trình duyệt cục bộ; khi Google thay đổi DOM lớn, cần cập nhật bảng selector tại src/flow/selectors.ts.

  4. Hạn mức tín dụng (credits / quota): mỗi tài khoản chịu giới hạn tín dụng của Google AI; khi gặp quota_exceeded cần dừng thử lại.

  5. Tác vụ video bất đồng bộ: video Veo thường mất 30–180 giây để render trên máy chủ Google nên flow_generate_video luôn trả jobId ngay để client hỏi lại qua flow_job_status.

  6. Không thay thế công cụ sửa ảnh cục bộ: dùng cho tạo ảnh/video mới; các thao tác cắt, ghép chữ, đổi kích thước hay tách nền ảnh có sẵn nên dùng công cụ xử lý ảnh chuyên dụng.


Cấu trúc thư mục

deti-plugin.json          # Khai báo plugin chuẩn kho Deti (v7.2 stdio)
icons/google-flow.svg     # Biểu tượng plugin
guides/google-flow/       # Hướng dẫn ngắn gọn cho AI Agent (vi.md, en.md)
src/
├── config/               # Biến môi trường & hằng số enum
├── domain/               # Kiểu dữ liệu, mã lỗi chuẩn, phân giải model & đường dẫn thuần
├── infra/                # Logger che dữ liệu nhạy cảm, store, file lock, trình duyệt, media probe
├── flow/                 # Selector & driver điều khiển Google Flow
└── mcp/                  # Máy chủ MCP stdio, schemas, outputSchema, 11 tool flow_*
tests/                    # Unit test, test schema/lỗi MCP, test MCP Inspector

Available Tools

11 tools
flow_account_loginSign In to Google FlowA

Open a minimized, unfocused browser window for interactive Google Flow sign-in and return waiting_for_login immediately. Only call when flow_account_status reports needs_login or when asked to connect/reconnect an account.

Inputs: force, label, accountId. Returns: status, message, loginUrl, accountId

flow_account_logoutSign Out of Google FlowA
DestructiveIdempotent

Sign out a Google Flow account, close its browser sessions, and delete its saved profile cookies. Only call when an administrator explicitly requests disconnecting or resetting an account.

Inputs: accountId, removeRecord. Returns: status, message, accountId, removedRecord, +1 more

flow_account_statusCheck Google Flow Account StatusA
Read-onlyIdempotent

Check whether a Google Flow account is signed in and ready before generating media, or verify if an in-progress login window has finished. Call this before generation when unsure of login state.

Inputs: accountId, verifyLive. Returns: status, message, accounts, authenticated, +2 more

flow_doctorRun Google Flow Plugin DiagnosticsA
Read-onlyIdempotent

Inspect local environment health (Node.js version, detected Chrome/Chromium/Edge browser, plugin data directory, FFprobe, and Google Flow login session) without opening a browser. Run during installation or when troubleshooting errors.

Inputs: accountId. Returns: ok, node, issues, server, +11 more

flow_download_jobDownload Google Flow Job FilesA
Idempotent

Download or re-download the exact tracked output files for an existing Google Flow job into its outputDir. Call when media files need to be retrieved again for a ready or completed job.

Inputs: jobId (required). Returns: error, files, jobId, model, +7 more

flow_generate_imageGenerate Image with Google FlowA

Generate new images or illustrations from a text prompt using Google Flow (defaults to Nano Banana) and save them to outputDir or the plugin data folder. Use when the user asks to create new images; poll flow_job_status if status is queued or running.

Inputs: prompt (required), count, model, outputs, +7 more. Returns: error, files, jobId, model, +7 more

flow_generate_videoGenerate Video with Google FlowA

Start a Google Flow video generation job (defaults to Veo, 5-15s) with an optional input image and return a jobId promptly without blocking. Use when the user asks to generate a new video, then poll flow_job_status until done.

Inputs: prompt (required), count, model, outputs, +12 more. Returns: error, files, jobId, model, +7 more

flow_inspect_accountInspect Live Google Flow CapabilitiesA
Read-onlyIdempotent

Inspect live models, aspect ratios, clip durations, and upscale options currently available in the connected Google Flow workspace. Call when verifying account-specific model options.

Inputs: accountId. Returns: url, language, pageKind, signedIn, +7 more

flow_job_statusCheck Google Flow Job StatusA
Read-onlyIdempotent

Poll the status (queued, running, done, failed), progress percentage, and downloaded files of a Google Flow job. Call repeatedly with the same jobId until done or failed; never resubmit a running prompt.

Inputs: jobId (required), waitSeconds. Returns: error, files, jobId, model, +7 more

flow_list_jobsList Google Flow JobsA
Read-onlyIdempotent

List recent persisted Google Flow generation jobs filtered by account, status, or media type without opening a browser. Call when looking up a previously submitted jobId.

Inputs: limit, status, accountId, mediaType. Returns: jobs, count

flow_upscale_videoUpscale Google Flow VideoA

Upscale an existing Google Flow video job to a higher resolution (1080p, 2x, 4k, or highest_available). Call only after flow_job_status confirms the video job is done.

Inputs: jobId (required), resolution (required). Returns: error, files, jobId, model, +7 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools target a clearly distinct resource+action (generate image vs video, upscale, download, list, status, login/logout). The only soft overlap is flow_account_status vs flow_inspect_account and flow_doctor, which all report on account/environment state, but descriptions make the boundaries reasonably clear.

    Naming Consistency4/5

    All tools share a consistent flow_ prefix and mostly follow verb_noun (flow_generate_image, flow_upscale_video, flow_download_job, flow_list_jobs, flow_account_login). A few are noun-first state checks (flow_job_status, flow_doctor), which is a minor deviation but still predictable.

    Tool Count5/5

    11 tools is well within the ideal 3-15 range for a media-generation server. Each tool covers a distinct lifecycle step (setup, auth, generate, poll, list, upscale, download) with no filler.

    Completeness4/5

    The lifecycle is largely covered: diagnostics, account auth/inspect, image/video generation, job polling/listing, upscaling, and downloading. Notable gaps are job cancellation/deletion for stuck or unwanted jobs and upscaling for images (only video upscale exists).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers