Gemini CLI, MCP and the AI Toolkit for Flutter Apps

Coding Liquids blog cover featuring Sagnik Bhattacharya for creating with AI in Flutter, with tooling nodes and production-minded AI workflow visuals.
Coding Liquids blog cover featuring Sagnik Bhattacharya for creating with AI in Flutter, with tooling nodes and production-minded AI workflow visuals.

Gemini CLI, MCP and the Flutter AI Toolkit do different jobs when you create Flutter apps with AI: Gemini CLI and MCP help you write and debug the code, while the AI Toolkit puts AI features inside the finished app. The tooling can feel messy because all three, plus IDE integrations, tend to arrive at once.

The Complete Flutter Course: Build Android, iOS and Web apps

Go from scratch to building industry-standard apps with Riverpod, Firebase, animations, REST APIs, and more.

By Sagnik Bhattacharya and Paulina Knop

Buy now

The useful way to think about it is to separate three jobs: speeding up developer work, integrating model-backed features into the product, and keeping the result maintainable after the first demo.

Note: Tool names and recommended workflows in Flutter’s AI documentation are evolving. Since this guide was first written, Google has moved free and Google AI Pro/Ultra users from Gemini CLI to its new Antigravity CLI (on 18 June 2026), and Flutter’s docs now list Antigravity alongside Claude Code, Cursor, Codex, and GitHub Copilot as assistants that work with the Dart and Flutter MCP server. Treat this overview as current as of September 2026 and verify the latest docs before you standardise a team workflow.

How do Gemini CLI, MCP and the AI Toolkit differ?

Gemini CLI and MCP work on your code as you build; the AI Toolkit ships AI features to your users. Use Gemini CLI or comparable tooling to speed up local development tasks, use MCP where you need a cleaner bridge between tools and models, and use Flutter’s AI Toolkit or platform integrations when the app itself needs AI features. Do not treat all three as the same problem.

  • You want faster coding and debugging loops without pretending AI replaces engineering.
  • You are designing actual product features that use models or agents.
  • You need a workflow teams can review, test, and maintain.

The Complete Flutter Course: Build Android, iOS and Web apps

Go from scratch to building industry-standard apps with Riverpod, Firebase, animations, REST APIs, and more.

By Sagnik Bhattacharya and Paulina Knop

Buy now

Why separate developer tooling from product architecture?

Developer tooling and product architecture are different decisions, so each needs its own plan. Mixing them is the mistake most teams make first: they bundle code generation, backend AI integration, and in-app user features into one vague AI strategy. That makes planning worse, not better.

A healthier split is simple. Developer tooling helps you write or inspect code faster. Product architecture decides how the app talks to models or services. UI and policy decisions shape what the user actually sees.

Where do Gemini CLI and MCP fit in a Flutter project?

Gemini CLI and MCP mainly fit the developer side of a Flutter project rather than the shipped product. Gemini CLI handles developer assistance: local iteration, code scaffolding, debugging, or accelerating routine implementation. The same goes for Antigravity CLI, which now serves the free and Google AI Pro/Ultra users Gemini CLI no longer does, and for other terminal agents. MCP matters when you want a clearer tool interface and better boundaries around how model-driven workflows reach project context or external systems.

  • Developer speed-up: drafts, tests, refactors, and documentation.
  • Controlled tool access around model workflows.
  • A cleaner path from experimentation to team-level process.

What is the Flutter AI Toolkit best for?

The Flutter AI Toolkit is best for adding AI chat features to the app you ship, not for speeding up your own coding. The AI Toolkit matters most when you are moving from “use AI while coding” to “ship an app feature that uses AI”. It helps you think about the product surface, not merely the engineer surface.

That distinction matters because shipping AI means handling loading states, error states, abuse cases, privacy, cost, and degraded behaviour.

If you want to learn the Flutter fundamentals these AI tools sit on top of, try The Complete Flutter Course on Coding Liquids.

Worked example: adding AI to a support app

Suppose you are building a support dashboard that suggests draft replies. Gemini CLI can speed up implementation, but the AI Toolkit and your app structure matter more once the feature exists.

You still need prompt inputs, rate limiting, fallbacks, review controls, analytics, and a clean separation between UI, service layer, and data handling.

If you are planning an AI feature like this for your own business app, I offer a one-to-one AI consultation.

