Flutter Structure Mcp

io.github.Nilesh9783由 GitHub 帳號 Nilesh9783 發布v1.0.3更新於 Oct 24, 2026

Audit architecture, security, memory, and code quality in Flutter, Laravel, Node, Python, & Vue.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

一個本機 MCP 伺服器,可從範本產生 Flutter 專案、稽核程式碼庫,並提供執行期效能監控面板。

可以做什麼
依所選架構(clean、MVC、MVVM)、狀態管理、資料庫、後端、網路與路由方案產生新的 Flutter 應用程式,並複製共用元件、擴充功能與輔助工具,再執行 flutter pub get 讓專案可直接編譯。稽核 Flutter、Laravel、Node、Python 與 Vue 程式碼庫的架構、安全性、記憶體與程式碼品質,可選擇產生 HTML/PDF 報告並寄送電子郵件。為專案產生修正建議並套用。啟動本機效能監控面板,分析畫面、HTTP 耗時、堆積記憶體與本機資料庫用量,並匯出 PDF 報告。
適用情境
適合讓助理以一致的架構與相依套件設定快速建立新的 Flutter 應用程式,或對 Flutter、Laravel、Node、Python、Vue 專案執行稽核與修正建議。也適合透過本機面板對執行中的 Flutter 應用程式做效能分析。
執行需求
以 stdio 本機程序執行,需透過 Dart SDK 啟動(例如對伺服器進入點執行 dart run)。README 的設定範例指向本機專案路徑。產生專案與 pub get 需要 Flutter 工具鏈。效能面板會監聽本機 HTTP 埠(預設 8080),裝置需透過 localhost、10.0.2.2、adb reverse 或主機區網 IP 連線。
安裝前請注意
產生專案會寫入目標目錄並執行 flutter create 與 flutter pub get。套用修正的流程會修改專案原始碼,接受前應先檢查變更。稽核會讀取整個程式碼庫,並可將報告寄送到你提供的信箱,因而把專案發現傳送給第三方。效能面板監聽本機埠,並接受同一網路內裝置回報的指標。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Flutter Structure Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Flutter Architect MCP

flutter_architect_mcp is a Model Context Protocol (MCP) server and command-line utility designed to automate the process of bootstrapping new Flutter applications. It sets up architectural structures, injects required package dependencies, sets up routing, databases, networks, and backend configurations, and copies a comprehensive collection of shared utilities, widgets, and extensions into the generated codebase.


What is Provided

The project contains a complete template library and a generator pipeline organized as follows:

├── bin/│   ├── server.dart                 # MCP Server entry point (communicates via stdio)│   └── flutter_architect_mcp.dart  # Direct dart run test script├── config/│   ├── packages.yaml               # Map of package versions for different setup choices│   └── architecture.yaml           # Supported architectures configuration├── lib/│   ├── generators/│   │   ├── project_generator.dart      # Master orchestrator│   │   ├── architecture_generator.dart # Clean, MVC, and MVVM template setup│   │   ├── state_generator.dart        # Bloc, GetX, Provider, Riverpod, RxDart│   │   ├── package_generator.dart      # Database, Router, Network, Backend setup│   │   └── feature_generator.dart      # Generates features (login, dashboard, profile, home)│   ├── models/│   │   └── project_config.dart         # Encapsulates configuration parameters│   ├── services/│   │   ├── copy_service.dart           # Directory cloner with smart import rewriting│   │   ├── flutter_service.dart        # Runs `flutter create` and `flutter pub get`│   │   ├── yaml_service.dart           # YAML parser helper│   │   └── pubspec_service.dart        # Dynamic dependency injector into pubspec.yaml│   └── tools/│       ├── architectures_create/│       │   └── create_project.dart     # CLI runner script│       └── scanners_and_audit_reports/│           └── run_audit.dart          # Audit CLI runner script└── templates/                      # Core template assets    ├── architecture/               # Codebases for clean, mvc, and mvvm    ├── state/                      # State configurations    ├── network/                    # dio, retrofit templates    ├── database/                   # hive, isar, drift templates    ├── backend/                    # firebase, supabase templates    ├── router/                     # go_router, auto_route, own_extensions templates    ├── feature/                    # login, dashboard, profile, home templates    └── shared/                     # Common widgets, extensions, and helpers

Shared Assets Included:

All assets copied from templates/shared are automatically adjusted to compile in the new project:

  • Common Widget Components: Dialogs, custom animated dropdowns, toast messages (flushbars), loaders, WebView wrappers, custom buttons, text fields, and list view loaders.
  • Extensions: Padding, Alignment, Color parsing, String manipulation, DateTime formatting, Double formatting, Shimmer overlays, Svg integration, and TextStyle/BuildContext extensions.
  • Helpers: Shared Preferences wrapper, Validation helpers, Device Connectivity checker, Deep Link helper, Notification helper, Image & Document pickers, Haptics helper, and Force Update checker.

Execution Flow

When a project is generated, the tool executes the following steps:

mermaid
graph TD;    A[Start: CLI or MCP Request] --> B[Run 'flutter create' in Target Dir];    B --> C[Replace default 'lib' folder with Architecture Template];    C --> D[Add State Management Template & Packages];    D --> E[Add Database Templates & Packages];    E --> F[Add Backend Templates & Packages];    F --> G[Add Router Templates & Packages];    G --> H[Add Network Templates & Packages];    H --> I[Copy Features login, dashboard, profile, home];    I --> J[Inject Shared utils, common widgets, helpers, extensions];    J --> K[Rewrite Hardcoded package:expense_tracker/ Imports to package:projectName/];    K --> L[Run 'flutter pub get' in Generated Project];    L --> M[Project Ready & Fully Compilable!];

