
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.
概览
一个本地 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 访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Flutter Structure Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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:
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:
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):
Provided Tool Schema:
- Tool Name:
create_project - Arguments:
projectName(String, required): Lowercase, snake_case name of the project.architecture(String, required):clean,mvc, ormvvm.stateManagement(String, optional):bloc,getx,provider,riverpod, orrxdart.database(String, optional):hive,isar, ordrift.backend(String, optional):firebaseorsupabase.network(String, optional):dioorretrofit.router(String, optional):go_router,auto_route, orown_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_appat/path/to/outputwith MVVM architecture, Riverpod state, Drift database, and GoRouter." - Suggest and Apply Fixes:
"Generate suggested fixes for
/path/to/projectand 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:
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:
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:
- Port Flag: Set custom ports using
--port <number>(defaults to8080). - Access Dashboard: Open
http://localhost:8080in your web browser.
2. Registering in MCP Server
You can start the tool via the MCP server using the start_runtime_perf_check tool:
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
PerfNavigatorObserverin 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:
- Run the following command in your terminal:
- Your app can now use
localhostdirectly:- Connection URL:
http://localhost:8080/api/record
- Connection URL:
D. Physical iOS / Android Device (Connected via Wi-Fi)
- Ensure both your development computer and mobile device are connected to the same Wi-Fi network.
- Find your computer's local IP address (e.g.
192.168.1.45or10.0.0.12). - Use that IP address inside your Flutter app:
- Connection URL:
http://<your-computer-ip>:8080/api/record
- Connection URL:
来源:README.md,提交 b5ecf6f
工具
0版本历史
1- v1.0.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分