Flutter Inspector MCP Server

by Arenukvern
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Interfaces with Dart VM Service Protocol to access Flutter/Dart process information, retrieve version details, and monitor various event streams for debugging Flutter applications.

  • Connects to a Flutter app's debug mode to extract data about widget trees, render trees, layer trees, and semantics, enabling AI tools to provide context-aware assistance for Flutter app development.

Flutter Inspector MCP 服务器,助力 AI 开发

GitHub 存储库

🔍 强大的模型上下文协议 (MCP) 服务器,可将您的 Flutter 应用与 Cursor、Claude 和 Cline 等 AI 编码助手连接起来。

⚠️ 该项目尚在进行中,并非所有方法(主要与 Flutter Inspector 相关)都已实现。

目前 Flutter 通过转发服务器与 MCP 服务器配合使用。更多详情,请参阅架构

其他一些方法尚未测试,可能有效,也可能无效。请谨慎使用。大多数方法可能会在后续从 MCP 服务器中移除,以便专注于 Flutter 应用程序,甚至 Jaspr。

⚠️警告⚠️

调试方法可能会使用大量令牌,从而导致上下文过载,现在已置于“debug-tools”参数下。在生产环境中,所有调试方法默认均被禁用。

🚀 入门

🎯 Agent 可以调用什么:

  • [资源|工具]分析错误:获取应用的精确且精简的错误信息。它比控制台消息更好的原因在于:它只包含 Agent 所需的信息,而不是完整的跟踪控件列表和重复信息。这最有助于 Agent 理解错误。
  • [资源|工具]屏幕截图:获取应用程序的屏幕截图。仅适用于 Claude(未经测试)。Cursor 和 Cline 不支持在响应中包含图像类型。

将实施:

  • [资源|工具]应用信息:屏幕尺寸、像素比。解锁特工使用控件选择的能力。
  • 热重载和热重启
  • [资源|工具]选择工具:当前想法:
    1. 在 Flutter Inspector 中启用 Widget 选择。
    2. 通过逻辑像素位置选择小部件。
    3. 根据逻辑像素位置获取有关 Flutter 应用结构的详细信息。

研究:

  • 检查当前路线:查看当前导航状态
  • 扩展:Flutter Provider/Riverpod 状态:获取 Provider/Riverpod 实例的状态。
  • 扩展:Jaspr :?
  • 扩展:Jaspr 提供程序:?
  • 扩展:火焰:?

📚 可用工具

如果未指定端口,所有工具均默认使用端口 8181。您可以提供具体的端口号来覆盖此设置。

TOOLS.md中描述的大多数工具

待办事项:添加有关有用方法的更多详细信息

🔧 故障排除

请确保:

  1. 验证转发服务器是否正在运行。
  2. 在浏览器中打开 Devtools。
  3. 已将 MCP 扩展添加到您的 Flutter 应用程序开发依赖项并在 Devtools 中启用它。
  4. 连接问题
    • 确保您的 Flutter 应用在调试模式下运行
    • 验证 Flutter 应用和检查器中的端口是否匹配
    • 检查端口是否未被其他进程使用
  5. AI工具未检测到检查员
    • 配置更改后重新启动 AI 工具
    • 验证配置 JSON 语法
    • 检查工具日志中的连接错误

🚧 Smithery 集成🚧(正在进行中)

Flutter Inspector 已在 Smithery 的注册表中注册,因此其他 AI 工具可以通过标准化界面发现和使用它。

集成架构

┌─────────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ ┌─────────────┐ │ │ │ │ │ │ │ │ │ │ │ Flutter App │<--->│ DevTools │<--->│ Forwarding │<--->│ MCP Server │<--->│ Smithery │ │ (Debug Mode) │ │ Extension │ │ Server │ │ (Registered) │ │ Registry │ │ │ │ │ │ │ │ │ │ │ └─────────────────┘ └──────────────┘ └──────────────┘ └─────────────────┘ └─────────────┘

🤝 贡献

欢迎贡献代码!欢迎在GitHub 仓库提交 Pull 请求或报告问题。

📖 了解更多

📄 许可证

MIT——欢迎在您的项目中随意使用!


Flutter 和 Dart 是 Google LLC 的商标。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

一个 MCP 服务器,其简单目标是通过赋予 AI 编码助手(例如 Cline、Cursor、Claude 等)工具分析 Widget 树、导航和布局问题的能力来调试 Flutter 应用。请参阅架构图以了解其工作原理:https://github.com/Arenukvern/mcp_flutter/blob/main/ARCHITECTURE.md

  1. ⚠️ WARNING ⚠️
    1. 🚀 Getting Started
      1. 🎯 What Agent can call:
        1. Will be implemented:
        2. In research:
      2. 📚 Available Tools
        1. 🔧 Troubleshooting
          1. 🚧 Smithery Integration 🚧 (work in progress)
            1. Integration Architecture
          2. 🤝 Contributing
            1. 📖 Learn More
              1. 📄 License
                ID: qnu3f0fa20