How to Use & Access

You can execute the generator in three ways:

1. As an MCP Tool (Recommended for AI Assistants)

Configure flutter_architect_mcp in your LLM desktop client (e.g., Claude Desktop, Cursor, or VS Code MCP plugin).

Claude Desktop Configuration:

Add this to your claude_desktop_config.json (usually at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{  "mcpServers": {    "flutter-architect": {      "command": "dart",      "args": [        "run",        "/path/to/your/project/my_mcp/flutter_architect_mcp/bin/server.dart"      ]    }  }}
Provided Tool Schema:
  • Tool Name: create_project
  • Arguments:
    • projectName (String, required): Lowercase, snake_case name of the project.
    • architecture (String, required): clean, mvc, or mvvm.
    • stateManagement (String, optional): bloc, getx, provider, riverpod, or rxdart.
    • database (String, optional): hive, isar, or drift.
    • backend (String, optional): firebase or supabase.
    • network (String, optional): dio or retrofit.
    • router (String, optional): go_router, auto_route, or own_extensions.
    • targetDirectory (String, optional): Absolute path to output directory (defaults to current directory).
Example Client Prompts (Natural Language Commands):
  • Auditing a Codebase (Flutter, Node, Vue, Laravel, Python):

    "Please run a full audit on the project located at /path/to/project. Generate HTML/PDF reports, and email it to [email protected] (optional)."

  • Auto-Detect Technology & Run Audit:

    "Run a full codebase audit on the folder /path/to/project. Automatically detect the project type and output separate reports."

  • Scaffolding a Flutter App:

    "Scaffold a new Flutter app named my_app at /path/to/output with MVVM architecture, Riverpod state, Drift database, and GoRouter."

  • Suggest and Apply Fixes:

    "Generate suggested fixes for /path/to/project and apply them safely."

  • Start Performance Monitor Server:

    "Start the performance monitor dashboard server on port 8080."


2. Via the Command Line Interface (CLI)

You can invoke the standalone CLI tool directly using the standard arguments:

bash
dart run lib/tools/architectures_create/create_project.dart \  --name my_awesome_app \  --arch clean \  --state bloc \  --db hive \  --backend firebase \  --network dio \  --router go_router \  --target /path/to/output/folder
CLI Flags:
  • --name: Name of the project (required)
  • --arch: Architecture style: clean, mvc, mvvm (required)
  • --state: State management: bloc, getx, provider, riverpod, rxdart
  • --db: Local database: hive, isar, drift
  • --backend: Backend service: firebase, supabase
  • --network: Network client: dio, retrofit
  • --router: Routing solution: go_router, auto_route, own_extensions
  • --target: Absolute path of parent folder (defaults to current path)

3. Direct Programmatic Script

Run the pre-configured flutter_architect_mcp.dart script to quickly test or launch a default workspace setup:

bash
dart run bin/flutter_architect_mcp.dart

This script generates a pre-configured project named expense_tracker_with_mcp with clean architecture, bloc, hive, firebase, dio, and go_router in the local directory.


Runtime Performance Check Tool

The Runtime Performance Monitor spins up a local server hosting a live web-based DevTools-like dashboard to profile active screens, HTTP API timing latencies, heap memory (RAM), and local database storage consumption. Stopping a session compiles all metrics into a formatted printable PDF HTML report.

1. Launching the Dashboard Server

You can launch the dashboard server directly from CLI:

bash
dart run lib/tools/scanners_and_audit_reports/run_runtime_perf.dart --port 8080
  • Port Flag: Set custom ports using --port <number> (defaults to 8080).
  • Access Dashboard: Open http://localhost:8080 in your web browser.

2. Registering in MCP Server

You can start the tool via the MCP server using the start_runtime_perf_check tool:

json
{  "name": "start_runtime_perf_check",  "arguments": {    "port": 8080  }}

3. Integrating with Your Flutter Application

Copy the helper code integrations displayed under the Integration Guide tab of your dashboard:

  • Network Request Interceptor: Add the custom Dio interceptor to your HTTP client to log request methods, endpoints, response statuses, and durations.
  • Screen Route Observer: Register the PerfNavigatorObserver in your MaterialApp observers to track navigation changes.
  • Periodic Memory & Storage Streamer: Launch the background timer inside main() to stream RAM (RSS) size and local DB file size points.

All data streams directly to the dashboard, and clicking the Stop & Save PDF button on the dashboard will export a detailed engineering review report with remediation steps!


4. Connecting Simulators, Emulators, & Real Devices

To allow your running mobile app to post metrics back to the local performance server, configure the connection URL according to your target device environment:

A. iOS Simulator (macOS host)

Since the iOS simulator runs directly on the host Mac, it can connect via localhost:

  • Connection URL: http://localhost:8080/api/record
B. Android Emulator (Virtual Device)

Android emulators run within a virtual loopback environment. To access the host machine's localhost, use the special IP address 10.0.2.2:

  • Connection URL: http://10.0.2.2:8080/api/record
C. Physical Android Device (Connected via USB)

You can forward port 8080 from the device back to your computer using ADB:

  1. Run the following command in your terminal:
    bash
    adb reverse tcp:8080 tcp:8080
  2. Your app can now use localhost directly:
    • Connection URL: http://localhost:8080/api/record
D. Physical iOS / Android Device (Connected via Wi-Fi)
  1. Ensure both your development computer and mobile device are connected to the same Wi-Fi network.
  2. Find your computer's local IP address (e.g. 192.168.1.45 or 10.0.0.12).
  3. Use that IP address inside your Flutter app:
    • Connection URL: http://<your-computer-ip>:8080/api/record

來源:README.md,提交 b5ecf6f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分