
Flutter Lamp
io.github.itsonu由 GitHub 帳號 itsonu 發布v0.21.0更新於 Oct 24, 2026
Live runtime data from a running Flutter app: exceptions, logs, network, frames, diagnosis.
概覽
把 AI 助理連接到正在執行的 Flutter 應用程式 Dart VM Service,即時取得例外、日誌、網路請求、影格耗時與記憶體資料,並診斷執行期問題。
- 可以做什麼
- Flutter Lamp 透過 Dart VM Service Protocol 連接正在執行的 Flutter 應用程式,把即時執行狀態以結構化資料呈現。工具涵蓋含堆疊的例外、主控台與 dart:developer 日誌、HTTP 網路擷取、含卡頓偵測的影格耗時、路由與狀態管理活動、Widget 重建歸因、Widget 樹快照、記憶體與 VM 時間軸事件。diagnose_runtime 會把證據彙整為摘要、根因、信心度與修正建議,本機瀏覽器儀表板同步顯示這些資料。
- 適用情境
- 適合在用 AI 助理除錯 Flutter 應用程式時使用,讓助理直接讀取即時執行資料,而不必貼上堆疊與 flutter run 輸出。最適合排查 debug 或 profile 建置中的例外、卡頓、重建風暴與網路請求失敗。
- 執行需求
- 需要 Node.js 20 或更新版本,透過 npx 或全域 npm 安裝後在本機執行。需要一個以 debug 或 profile 模式執行、且 Dart VM Service 位址可存取的 Flutter 應用程式。選用環境變數:DASHBOARD_PORT、DASHBOARD_HOST、DASHBOARD_DISABLE、FLUTTER_LAMP_REDACT、FLUTTER_LAMP_REDACT_EXTRA。未宣告帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Flutter Lamp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
💡 Flutter Lamp
Give your AI live eyes on a running Flutter app — no more pasting logs.
[CI] [npm] [License: MIT] [Node] [MCP]
An MCP server that connects Claude Code, Claude Desktop, Cursor, Codex & Gemini directly to a running Flutter app through the Dart VM Service Protocol — streaming exceptions, logs, network calls, frame timings and memory as structured data, plus an evidence-first root-cause diagnosis engine and a live browser dashboard.
Why
Today you debug Flutter with your AI by copy-pasting stack traces, flutter run
output and DevTools screenshots. The AI is blind between messages.
Flutter Lamp makes the AI runtime-aware. It reads the app's live state over official Flutter/Dart APIs (never scraping DevTools), so instead of "paste the error" the AI can ask the app "what just happened, and why?"
Features
- 🔌 One-line connect to any running Flutter app's VM Service
- 💥 Realtime exceptions with reconstructed stack traces (framework + unhandled)
- 📝 Console & structured logs (Stdout / Stderr /
dart:developer) - 🌐 Network capture via
dart:ioprofiling — covers Dio &package:http, no interceptor needed - 🎞️ Frame timings with jank detection, percentiles, and a build-vs-raster verdict
- 🧭 Route awareness — current screen, transitions, and failures attributed to the screen they happened on
- 🧠 State-management activity — Riverpod, Provider and Bloc churn correlated with rebuild storms
- 🔁 Widget rebuild attribution — which widget rebuilt, how often, at which file and line, with your code ranked apart from package code
- 🧬 Widget tree & selected-widget snapshots from the Inspector
- 🧮 Memory (Dart heap / external) and VM timeline events
- 🩺
diagnose_runtime— correlates evidence into summary · root cause · evidence · confidence · fixes; says "Unknown" below 70% instead of hallucinating - 📊 Live browser dashboard at
http://127.0.0.1:7373— streams everything over WebSocket, independent of the AI connection - 🧩 Ships a reusable
flutter-runtime-diagnosisClaude Code skill
Tools
mutates means the tool changes app or VM state, not your project — nothing
here writes code or files. connect_vm enables dart:io HTTP timeline logging
on the app so network capture works; get_timeline with recordFrom: true
changes the VM's recording flags. Every tool carries an MCP readOnlyHint
annotation so a client can enforce this itself.
Agents should not call all of them. The recommended flow is
runtime_health → what_changed → a targeted get_* → diagnose_runtime;
see AI Agent Integration.
Install
Requires Node ≥ 20. Nothing to clone — npx fetches it on first run:
Or install it globally:
From source
Connect your AI client
Claude Code plugin (recommended) — installs the MCP server and the
flutter-runtime-diagnosis skill in one step:
The plugin pins an exact, published server version. Flutter Lamp is also
listed in the MCP Registry as
io.github.itsonu/flutter-lamp.
Or add the server to your MCP client config yourself, then restart the client.
Claude Code — .mcp.json in your project:
Or from the CLI:
--scope user makes it available in every project; drop it to register
for the current project only.
Cursor (~/.cursor/mcp.json) and Claude Desktop
(claude_desktop_config.json) use the same mcpServers shape.
Running from a clone instead? Point command at node and args at
/absolute/path/to/flutter-lamp/dist/index.js.
Optional environment variables:
Usage
-
Run your Flutter app in debug/profile mode:
Copy the line it prints:
Tip:
flutter run --vm-service-port=8181gives a stable URI across restarts. -
Ask your AI to connect and diagnose — e.g. "connect to my Flutter app at
<uri>and tell me why it's throwing." With the bundled skill, Claude Code runs the whole flow (connect → gather →diagnose_runtime) automatically and never asks you to paste logs when the VM Service is reachable. -
Open http://127.0.0.1:7373 in a browser for the live dashboard — it runs alongside the AI, not instead of it.
Debugging without a cable (Android)
A flutter run started over USB loses its VM Service tunnel the moment the
cable moves; one started over a TCP transport does not. Ask the server which
transports exist:
Then launch against the wireless serial it recommends:
The cable is only needed for the one-time promotion. Reverse it any time with
adb usb.
Live dashboard
A zero-dependency dark UI (native HTTP + WebSocket, no build step) that streams runtime data as it happens:
Overview — a session report: health, FPS, memory, worst frame, MCP activity, and findings that link through to the events behind them (the worst-frame finding opens the timeline filtered to that frame) · Logs (search / filter / auto-scroll) · Network (expandable headers & timing) · Exceptions (expandable stack traces) · Timeline · Performance (live canvas charts) · MCP — which agent connected, every tool it called, with latency, errors and response size · Inspector — which inspection links exist and which are pull-only · Diagnostics — the measured topology, per-collector health, and what this target cannot observe at all.
Controls: pause/resume · clear view · export JSON · per-tab search · auto-reconnect.
The UI distinguishes states that look alike and are not: 0 MB is a
measurement, not sampled yet is the absence of one, and an empty tab says
whether a filter is hiding rows, the collector is blind on this target, or the
collector is watching and has seen nothing. Readings taken before a disconnect
are labelled as such rather than left looking live.
How it works
Everything flows through one event store. Adding a new runtime source =
implement the Collector interface and register it — no other layer changes.
Design principles: official Flutter/Dart APIs only, structured JSON over text,
never scrape DevTools, and never claim a cause the evidence doesn't support.
Limitations
- Debug/profile builds only. The VM Service, Inspector and
dart:ioHTTP profiling are not available in release builds. - Network is pull-on-demand. Dart exposes no push stream for
dart:ioHTTP, so requests are fetched whenget_networkordiagnose_runtimeruns — not streamed continuously. - Exceptions are not always observable.
Debug.PauseExceptionneeds pause-on-exception enabled in the app to fire.Flutter.Erroris posted by the widget inspector only while structured error reporting is on, which the framework disables in profile mode and on the web — so on those targets a thrown framework error leaves no trace at all. The collector asks the app and reportsdegradedwhen that is the case, so an empty exception list is never silently mistaken for a quiet one. - Dart-side HTTP only. Calls made from platform (Kotlin/Swift) code or from a
WebView don't appear in
get_network. - Retention is bounded. Each category keeps its own fixed window (3,000
logs, 2,000 state, 1,000 exceptions, 1,000 network, 1,000 frames, 1,000
rebuilds, 500 navigation, 500 system). Frames roll over fastest — about 17
seconds at 60fps, and measured at 4 minutes under a 10fps workload.
runtime_statusreports what is retained and what was evicted, and once eviction starts every diagnosis carries a note saying so, so a truncated window is never presented as a whole session. - The dashboard binds to
127.0.0.1by default. ChangeDASHBOARD_HOSTonly on a network you trust — runtime data is served unauthenticated.
Security
Runtime data is sensitive. HTTP headers carry bearer tokens and cookies, URIs carry API keys, and developers print credentials into logs — and everything captured is handed to an AI model and streamed to any browser watching the dashboard.
Secrets are redacted at capture, so they never enter the event store and no
consumer can leak what was never stored. Redacted by default: Authorization,
Proxy-Authorization, Cookie, Set-Cookie, WWW-Authenticate, any header
whose name contains token, secret, password, credential, api-key or
session, sensitive query-string parameters, and JWT- or Bearer-shaped
strings in log lines and error text. Header names that were hit are listed in
data.redactedHeaders so you can see that something was withheld rather than
getting a silently partial picture. Add patterns with
FLUTTER_LAMP_REDACT_EXTRA, or disable entirely with FLUTTER_LAMP_REDACT=off
for a local-only session.
The VM Service credential is scrubbed unconditionally. The path segment of a
VM Service URI authorises evaluate — arbitrary Dart execution in the app being
observed — and an app can print its own URI to its console, which a web target
does on startup. That token is removed from captured text wherever it appears,
and unlike everything above it is not governed by FLUTTER_LAMP_REDACT=off:
that switch exists so you can read your own app's headers and log text, not so
the server will hand out the key to the app it is attached to.
The dashboard is not exposed to other pages. Binding to loopback does not
protect a WebSocket — browsers exempt WebSocket from the same-origin policy, so
without a check any page you have open could connect to
ws://127.0.0.1:7373/ws and read your whole runtime stream. The handshake
requires a per-process token that is inlined into the served page, which
cross-origin script cannot read, and a present Origin header must be loopback.
The page is served X-Frame-Options: DENY, and /health returns liveness only
— never the VM Service URI, which embeds the VM's own auth token.
Setting DASHBOARD_HOST to a non-loopback address logs a warning and puts
runtime evidence on your network. Only do that on a network you trust.
Found a vulnerability? See SECURITY.md.
Roadmap
Shipped: VM connect, logs, exceptions (with stacks), network, frames, widget tree, memory, timeline, route awareness, rebuild attribution, state-management activity, diagnosis, live dashboard, and an evaluation suite that replays recorded sessions to check the diagnosis against apps that actually misbehaved.
Next: deeper correlation (memory/timeline into diagnose_runtime), CPU sampling
& leak heuristics, knowledge graph, auto-fixes. See
docs/Phases.md and
docs/Observability-Roadmap.md.
Development
npm test runs the compiled output, so build first. It relies on glob support in
node --test, which needs Node ≥ 21 — the server itself runs on Node ≥ 20.
Docs live in docs/:
Contributing
Issues and PRs welcome. Keep it modular, prefer official APIs over hacks, and
add a node:test check for any non-trivial logic.
License
MIT © Chandrabhushan Prakash
來源:README.md,提交 9742018
工具
0版本歷史
1- v0.21.0最新Sep 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分