Common mistakes

  • Treating every AI tool as the same category of decision.
  • Letting generated code ignore the existing app structure.
  • Shipping AI features without product-level fallback behaviour.

When should you use something else?

Use something else when AI tooling is not your real bottleneck. If your issue is mostly app structure, go to architecture. If your bottleneck is UI speed, Widget Previewer may help more than another AI tool.

The Complete Flutter Course: Build Android, iOS and Web apps

Go from scratch to building industry-standard apps with Riverpod, Firebase, animations, REST APIs, and more.

By Sagnik Bhattacharya and Paulina Knop

Buy now

Frequently asked questions

What is the difference between Gemini CLI, the Dart MCP server and the Flutter AI Toolkit?

They work at different layers: the first two help you build the app, while the toolkit puts AI inside it. Gemini CLI is an open-source terminal agent that works on your code. The Dart and Flutter MCP server is a local tool server that such an agent connects to for static analysis errors, symbol lookups, pub.dev search and, in a running app, hot reload and the widget inspector. The AI Toolkit (flutter_ai_toolkit) is a set of chat widgets, led by LlmChatView, that ships to your users.

Does Gemini CLI still work for Flutter, or do I need Antigravity CLI?

It depends on your account. On 18 June 2026, free individual use and Google AI Pro and Ultra plans moved from Gemini CLI to Antigravity CLI, which runs as agy. Gemini CLI now serves organisations on Gemini Code Assist Standard or Enterprise, plus paid Gemini API keys. When you switch, agy plugin import gemini converts extensions to plugins, MCP servers move from settings.json into mcp_config.json (.agents/ per project, ~/.gemini/config/ globally), and GEMINI.md and AGENTS.md rules carry over unchanged.

How do I connect the Dart and Flutter MCP server to my AI coding assistant?

Register it as a stdio server that runs dart mcp-server. Most clients take "dart": {"command": "dart", "args": ["mcp-server"]} under mcpServers, in .agents/mcp_config.json for Antigravity CLI or .gemini/settings.json for Gemini CLI. Copilot in VS Code uses .vscode/mcp.json with a servers key. Claude Code, Cursor and Codex can install the official dart-flutter plugin instead, which sets up the server and adds Flutter skills. You need Dart 3.9 or later.

How do I make an AI coding agent follow my Flutter project's structure?

Give it rules: instructions the assistant loads at the start of every session. Flutter publishes official rules in the flutter/agent-plugins repository; add the ones you want, plus your own conventions such as folder layout and state-management choice, to CLAUDE.md for Claude Code, .cursor/rules/ for Cursor, .github/copilot-instructions.md for Copilot or AGENTS.md for Codex and Antigravity CLI. The Claude Code and Codex plugins don't load rules for you, so add them yourself, then review the output like any pull request.

What does the flutter_ai_toolkit package give me?

Ready-made AI chat UI. LlmChatView handles multi-turn chat with streamed responses, formatted text, voice input and attachments, styled through LlmChatViewStyle, with onErrorCallback for failures. It runs on Android, iOS, web and macOS. Models plug in through the abstract LlmProvider: FirebaseProvider (Firebase AI Logic) is built in, EchoProvider echoes the prompt for testing, and you can implement your own provider for another LLM. Each provider keeps the conversation in its history property, which you save with each message's toJson() and restore with ChatMessage.fromJson().

Do I need to put a Gemini API key in my Flutter app?

No. With the AI Toolkit's FirebaseProvider, calls go through Firebase AI Logic, which authorises Gemini requests with a Google-managed service account in your Firebase project, so no Gemini API key sits in your code. Firebase AI Logic does require App Check from 2 November 2026: add firebase_app_check, call FirebaseAppCheck.instance.activate() after Firebase.initializeApp(), and use the debug provider during development. For production, Flutter's docs also recommend routing AI requests through a backend such as Cloud Functions for Firebase.

Sagnik Bhattacharya, founder of Coding Liquids, has written more than 120 free Flutter tutorials for this site, including this one. To go from single topics like this one to a complete app, The Complete Flutter Course at codingliquids.com walks through state management, Firebase, animations and REST APIs inside projects you actually ship.

Related tutorials

If you want to keep going without opening dead ends, these are the most useful next reads from this site.

Official references

These official references are useful if you need the product or framework documentation alongside this guide.