FlutterSDK Telescope

io.github.fluttersdk由 GitHub 账号 fluttersdk 发布v0.0.5更新于 Oct 24, 2026

Inspect a running Flutter app: HTTP traffic, logs, exceptions and queries. Debug only.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

让 AI 编程助手通过 10 个 telescope 工具直接读取运行中 Flutter 应用的运行时数据:HTTP 请求、日志、异常、数据库查询、缓存与事件。

可以做什么
  • 读取 HTTP 请求记录,含方法、URL、状态码、耗时与请求头
  • 读取日志输出与 debugPrint 内容,可按级别、logger 或条数过滤
  • 读取未捕获异常,含类型、消息与堆栈
  • 读取数据库查询的 SQL、绑定参数与耗时,以及缓存的命中、写入、删除等操作
  • 读取应用内事件、Gate 授权检查结果与逐帧性能耗时
  • 在两次调试之间清空全部环形缓冲区
适用场景
适合用 AI 编程助手调试 Flutter 应用时使用,让助手自行获取堆栈、失败的 HTTP 响应和查询耗时,而不必从控制台复制粘贴。它是仅用于开发阶段的检查工具,不是生产监控方案。
运行要求
本地 Flutter 项目需添加 fluttersdk_telescope 依赖,并在 main.dart 中以调试模式守卫调用 TelescopePlugin.install()。所有工具都经由 VM Service 扩展,因此需要应用正在运行。MCP 客户端需配置为启动项目本地的 artisan 可执行文件并传入 mcp:serve 参数。无需账号、API 密钥或网络服务。
安装前请注意
安装命令会修改 lib/main.dart 并写入 MCP 客户端配置文件,请先检查改动。采集的记录包含 HTTP 请求头、请求体、SQL 绑定参数和日志文本;凭据脱敏在写入缓冲区前执行,但仍应核对并补充自己的敏感字段。清空工具会删除全部缓冲区内容,可选的文件输出会把脱敏后的记录写入磁盘。

安装

在 SourceWeft 中

  1. 打开 控制台中的 FlutterSDK Telescope,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Telescope Logo]

Telescope

Passive runtime inspector for Flutter. Read by humans, queried by AI agents.
HTTP, logs, exceptions, debugPrint, DB queries, and Magic events captured over VM Service extensions, surfaced as telescope:* CLI commands and as 10 MCP tools for Claude Code.

[pub package] [CI] [License: MIT] [pub points] [GitHub stars]

Documentation · pub.dev · Issues


Why Telescope?

Stop pasting stack traces into Claude. Let your agent read them itself.

Debugging a running Flutter app has always required a mix of print statements, custom logging sinks, and network proxies that each tell a different slice of the story. When something breaks, you stitch together log files, Charles captures, and Flutter DevTools windows to reconstruct what happened. The AI workflow is worse: you copy the stack trace out of the console, paste it into Claude Code, copy the failing HTTP response, paste it back, repeat.

Telescope closes that loop. Passive watchers and 14 VM Service extensions register at startup. Every HTTP request, log line, exception, debugPrint call, DB query, and Magic-framework lifecycle event lands in a ring buffer. CLI commands (telescope:tail, telescope:requests) stream the buffers for humans; 10 MCP tools (telescope_requests, telescope_exceptions, telescope_tail, ...) expose the same buffers to AI coding agents like Claude Code, Cursor, and Codex. No copy-paste, no screenshots, no SaaS account. Development-only; a kDebugMode or !kReleaseMode guard at the call site tree-shakes the entire subsystem on release builds.

bash
# One-shot self-bootstrap install (works from a fresh consumer)flutter pub add fluttersdk_telescopedart run fluttersdk_telescope telescope:install

The install command scaffolds the consumer artisan harness if it is missing, runs plugin:install fluttersdk_telescope, and patches lib/main.dart so TelescopePlugin.install() runs before Magic.init() (or before runApp on vanilla Flutter). Everything is gated under kDebugMode; release builds tree-shake the entire subsystem.

