A complete, local Model Context Protocol (MCP) server written in pure Dart to automate, audit, and optimize Flutter project assets and localization structure. Connect it to AI clients like Cursor or Claude Desktop to let the AI interact directly with your project's assets and translation structures.
AssetGenie exposes five powerful tools to the LLM context:
Scans the project's pubspec.yaml and physical folders to identify asset anomalies:
- Flags missing physical files declared in
pubspec.yaml. - Flags physical assets that are not declared in
pubspec.yaml(undeclared assets). - Identifies heavy assets exceeding a configurable file size threshold (default: 500 KB).
- Automatically checks for unused physical files by searching for references in
lib/source code.
Safely updates or injects translation keys into local Application Resource Bundle (.arb) files:
- Appends new translations without manual copying/pasting.
- Standardizes formatting and groups metadata keys (
@key) next to their respective properties. - Alphabetizes keys according to standard ARB guidelines.
Auto-generates clean, modern Dart constants from physical asset files:
- Recursively walks through the physical assets folders.
- Converts file paths into structured
camelCasevariable names. - Resolves identifier collisions and reserved keywords dynamically.
- Writes a safe config class
Assetsinsidelib/generated/to prevent typos and hardcoded string values.
Audits the project's ARB localization files to ensure quality and consistency:
- Compares target locales against a primary locale to find missing translation keys.
- Detects extra translation keys defined in target locales but missing in the primary locale.
- Validates that parameterized placeholders (e.g.,
{name}) match between translations to prevent runtime formatting crashes. - Scans Dart code recursively in
lib/to identify unused translation keys.
Connects to a running Flutter application via its Dart VM Service to inspect layout, capture state, or stream logs:
- Retrieves a clean, structured JSON Widget Summary Tree from the active application context.
- Requests a live PNG screenshot of the application's current layout, returning it directly in the tool response.
- Streams and captures stdout/stderr console prints and runtime logging statements over WebSocket.
Ensure you have Dart SDK installed on your system.
-
Clone the repository:
git clone https://github.com/aditzeb/AssetGenie.git cd AssetGenie -
Download package dependencies:
dart pub get
-
Run the verification/tests to make sure everything is ready:
dart test test/assetgenie_test.dart
To use AssetGenie inside your favorite AI assistant or development environment, configure it as a local stdio MCP server.
Antigravity automatically discovers MCP servers configured in its global MCP configuration file:
- Windows:
C:\Users\<Your-Username>\.gemini\antigravity-ide\mcp_config.json - macOS / Linux:
~/.gemini/antigravity-ide/mcp_config.json
Add the following under the "mcpServers" object:
{
"mcpServers": {
"assetgenie": {
"command": "dart",
"args": [
"run",
"C:\\path\\to\\AssetGenie\\bin\\main.dart"
]
}
}
}To bring AssetGenie's capabilities into IntelliJ IDEA or Android Studio, you can use the Continue plugin or the Cline / Roo Cline plugins.
Add the following to your global Continue configuration (~/.continue/config.yaml or C:\Users\<Your-Username>\.continue\config.yaml) under the mcpServers block:
mcpServers:
- name: assetgenie
type: stdio
command: dart
args:
- "run"
- "C:\\path\\to\\AssetGenie\\bin\\main.dart"Note
Make sure to switch Continue to Agent Mode in your chat panel to enable tool execution.
Add the following to your settings file (roo_cline_mcp_settings.json):
{
"mcpServers": {
"assetgenie": {
"command": "dart",
"args": [
"run",
"C:\\path\\to\\AssetGenie\\bin\\main.dart"
]
}
}
}You can use the Continue, Cline, or Roo Cline extensions in VS Code by applying the same configurations as JetBrains IDEs.
- Cline settings are stored in
C:\Users\<Your-Username>\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json(Windows) or~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json(macOS).
Add the following to your claude_desktop_config.json configuration file:
- Windows:
C:\Users\<Your-Username>\AppData\Roaming\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"assetgenie": {
"command": "dart",
"args": [
"run",
"C:\\path\\to\\AssetGenie\\bin\\main.dart"
]
}
}
}Go to Settings -> Features -> MCP, click Add New MCP Server:
- Name:
AssetGenie - Type:
stdio - Command:
dart run C:\path\to\AssetGenie\bin\main.dart
project_path(string, required): Absolute path to the Flutter root directory.max_size_kb(number, optional): Size threshold in KB (default: 500).
project_path(string, required): Absolute path to the Flutter root directory.locale(string, required): Target language code (e.g.'en','de').kv_pairs(object, required): A JSON map of translation pairs (e.g.,{"loginButton": "Sign In"}).
project_path(string, required): Absolute path to the Flutter root directory.output_filename(string, optional): Target file name (default:'generated_assets.dart').
project_path(string, required): Absolute path to the Flutter root directory.primary_locale(string, optional): The base locale to compare other locales against (default:'en').unused_keys_check(boolean, optional): Whether to check for unused keys inlib/**/*.dart(default:true).
vm_service_uri(string, required): The Dart VM Service WebSocket or HTTP URI (e.g.,http://127.0.0.1:8181/T9n3k_04gA=/).action(string, required): The instrumentation action to perform on the running Flutter application ('get_widget_tree','capture_screenshot','get_logs').
This project is open-source and licensed under the MIT License. See LICENSE for more details.