Logo Flutter MCP 服务

Flutter MCP 服务

Cộng đồng
dvillegastech

Advanced Flutter development tools via Model Context Protocol (MCP) with intelligent caching, token management, and official documentation integration.

Nhà phát hànhdvillegastech
Kho mãflutter_mcp_2
Ngôn ngữJavaScript
Bản fork
5
Sao
19
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Flutter MCP 服务 cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    19 sao và 5 bản fork từ kho mã được liên kết.

Flutter MCP Service v2.0

Advanced Flutter development tools via Model Context Protocol (MCP) with intelligent caching, token management, and official documentation integration.

🚀 Quick Start

Installation

bash
# Clone the repository
git clone https://github.com/dvillegastech/flutter_mcp_2.git
cd flutter_mcp_service

# Install dependencies
npm install

# Initialize cache
mkdir -p .cache

# Run health check
npm run health-check

# Start service
npm start

Integration with Claude Desktop / Cursor

Add to your MCP configuration file:

json
{
  "mcpServers": {
    "flutter-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/flutter_mcp_service/src/index.js"]
    }
  }
}

📋 Complete Tool List & Commands

🆕 Unified Tools (v2.0)

1. flutter_status

Check service health and cache statistics.

@flutter-mcp use flutter_status to check service health

2. flutter_search

Universal search across Flutter/Dart documentation, packages, and examples.

@flutter-mcp use flutter_search with query "Container" and limit 5
@flutter-mcp use flutter_search to find ListView examples

Parameters:

  • query (required): Search term
  • limit (optional): Max results (default: 10)
  • maxTokens (optional): Response size limit (default: 4000)

3. flutter_analyze

Smart Flutter documentation fetcher and code analyzer.

@flutter-mcp use flutter_analyze with identifier "Container"
@flutter-mcp use flutter_analyze with identifier "Container" and this code:
Container(
  width: 100,
  height: 100,
  color: Colors.blue,
)

Parameters:

  • identifier (required): Widget/class name or package
  • code (optional): Code to analyze
  • topic (optional): "all", "docs", "analysis", "examples" (default: "all")
  • maxTokens (optional): Response size limit
  • includeExamples (optional): Include code examples (default: true)
  • includeAnalysis (optional): Include code analysis (default: true)

🔧 Legacy Tools (Backward Compatible)

4. analyze_widget

Analyze Flutter widget code for best practices, performance, and accessibility.

@flutter-mcp use analyze_widget with this widgetCode:
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text('Hello World'),
    );
  }
}

Parameters:

  • widgetCode (required): Flutter widget code
  • checkAccessibility (optional): Check accessibility (default: true)
  • checkPerformance (optional): Check performance (default: true)

5. validate_flutter_docs

Validate code against official Flutter documentation.

@flutter-mcp use validate_flutter_docs with this code:
Container(
  color: Colors.red,
  decoration: BoxDecoration(color: Colors.blue), // This will be flagged
)

Parameters:

  • code (required): Flutter/Dart code
  • widgetType (optional): Specific widget to focus on

6. analyze_pub_package

Analyze packages from pub.dev for quality and compatibility.

@flutter-mcp use analyze_pub_package with packageName "provider"
@flutter-mcp use analyze_pub_package with packageName "dio" and checkDependencies true

Parameters:

  • packageName (required): Package name from pub.dev
  • checkDependencies (optional): Analyze dependencies (default: true)
  • checkScores (optional): Retrieve pub.dev scores (default: true)

7. suggest_improvements

Get improvement suggestions based on Flutter best practices.

@flutter-mcp use suggest_improvements for this code:
ListView(
  children: List.generate(1000, (i) => Text('Item $i')),
)

Parameters:

  • code (required): Flutter code
  • focusArea (optional): "performance", "accessibility", "maintainability", "all"

8. analyze_performance

Analyze Flutter widget tree for performance issues.

@flutter-mcp use analyze_performance with this widgetTree:
Column(
  children: [
    for (int i = 0; i < 100; i++)
      Container(child: Text('Item $i')),
  ],
)

Parameters:

  • widgetTree (required): Widget tree code
  • checkRebuildOptimization (optional): Check rebuilds (default: true)
  • checkMemoryLeaks (optional): Check memory leaks (default: true)

9. analyze_architecture

Analyze project architecture compliance.

@flutter-mcp use analyze_architecture with projectStructure {
  "lib": {
    "features": ["auth", "home", "profile"],
    "core": ["network", "database"],
    "shared": ["widgets", "utils"]
  }
} and pattern "clean"

Parameters:

  • projectStructure (required): Project directory structure
  • pattern (optional): "clean", "mvvm", "mvc", "auto"
  • checkDependencies (optional): Check dependency violations (default: true)

10. analyze_bundle_size

Analyze app bundle size with optimization recommendations.

@flutter-mcp use analyze_bundle_size with buildPath "/path/to/build" and platform "android"

Parameters:

  • buildPath (required): Path to build output
  • platform (optional): "android", "ios", "web", "all"
  • includeAssets (optional): Include asset analysis (default: true)

11. generate_tests

Generate comprehensive Flutter tests.

@flutter-mcp use generate_tests for this widgetCode:
class CounterButton extends StatelessWidget {
  final VoidCallback onPressed;
  final int count;
  
  const CounterButton({required this.onPressed, required this.count});
  
  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: onPressed,
      child: Text('Count: $count'),
    );
  }
}