After install, the consumer gets the artisan fast-cli at ./bin/fsa (native AOT, ~110ms warm startup) for every subsequent telescope command. dart run fluttersdk_telescope <cmd> keeps working as a slower (~3s cold) fallback.

Features

FeatureDescription
👁10 WatchersLogWatcher, ExceptionWatcher, DumpWatcher, FramePerfWatcher, plus 6 Magic-specific adapters covering HTTP, models, cache, events, gates, and DB queries
🤖10 MCP Toolstelescope_requests, telescope_tail, telescope_exceptions, telescope_events, telescope_gates, telescope_dumps, telescope_queries, telescope_caches, telescope_frames, telescope_clear
🖥11 CLI Commandstelescope:install, telescope:tail, telescope:requests, telescope:queries, telescope:caches, telescope:events, telescope:gates, telescope:dumps, telescope:frames, telescope:clear, telescope:files
🔌Adapter ContractTelescopeHttpAdapter (abstract, 3-method shape) for plugging any HTTP client; ships DioHttpAdapter for vanilla Dio
📋10 Record TypesImmutable: HttpRequestRecord, LogRecordEntry, ExceptionRecord, MagicModelRecord, MagicCacheRecord, EventRecord, GateRecord, DumpRecord, QueryRecord, FramePerfRecord
📡VM Service Extensions14 extensions: ext.telescope.requests, .console, .exceptions, .events, .gates, .dumps, .queries, .caches, .frames, .clear, .pause, .resume, .files, .file. .console and .events take since and answer a cursor; .events also takes type, .console also logger
✨Magic IntegrationMagicTelescopeIntegration.install() wires Http facade adapter + model/cache/event/gate watchers in one call (ships in the magic_devtools dev_dependency)
🙈Credential RedactionHTTP records are masked before they are buffered (Laravel Telescope's model): Authorization, Cookie, X-Api-Key headers and password / token style JSON keys read ********; extend the lists with TelescopeRedaction.hide*
🧽Text RedactorTelescopeRedaction.redactor, a host String Function(String) hook run at insert over every log, event, exception and HTTP record (payload keys included). A redactor that throws drops the record; records carry a read-only redacted flag
💾File SinkTelescopeFileSink.start(directory:, maxFileBytes:, maxFiles:) writes a rotating JSONL timeline of redacted log, event and exception records; read it with telescope:files, ext.telescope.files and ext.telescope.file. It writes only redacted records and halts on a write failure
🔒Call-site GateThe consumer guards install at the call site: kDebugMode (what telescope:install writes) or !kReleaseMode (also keeps profile builds); release builds tree-shake the entire telescope branch on all platforms
🔄Idempotent InstallEvery registerExtension call routes through registerExtensionIdempotent; hot-restart safe, no ArgumentError on re-registration

Quick Start

Option A (recommended): one-shot install

Add the dependency, then let telescope bootstrap itself via its own CLI entry point. No prior fluttersdk_artisan wiring is required; telescope's binary carries the artisan substrate so the install works from a fresh consumer:

bash
flutter pub add fluttersdk_telescopedart run fluttersdk_telescope telescope:install

The command scaffolds the consumer artisan harness if it's missing (bin/dispatcher.dart + lib/app/_plugins.g.dart), runs plugin:install fluttersdk_telescope, and patches lib/main.dart so TelescopePlugin.install() runs before Magic.init() (or before runApp on vanilla Flutter). Idempotent; safe to re-run.

For everyday repeat usage, the consumer's ./bin/fsa (artisan native AOT binary built during install) gives ~110ms warm startup:

bash
./bin/fsa telescope:tail./bin/fsa telescope:requests

dart run fluttersdk_telescope <cmd> remains a slower (~3s cold) fallback that always works without the AOT bundle.

Option B: manual wiring

1. Add the dependency
yaml
# pubspec.yamldependencies:  fluttersdk_telescope: ^0.0.4
2. Install in main.dart

Install Telescope before Magic.init() (or before runApp for plain Flutter). Wrap every install call in a mode guard at the call site so the entire tooling branch is tree-shaken in release builds: kDebugMode, which is what telescope:install writes, or !kReleaseMode, which also keeps profile builds (what a performance measurement needs, and what magic_devtools uses).

dart
import 'package:flutter/foundation.dart';import 'package:fluttersdk_telescope/telescope.dart';import 'package:magic_devtools/telescope.dart'; // magic_devtools dev_dependency (Magic-stack apps only)
void main() async {  WidgetsFlutterBinding.ensureInitialized();
  // 1. Install Telescope core (auto-installs LogWatcher + registers VM extensions).  if (!kReleaseMode) {    TelescopePlugin.install();
    // 2. Opt-in watchers registered after install().    TelescopePlugin.registerWatcher(ExceptionWatcher());    TelescopePlugin.registerWatcher(DumpWatcher());  }
  // 3. Magic-side adapters run AFTER Magic.init() because they resolve  //    framework internals (Http facade, Gate manager) from the IoC container.  await Magic.init(configFactories: [...]);
  if (!kReleaseMode) {    // MagicTelescopeIntegration ships in magic_devtools (not magic core).    // Add magic_devtools to dev_dependencies in pubspec.yaml.    MagicTelescopeIntegration.install();  }
  runApp(MyApp());}
3. Register the Artisan provider (MCP tools)

In the consumer's bin/dispatcher.dart (generated by dart run fluttersdk_artisan install), telescope is auto-discovered through lib/app/_plugins.g.dart after plugin:install fluttersdk_telescope. If you are wiring providers by hand, add FluttersdkTelescopeArtisanProvider() to the baseProviders list so the 10 telescope_* MCP tools are visible to Claude Code and other MCP clients:

dart
import 'package:fluttersdk_artisan/artisan.dart';import 'package:fluttersdk_telescope/cli.dart' show FluttersdkTelescopeArtisanProvider;
exit(await runArtisan(  args,  baseProviders: [    FluttersdkTelescopeArtisanProvider(),    // ...other providers (DuskArtisanProvider, etc.)  ],));

Watchers

WatcherCapturesAuto-install?Notes
LogWatcherAll package:logging Logger callsYesInstalled automatically by TelescopePlugin.install().
ExceptionWatcherUnhandled exceptions via FlutterError.onError + PlatformDispatcher.onErrorNoCall TelescopePlugin.registerWatcher(ExceptionWatcher()) after install. Both hooks chain-preserve any previously registered handler (Sentry, Bugsnag, etc.).
DumpWatcherdebugPrint + print outputNoOverrides debugPrint globally; chain-preserves previous override. Active in debug mode only.
MagicHttpFacadeAdapterHTTP traffic through the Magic Http facadeNoRegister via TelescopePlugin.registerHttpAdapter(MagicHttpFacadeAdapter()). Requires Magic framework.
MagicModelWatcherMagic Eloquent model create, save, delete lifecycle eventsNoRegister via TelescopePlugin.registerWatcher(MagicModelWatcher()). Requires Magic framework.
MagicCacheWatcherCache.get / put / forget / flush (hit + miss + put + forget + flush operations)NoSubscribes to magic-side CacheHit / CacheMiss / CachePut / CacheForget / CacheFlush events. Requires Magic framework.
MagicEventWatcherEvents dispatched through the Magic Event facadeNoRegister via TelescopePlugin.registerWatcher(MagicEventWatcher()). Requires Magic framework.
MagicGateWatcherGate.allows / Gate.denies authorization checksNoRegister via TelescopePlugin.registerWatcher(MagicGateWatcher()). Requires Magic framework.
MagicQueryWatcherMagic SQLite + remote DB queries (sql, bindings, timeMs, connection)NoSubscribes to the magic-side QueryExecuted event dispatched by the database connector. Requires Magic framework.
FramePerfWatcherPer-frame build/raster/vsync-overhead timings joined with FlutterTimeline block attributionNoRegister via TelescopePlugin.registerWatcher(FramePerfWatcher()). Exposes a static livenessCounter alongside every read.

MCP Tools

Exposed via TelescopeArtisanProvider when the consumer registers it (auto-wired by telescope:install through lib/app/_plugins.g.dart + bin/dispatcher.dart). All tools route through ext.telescope.* VM Service extensions and require a running Flutter app.

ToolExtension methodCaptures
telescope_tailext.telescope.consoleLog ring buffer (package:logging records); filter by level + limit.
telescope_requestsext.telescope.requestsHTTP request ring buffer (method, URL, status, duration, headers, body snippet).
telescope_exceptionsext.telescope.exceptionsUncaught exception ring buffer (type, message, stack trace).
telescope_clearext.telescope.clearWipes all ring buffers atomically. No parameters.
telescope_eventsext.telescope.eventsIn-app event ring buffer (Magic Event.dispatch calls; event type + payload).
telescope_gatesext.telescope.gatesGate authorization check ring buffer (ability, result, user id, argument type).
telescope_dumpsext.telescope.dumpsdebugPrint output ring buffer (message + timestamp).
telescope_queriesext.telescope.queriesDB query ring buffer (sql, bindings, timeMs, connectionName).
telescope_cachesext.telescope.cachesCache operation ring buffer (operation: hit / miss / put / forget / flush; key; ttlMs).
telescope_framesext.telescope.framesPer-frame performance ring buffer (build/raster/vsync-overhead/total-span micros, block attribution) plus the livenessCounter.

CLI Commands

Registered via TelescopeArtisanProvider.commands(). After telescope:install you can invoke any command three ways: through the consumer's fast-cli (./bin/fsa <command>, recommended), through telescope's standalone bin (dart run fluttersdk_telescope <command>), or through the consumer dispatcher fallback (dart run fluttersdk_artisan <command>).

CommandPurpose
telescope:installOne-shot bootstrap: scaffolds consumer artisan harness, runs plugin:install fluttersdk_telescope, and injects TelescopePlugin.install() into lib/main.dart. Detects Magic-stack apps via the await Magic.init( anchor and injects BEFORE Magic.init; falls back to runApp( for vanilla Flutter.
telescope:tailPrint the log buffer. Filter with --level, --limit, --since <atUs> and --logger <name>; --json prints one JSON object per line; --follow keeps polling from the returned cursor until interrupted.
telescope:requestsPrint the HTTP request buffer (paginated).
telescope:queriesPrint the DB query buffer (paginated).
telescope:cachesPrint the cache operation buffer (paginated).
telescope:eventsPrint the in-app event buffer. Filter with --limit, --since <atUs> and --type <prefix>; --json and --follow as on telescope:tail.
telescope:gatesPrint the Gate authorization check buffer (paginated).
telescope:dumpsPrint the debugPrint dump buffer (paginated).
telescope:framesPrint the per-frame performance buffer (paginated).
telescope:clearFlush all buffers atomically.
telescope:filesList the timeline files of the running file sink, or print the lines of one with --name=<file> and --offset=<n> (0 or a previous next; -v shows the next offset).

followCursor, the pure Dart loop behind both --follow flags, is exported from package:fluttersdk_telescope/cli.dart.

Examples

example/

Vanilla Flutter app (no Magic framework) that exercises every framework-agnostic capture surface: HTTP traffic via the Telescope Dio interceptor, log output via package:logging, uncaught exceptions via ExceptionWatcher, and debugPrint output via DumpWatcher. Demonstrates the minimal install pattern and the in-app overlay dashboard.

bash
cd example && flutter run -d chrome

Architecture

Telescope is subsystem-first under lib/src/, every directory owns a single concern:

lib/├── telescope.dart              # Single barrel, re-exports the full public API├── cli.dart                    # Flutter-free codegen barrel (FluttersdkTelescopeArtisanProvider typedef, followCursor)└── src/    ├── watchers/               # TelescopeWatcher abstract contract + LogWatcher, ExceptionWatcher, DumpWatcher    ├── adapters/               # TelescopeHttpAdapter abstract contract + DioHttpAdapter concrete impl    ├── records/                # Immutable record types: HttpRequestRecord, LogRecordEntry, ExceptionRecord, etc.    ├── extensions/             # registerAllTelescopeExtensions() aggregator + per-concern VM Service handlers    ├── commands/               # TelescopeInstallCommand + 10 read/clear/files commands    ├── telescope_store.dart    # 10-buffer ring store (singleton); Queue<T> per buffer + broadcast StreamController<T>    ├── telescope_redaction.dart # credential lists + the host text redactor applied at insert    ├── telescope_file_sink.dart # TelescopeFileSink: rotating JSONL timeline of redacted records    ├── cursor_follow.dart      # followCursor, the loop behind --follow (exported from cli.dart)    ├── telescope_plugin.dart   # TelescopePlugin.install() entry + registerHttpAdapter() + registerWatcher()    └── telescope_artisan_provider.dart  # TelescopeArtisanProvider: 11 commands + 10 MCP tool descriptors

Boot flow:

TelescopePlugin.install()    ↓Register default watchers (LogWatcher auto-installs)    ↓registerAllTelescopeExtensions()   # 14 ext.telescope.* VM Service extensions, idempotent    ↓Consumer registers TelescopeArtisanProvider (auto-wired by `telescope:install` via bin/dispatcher.dart + _plugins.g.dart)    ↓artisan mcp:serve   ->   10 telescope_* tools surface to MCP clients (Claude Code, Cursor, etc.)

Every concrete watcher and record type is a final class. The two adapter contracts (TelescopeWatcher, TelescopeHttpAdapter) are abstract class with frozen 3-method signatures (name, install, uninstall). Magic-side glue (MagicHttpFacadeAdapter, MagicModelWatcher, etc.) depends on these contracts; any signature change requires a coordinated bump across both repos.

Compared to

ToolWhat it doesWhere telescope wins
Sentry FlutterProduction crash + perf reporting via external SaaSLocal-only; debug-only; CLI + MCP queryable from your agent; no DSN, no SaaS account
Talker / talker_flutterIn-app log overlay, Dio interceptorVM Service surface (queryable by tools); MCP server for AI agents; framework-aware model / cache / event / gate watchers
AliceIn-app HTTP request overlay UICaptures 10 buffers (not just HTTP); passive (no shake-to-open overlay); CLI streaming; AI agent access; debug tree-shake
Flutter DevToolsOfficial browser-based inspectorProgrammatic access (CLI + MCP), not just human-via-browser; ring-buffered records you can query between iterations; domain-aware (Magic) watchers
mcp_flutterMCP toolkit for AI-driven UI interaction (tap, scroll, snapshot)Complementary, not competitive: telescope owns runtime telemetry (HTTP, exceptions, queries); mcp_flutter owns UI automation

AI Agent Integration

Telescope is the first Flutter MCP server focused on runtime observability (HTTP, exceptions, queries, cache) rather than UI automation. The 10 telescope_* tools give Claude Code, Cursor, Codex, or any MCP-compatible agent direct read access to every runtime buffer: inspect HTTP traffic without a proxy, read logs without grepping output, catch exceptions without scrolling DevTools.

One-line .mcp.json install

telescope:install auto-writes .mcp.json for you. Or wire it manually for any MCP-compatible client:

jsonc
// .mcp.json (project root) — Claude Code / Codex / Cursor / Goose / VS Code Copilot{  "mcpServers": {    "fluttersdk": {      "command": "./bin/fsa",      "args": ["mcp:serve"],      "cwd": "."    }  }}

After this, restart your MCP client. The 10 telescope_* tools (plus the substrate's artisan_* tools) surface automatically in /mcp.

Before / after

Without telescopeWith telescope
Stack trace appears in your console. You copy it. You paste it into Claude. Claude asks for the HTTP response that triggered it. You scroll, copy, paste.Claude calls telescope_exceptions → reads the last 500 captured exceptions with timestamps + stack traces. Claude calls telescope_requests → reads matched HTTP records. Claude proposes the fix.
You hot-reload, retry, paste again.Claude calls telescope_clear between iterations. The fix loop closes without you in the middle.

Typical agent session

[agent] artisan_start { device: chrome }          // launch the app[agent] <exercise the feature under inspection>[agent] telescope_requests {}                     // inspect all HTTP calls made[agent] telescope_tail { level: warning }         // filter logs to warnings and above[agent] telescope_exceptions {}                   // check for any uncaught exceptions[agent] telescope_queries {}                      // review DB queries and timings[agent] telescope_clear {}                        // flush buffers before the next scenario[agent] artisan_stop                              // tear down

For agents that read structured project context at attach time, the canonical entry point is llms.txt at the repo root (also published at https://fluttersdk.com/telescope/llms.txt). It enumerates the watcher surface, the VM extension catalog, and every MCP tool input schema in agent-readable form.

Documentation

Full docs with live examples at fluttersdk.com/telescope.

Topic
Getting StartedOverview, requirements, first install
WatchersAll 10 watchers: setup, chain-preserve pattern, Magic adapters
MCP ToolsEvery tool, every input schema, filter parameters
RedactionCredential lists, TelescopeRedaction.redactor, the redacted flag
File sinkTelescopeFileSink, rotation, fail-closed writes, telescope:files
BuffersTelescopeStore.setCapacity, TelescopeKind, atUs, limit and minLevel semantics
Cursor and filterssince / type / logger / cursor on the read extensions, --follow, followCursor

Contributing

bash
git clone https://github.com/fluttersdk/telescope.gitcd telescope && dart pub getflutter test && dart analyze

The baseline is 497 tests green. New behavior ships with the matching test (red, green, refactor). dart format lib/ test/ bin/ must produce no diff and dart analyze must report zero issues across lib/, test/, and bin/.

Before opening a pull request, also run:

bash
dart format lib/ test/ bin/         # zero diffdart analyze                         # zero issuesdart pub publish --dry-run           # validate the publish archive

Report a bug · Request a feature

Inspiration

Telescope is inspired by Laravel Telescope, the elegant developer-tools assistant for Laravel that records every request, exception, log, query, cache hit, and event into a queryable timeline. The same pattern, ported to Flutter, with two additions that make sense for 2026: a CLI-first surface for terminal-native developers and a 10-tool MCP server so AI coding agents can read the timeline directly.

Part of the Magic SDK suite

Telescope is one of seven packages in the FlutterSDK Magic suite, a Laravel-inspired Flutter ecosystem:

  • magic — Laravel-style framework (facades, ORM, providers, controllers, routing)
  • wind — Tailwind-style className UI primitives for Flutter
  • fluttersdk_artisan — Pure Dart CLI + MCP substrate that telescope extends
  • fluttersdk_dusk — E2E gesture / snapshot driver via VM extensions
  • fluttersdk_telescope (this package) — Runtime observability via VM extensions + MCP
  • magic_tinker — Connected REPL into the running app
  • magic_starter — Auth / profile / teams scaffolding

License

MIT, see LICENSE for details.


Built with care by FlutterSDK
If Telescope saves you debugging time, give it a star, it helps others discover it.

来源:README.md,提交 558dca5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.0.5最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分