Skip to content
Türkçe

Introducing Magic Devtools 1.1.0

See your app the way Magic sees it.

The Magic adapter layer for the tapir and crumbs dev tools. It enriches their snapshots and records with Magic-aware context, and behind a !kReleaseMode guard it is absent from release builds.

Runs on

  • Android
  • iOS
  • macOS
  • Windows
  • Linux

Dev tools that understand Magic.

tapir and crumbs know nothing about Magic. Magic Devtools adapts them, so an LLM agent or a CI driver reads the route, the auth user, controller state and Gate results instead of guessing.

Magic-aware snapshots

MagicTapirIntegration.install() registers enrichers on tapir snapshots: route and middleware, forms and errors, controller state, Gate results, the auth user, Echo when broadcasting is bound, and recent HTTP, logs and exceptions.

  • Adds 14 enrichers, shown when a snapshot runs with --includeEnrichers
  • tapir:navigate --route /path calls MagicRouter.instance.to(route)
Read the docs
if (!kReleaseMode) TapirPlugin.install();

await Magic.init();

if (!kReleaseMode) MagicTapirIntegration.install();

Magic-aware records

MagicCrumbsIntegration.install() registers crumbs watchers for Magic events and a MagicHttpFacadeAdapter that records Magic HTTP requests.

  • One HTTP adapter and five watchers: model, cache, event, gate and query
  • Read the records with crumbs:requests, crumbs:caches or crumbs:gates
Read the docs
if (!kReleaseMode) CrumbsPlugin.install();

await Magic.init();

if (!kReleaseMode) MagicCrumbsIntegration.install();

Masked auth header

The header named by auth.token.header (default Authorization) is hidden in crumbs records. Bodies go through crumbs' own redaction.

  • Bodies are masked by key (password, token) and cut at 8192 characters
  • A ModelRecord copies every attribute unmasked
Read the docs

One umbrella, two phases

MagicDevtools.installPre() runs before Magic.init() and installPost() after it, so tapir and crumbs boot first and Magic attaches once the container exists.

  • Both halves are idempotent: a second call registers nothing twice
  • installPre() after Magic.init() throws the router's StateError
Read the docs
if (!kReleaseMode) MagicDevtools.installPre();

await Magic.init();

if (!kReleaseMode) MagicDevtools.installPost();

Performance sessions

MagicPerfIntegration.install() records performance sessions with insight rules (PerfInsightRules) and a navigator observer.

  • The default attribution session counts activity and evaluates the insights
  • A timing session counts nothing, so its milliseconds stay comparable
Read the docs

Dev-only preview catalog

MagicPreview.register(...) and MagicPreview.registerRoutes() add /preview and /preview/:component. One component at a time, light or dark from a header toggle.

  • registerRoutes() returns at once in release, or when kPreviewEnabled is false
  • previews:refresh writes _previews.g.dart from your preview classes
Read the docs
if (kDebugMode) {
  MagicPreview.register(previewEntries());
  MagicPreview.registerRoutes();
}
platforms
5
commands to install
2
license
MIT

Your agent speaks Magic Devtools.

The Magic Devtools skill teaches your coding assistant how to wire tapir and crumbs with MagicDevtools and keep them out of release builds before the first line. One command wires it up.

npx skills add anilcancakir/ai --skill magic-devtools

run in your project other editors

works with

  • Claude Code
  • Cursor
  • OpenCode
  • VS Code Copilot
  • Codex CLI

And checks the docs.

Skills teach the API. The MCP server at mcp.anilcancakir.com/magic_devtools gives your agent live docs lookup while it edits, so it never guesses a signature.

  • Streamable HTTP

    One endpoint, every client.

  • search-docs

    Live query against the source.

  • Public, no auth

    Read-only, free to use.

Connect your editor
mcp.anilcancakir.com/magic_devtools preview

# streamable http, the default

claude mcp add --transport http magic_devtools https://mcp.anilcancakir.com/magic_devtools

# or stdio, for clients without http

npx -y mcp-remote https://mcp.anilcancakir.com/magic_devtools

Public, no auth.

Questions, answered.

What people ask before they add Magic Devtools to a Flutter app.

What is Magic Devtools?

Magic Devtools wires a Magic app into tapir, the E2E driver, and crumbs, the runtime inspector. Snapshots then carry forms, routes, controllers, gates and auth, and crumbs records Magic's HTTP, model, cache, event, gate and query activity.

How do I install Magic Devtools?

Run flutter pub add magic_devtools tapir crumbs, then call MagicDevtools.installPre() before Magic.init() and installPost() after it, each under if (!kReleaseMode). dart run magic:dowel magic:install --with-devtools writes the same wiring while it installs Magic.

Which platforms does Magic Devtools support?

It has no native code of its own and follows magic, tapir and crumbs. pana lists Android, iOS, macOS, Windows and Linux; web drops out through the path_provider import in magic.

Does Magic Devtools end up in a release build?

Not when each install call sits under if (!kReleaseMode). kReleaseMode is a compile-time constant, so a release build drops the branch and everything it reaches. Nothing in the package checks the build mode, so the guard stays at your call site.

Do I need both tapir and crumbs for Magic Devtools?

The install adds both, and each has its own entry point if you want one alone: tapir.dart or crumbs.dart. Keep magic_devtools, tapir and crumbs under dependencies, because lib/main.dart imports them.

Does Magic Devtools work with AI coding agents?

Yes. Magic Devtools ships an agent skill that teaches your assistant how to wire tapir and crumbs with MagicDevtools and keep the wiring out of release builds, plus a public docs MCP server for live lookup.

Is Magic Devtools open source?

Yes. Magic Devtools is open source under the MIT license.

Add it in seconds

~/my_app
flutter pub add magic_devtools

Or add to pubspec.yaml:

dependencies:
  magic_devtools: ^1.1.0

Or give your AI agent this prompt:

Read https://anilcancakir.com/magic/docs/devtools/llms.txt and install the Magic Devtools package in this project.