Parameters:

  • widgetCode (required): Widget code
  • testType (optional): "unit", "widget", "integration", "golden", "all"
  • includeAccessibility (optional): Include accessibility tests (default: true)

12. trace_state

Trace state flow and rebuilds in Flutter widgets.

@flutter-mcp use trace_state with this widgetCode:
class MyStatefulWidget extends StatefulWidget {
  // ... widget code
}

Parameters:

  • widgetCode (required): Widget code
  • traceRebuildPaths (optional): Trace rebuilds (default: true)
  • generateVisualization (optional): Generate visualization (default: true)

13. generate_clean_architecture

Generate Clean Architecture structure.

@flutter-mcp use generate_clean_architecture with projectName "todo_app" and features ["auth", "todos", "settings"]

Parameters:

  • projectName (required): Project/feature name
  • features (required): List of features
  • stateManagement (optional): "riverpod", "bloc", "provider", "getx"
  • includeDI (optional): Include dependency injection (default: true)

14. generate_l10n

Generate localization setup with ARB files.

@flutter-mcp use generate_l10n with languages ["en", "es", "fr"]

Parameters:

  • languages (required): Language codes to support
  • translations (optional): Initial translations
  • includeRTL (optional): Include RTL support (default: true)
  • includePluralization (optional): Include pluralization (default: true)

15. monitor_performance

Generate performance monitoring setup.

@flutter-mcp use monitor_performance with monitoringType "balanced"

Parameters:

  • monitoringType (required): "comprehensive", "balanced", "lightweight"
  • includeNetwork (optional): Monitor network (default: true)
  • includeMemory (optional): Monitor memory (default: true)
  • includeAnalytics (optional): Include analytics (default: true)

16. diagnose_render_issues

Diagnose and fix rendering issues.

@flutter-mcp use diagnose_render_issues with this widgetCode:
Row(
  children: [
    Expanded(child: Text('Long text')),
    Container(width: double.infinity), // This will cause issues
  ],
)

Parameters:

  • widgetCode (required): Widget code with issues
  • errorType (optional): "overflow", "constraint", "layout", "all"
  • includeVisualization (optional): Include debug visualization (default: true)

17. analyze_test_coverage

Analyze test coverage with recommendations.

@flutter-mcp use analyze_test_coverage with coverageData {...} and targetCoverage 80

Parameters:

  • coverageData (required): Coverage data from lcov
  • projectStructure (required): Project file structure
  • targetCoverage (optional): Target percentage (default: 80)
  • generateReport (optional): Generate visual report (default: true)

🎯 Usage Examples

Basic Widget Analysis

@flutter-mcp analyze this Flutter widget for issues:
Container(
  child: Column(
    children: List.generate(100, (i) => Text('Item $i')),
  ),
)

Package Research

@flutter-mcp search for "state management" packages and analyze the top result

Performance Optimization Workflow

1. @flutter-mcp analyze_performance for my widget tree
2. @flutter-mcp suggest_improvements based on performance issues
3. @flutter-mcp generate_tests for the optimized code

Full Project Analysis

@flutter-mcp analyze_architecture for my project and suggest clean architecture improvements

🔧 Development Commands

bash
# Development with auto-reload
npm run dev

# Run tests
npm test
npm run test:integration
npm run test:coverage

# Health check
npm run health-check

# Linting and formatting
npm run lint
npm run format

# Docker
npm run build:docker
npm run docker:run

# Clean cache
npm run clean

📊 Features

  • Intelligent Caching: SQLite + in-memory cache with TTL
  • Token Management: Smart truncation with GPT-3 encoder
  • Error Handling: Circuit breaker pattern with retry logic
  • Rate Limiting: Respectful API usage (2 req/sec)
  • Official Docs Integration: Real-time Flutter/Dart documentation
  • Multi-platform: npm, Docker, direct installation
  • Health Monitoring: Built-in health checks and statistics

🏗️ Architecture

See docs/ARCHITECTURE.md for detailed architecture documentation.

🤝 Contributing

See docs/DEVELOPMENT.md for development guidelines.

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

  • Flutter team for excellent documentation
  • MCP SDK contributors
  • Inspired by adamsmaka/flutter-mcp

Made with ❤️ for the Flutter community

Cài đặt

TypingMind
{
  "mcpServers": {
    "flutter-mcp-2": {
      "command": "node",
      "args": [
        "/path/to/flutter_mcp_service/src/index.js"
      ]
    }
  }
}

Dùng MCP Flutter MCP 服务 với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Flutter MCP 服务, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Flutter MCP 服务 làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Flutter MCP 服务.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "flutter-mcp-2": {
      "command": "npx",
      "args": [
        "-y",
        "flutter-mcp-service"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Flutter MCP 服务, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Flutter MCP 服务.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Flutter MCP 服务 giúp tôi làm việc này không?
Flutter MCP 服务
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Flutter MCP 服务.

Câu hỏi thường gặp

Máy chủ MCP Flutter MCP 服务 dùng để làm gì?

Flutter MCP 服务 là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Flutter MCP 服务 với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Flutter MCP 服务 với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Flutter MCP 服务 với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Flutter MCP 服务, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Flutter MCP 服务 với TypingMind?

Flutter MCP 服务 hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Flutter MCP 服务 cung cấp những công cụ nào trong TypingMind?

Flutter MCP 服务 cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Flutter MCP 服务 không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Flutter MCP 服务 yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