Skip to main content
Guide · AI & LLM

GitHub Copilot for Flutter: Agent Mode Setup, copilot-instructions.md, the Dart MCP Server and Agent Skills

A Flutter developer's setup guide for GitHub Copilot in VS Code: choosing the Agent mode, connecting the Dart and Flutter MCP server, installing the official Flutter and Dart agent skills, writing copilot-instructions.md and path-specific .instructions.md files, using AGENTS.md, and making Copilot code review and the cloud agent read the same files on pull requests.

Afaq Zahir, author

Afaq Zahir

Flutter mobile product engineer

Published Updated 13 min read

On this page
  1. Does GitHub Copilot work with Flutter?
  2. How do I set up GitHub Copilot agent mode for Flutter in VS Code?
  3. How do I add the Dart MCP server to GitHub Copilot?
  4. How do I install the official Flutter and Dart agent skills for Copilot?
  5. Where do I put copilot-instructions.md in a Flutter project?
  6. What should a copilot-instructions.md file for Flutter contain?
  7. How do I apply Copilot instructions only to Dart files or test files?
  8. What is the difference between copilot-instructions.md, .instructions.md and AGENTS.md?
  9. How do Copilot code review and the cloud agent use these files on pull requests?
  10. How do I use Copilot on client Flutter projects?
  11. Frequently Asked Questions

Quick answer

GitHub Copilot works well for Flutter once you add four things: the Agent option in VS Code chat, the Dart MCP server (.vscode/mcp.json or the dart.mcpServer setting), the official skills from flutter/agent-plugins and dart-lang/skills in .agents/skills, and your rules in .github/copilot-instructions.md. Copilot code review and the cloud agent read the same instruction files on pull requests.

Key takeaways

  • Use the Copilot harness with the Agent option for Flutter work; Ask is read-only and Plan only writes an implementation plan.
  • The Dart MCP server gives Copilot analysis, symbol lookup, pub.dev search, hot reload and a widget inspector; add it through .vscode/mcp.json or the dart.mcpServer setting.
  • Install the official Flutter and Dart skills with npx skills add into .agents/skills, a folder VS Code and GitHub both read.
  • Put project-wide rules in .github/copilot-instructions.md and Dart or test rules in .github/instructions/*.instructions.md with an applyTo glob.
  • Copilot code review and the cloud agent read repository instructions, AGENTS.md and skills, so one set of files covers the editor and your pull requests.

GitHub Copilot for Flutter works well in VS Code once you connect four official pieces: the Agent option, the Dart MCP server, the Flutter and Dart agent skills and a .github/copilot-instructions.md file. Out of the box, Copilot knows Dart but not your project or Flutter's tooling, and the Flutter team now publishes the missing pieces. For context, the Flutter Q2 2026 survey drew 3,500+ responses, and respondents could name more than one tool. In it, 19% named GitHub Copilot as part of their daily workflow, behind Claude Code at 32% and Antigravity at 23%. This is the setup I use in VS Code, with every file where Copilot actually looks.

By Afaq Zahir, Flutter developer with 4+ years and 20+ shipped Flutter apps, including TourVista.

Setup checklist:

  1. In the VS Code Chat view, set the Session Target to Copilot and choose Agent.
  2. Add the Dart MCP server in .vscode/mcp.json (or turn on "dart.mcpServer": true).
  3. Run npx skills add flutter/agent-plugins and npx skills add dart-lang/skills in the project root.
  4. Write your project rules in .github/copilot-instructions.md and commit it.

Does GitHub Copilot work with Flutter?

Yes. Flutter's official AI documentation has a GitHub Copilot section stating that Copilot in VS Code supports agentic coding, tool calling through MCP and custom workspace instructions. Those are the three hooks you connect to Flutter's official MCP server, skills and rules, so Copilot can analyze, test and hot reload your app.

Flutter calls the full kit an "agent plugin" with four parts:

  • Agent skills: folders with a SKILL.md file of task instructions, which the agent loads only when a task matches.
  • Agent rules: persistent rules added to the context at the start of every session.
  • The Dart and Flutter MCP server: the Dart team's official Model Context Protocol server, which gives agents analysis, symbol lookup, pub.dev search, tests, formatting and introspection of a running app.
  • Specialized agents: Flutter's docs say the accessibility agent is currently available in Google Antigravity.

If you are still choosing a tool, see my comparison of Antigravity, Claude Code and Cursor for Flutter.

How do I set up GitHub Copilot agent mode for Flutter in VS Code?

Open the Chat view, set the Session Target to Copilot, choose Agent in the agent picker, leave the model on Auto and keep permissions on Manual. VS Code recommends exactly that combination for a first coding task, and it is the right default for Flutter work.

Agent mode is the Copilot chat mode that plans steps, picks files, runs commands and iterates from one high-level prompt. A harness, in VS Code's words, "coordinates the language model, context, and tools that an agent uses". You pick one with the Session Target control. The Copilot harness runs on the Copilot SDK, shared across GitHub Copilot products. Local is VS Code's built-in agent, and Claude and Codex are also available. Cloud is an execution target that runs remotely and returns a pull request. VS Code recommends starting with Copilot for day-to-day work. Inside it you pick a built-in agent:

AgentWhat it doesEdits files?When I use it
AskRead-only answers, never touches codeNoUnderstanding an unfamiliar widget tree or package
AgentImplements changes and validates the resultYes, with approvalsFeatures, refactors, analyzer fixes, tests
PlanWrites an implementation plan (also /plan)No code changesBefore a multi-screen feature
Autopilot (mode picker, not an agent)Works on its own until it decides the task is complete, retrying on errorsYes, auto-approves all toolsNot on client repositories

In the Copilot harness, Autopilot is a separate mode in the mode picker, not a fourth agent. It auto-approves every tool and answers blocking questions itself. GitHub notes that agent mode is not always the right tool.

Permissions come in three levels: Manual (the default), Assisted and Allow all. Assisted is experimental: a model reviews each tool call, and you confirm only the calls it does not approve. The chat.tools.terminal.autoApprove setting auto-approves chosen terminal commands. Read-only commands run automatically, and risky ones such as rm still ask. VS Code warns that terminal auto-approval "is a best-effort convenience, not a security boundary." I stay on Manual for client repositories.

How do I add the Dart MCP server to GitHub Copilot?

Create .vscode/mcp.json with a dart entry under servers that runs dart mcp-server, or set "dart.mcpServer": true so the Dart extension registers the server for you. Both routes need Dart 3.9 or later and give Copilot the official Dart and Flutter tools.

The Dart MCP server (dart_mcp_server, run with dart mcp-server) is the Dart team's official Model Context Protocol server. It exposes analysis, pub.dev search, tests and hot reload to AI agents. For every client and flag, see my Dart and Flutter MCP server setup guide.

Option 1: .vscode/mcp.json. This is the configuration from Flutter's get-started page. Make sure the MCP extension is enabled, then create the file in your workspace:

{
  "servers": {
    "dart": {
      "command": "dart",
      "args": ["mcp-server"]
    }
  }
}

Watch the top-level key. VS Code's format uses servers; other MCP clients use mcpServers, so snippets from another tool's docs do not match this file. You can also run MCP: Add Server from the Command Palette or search @mcp in the Extensions view. Read the trust prompt: local MCP servers can run code on your machine.

Which file does the Copilot harness read? Copilot harness sessions read the portable format directly: a workspace-root .mcp.json with a top-level mcpServers object. They do not read .vscode/mcp.json directly. Instead, VS Code forwards eligible servers from it, skipping servers that need interactive input such as ${input:...}. The Dart entry above uses no input variables, so it qualifies. VS Code's guided flow now labels .vscode/mcp.json as deprecated. If you prefer the portable file, the same server looks like this:

{
  "mcpServers": {
    "dart": {
      "command": "dart",
      "args": ["mcp-server"]
    }
  }
}

Option 2: the dart.mcpServer setting. With the Dart-Code extension v3.114 or later, add this to your user or workspace settings and the extension registers the server with VS Code:

"dart.mcpServer": true

What the server gives Copilot

dart_mcp_server is published by the verified tools.dart.dev publisher (version 1.2.1 as of October 2026) and its README still marks it experimental. It communicates over stdio. Tools enabled by default include analyze_files, lsp, pub, pub_dev_search, hot_reload, hot_restart, get_runtime_errors, widget_inspector, vm_service, dtd and flutter_driver_command.

run_tests, dart_fix, dart_format, launch_app and list_devices are off by default. Turn tools on or off with the --enable and --disable flags, by tool name or category (for example --enable flutter_app_lifecycle), added to the args array.

How do I install the official Flutter and Dart agent skills for Copilot?

Run two commands in your Flutter project root: npx skills add flutter/agent-plugins and npx skills add dart-lang/skills, each with --skill '*' --agent universal --yes. The skills land in .agents/skills, a folder VS Code and GitHub Copilot both read as project skills.

npx skills add flutter/agent-plugins --skill '*' --agent universal --yes
npx skills add dart-lang/skills --skill '*' --agent universal --yes

--skill '*' installs every skill, --yes skips prompts and -g would install globally. The CLI's github-copilot target writes to the same .agents/skills/ folder, so universal loses nothing for Copilot.

  • flutter/agent-plugins (Flutter team, BSD-3-Clause): as of October 2026, 25 skills, ten of them Flutter skills, including flutter-add-widget-test, flutter-add-integration-test, flutter-apply-architecture-best-practices, flutter-fix-layout-issues, flutter-setup-declarative-routing and flutter-setup-localization.
  • dart-lang/skills: 15 Dart skills as of October 2026 (the same dart-* names also appear in flutter/agent-plugins), including dart-add-unit-test, dart-generate-test-mocks, dart-run-static-analysis, dart-resolve-package-conflicts and dart-fix-runtime-errors.

Installing all of them does not flood the context: VS Code loads each skill's name and description first, the SKILL.md body only when a task matches, and referenced files only when needed. You can also invoke a skill as a slash command.

VS Code reads project skills from .github/skills/, .claude/skills/ and .agents/skills/, and personal ones from folders such as ~/.copilot/skills/. On GitHub's side, agent skills work in the Copilot app, Copilot CLI, and the cloud agent and code review on GitHub.com. They also work in agent mode in VS Code, Visual Studio and JetBrains IDEs. Supported skill folders depend on the surface.

Where do I put copilot-instructions.md in a Flutter project?

Put it at .github/copilot-instructions.md in the repository root and commit it. Copilot in VS Code, Copilot code review and the cloud agent all read it. Flutter's docs tell Copilot users to add the rules they want from the official rules repository to this file.

The official rules folder currently holds one rule, flutter-hot-reload. It tells the agent to "execute the hot_reload MCP tool immediately after making changes to UI widgets", to hot restart after changes to initState, main or global state, and to skip edits outside lib/ or comment-only edits. It only works with the Dart MCP server connected. GitHub also says you can ask the Copilot cloud agent to generate a first draft of the file.

What should a copilot-instructions.md file for Flutter contain?

Keep it to standing rules that apply to every task: architecture, state management, UI conventions, dependency policy and what "done" means. Paste the official hot reload rule first, then your project rules. Anything that only applies to certain files belongs in a path-specific instructions file instead.

This is the shape I use. The project rules are my own conventions, not an official template:

# Copilot instructions

<!-- Paste rules/flutter-hot-reload.md from github.com/flutter/agent-plugins -->

## Architecture
- Feature-first MVVM: widgets render state, view models hold logic,
  repositories own data.

## State management
- Riverpod only. Do not add GetX, Provider or BLoC.

## Dependencies
- Ask before adding a package. Prefer what is already in pubspec.yaml.

## Done means
- flutter analyze shows no new warnings.
- flutter test passes.

Swap the state line for whatever your team uses; my Riverpod vs BLoC comparison explains how I choose. Naming the one state library is the line I find matters most, because without it agents mix patterns. To confirm Copilot used the file, expand References in the chat response. Personal always-on rules go in ~/.copilot/copilot-instructions.md.

How do I apply Copilot instructions only to Dart files or test files?

Create NAME.instructions.md files in .github/instructions/, each starting with frontmatter that holds an applyTo glob, such as "**/*.dart" for all Dart files or "test/**/*.dart" for tests. VS Code attaches the file automatically when the agent creates or modifies a matching file.

---
name: "Dart code"
description: "Conventions for every Dart file in this Flutter app"
applyTo: "**/*.dart"
---
- Use const constructors wherever possible.
- Dispose every controller and StreamSubscription you create.

For tests, list several globs separated by commas:

---
applyTo: "test/**/*.dart,integration_test/**/*.dart"
---
- One behaviour per test, named in plain English.
- Never call real network services.

Mind the glob: *.dart matches only the current directory, while **/*.dart matches recursively. To hide a file from one GitHub agent, add excludeAgent: "code-review" or excludeAgent: "cloud-agent"; without it, both use the file.

The community github/awesome-copilot repository ships a 447-line dart-n-flutter.instructions.md with applyTo: "**/*.dart". I copy only the rules my project needs, because a short file is one the agent follows.

What is the difference between copilot-instructions.md, .instructions.md and AGENTS.md?

copilot-instructions.md holds repository-wide Copilot rules, .instructions.md files hold rules for paths matched by applyTo, and AGENTS.md holds agent instructions. GitHub lists these as its three instruction types. VS Code suggests AGENTS.md when you work with multiple compatible AI coding agents and want to share one set of instructions.

VS Code's Copilot harness reads AGENTS.md at the repository root, the working directory and the folders between. On GitHub, the nearest AGENTS.md in the directory tree wins, and a single root CLAUDE.md or GEMINI.md also works. VS Code warns there is "no general precedence order between these files", so never put the same rule in two places. I cover what goes in AGENTS.md in my guide to building a Flutter app with AI.

Not every surface reads every file. From GitHub's support matrix:

Surfacecopilot-instructions.md*.instructions.mdAGENTS.md
VS Code chatYesYesYes
VS Code code reviewYesNoNo
Cloud agent (GitHub.com)YesYesYes
Code review (GitHub.com)YesYesYes
Copilot Chat (GitHub.com)YesNoNo

How do Copilot code review and the cloud agent use these files on pull requests?

Both read your repository instructions, AGENTS.md and agent skills, so the files you set up for the editor also shape pull requests. Code review reads them from the pull request's head branch, which means you can change an instruction and see its effect in the same pull request.

Code review. By default Copilot only reviews a pull request you assign it to. Custom instructions are on by default; the toggle is "Use custom instructions when reviewing pull requests" under Settings > Copilot > Code review. Code review can also use repository skills and MCP servers.

Cloud agent. Copilot cloud agent can edit files and run tests and linters in an ephemeral cloud development environment. Copilot handles branch creation, commit messages and pushing changes, and you can request a pull request. You can start work from the agents panel, a conversation, or an issue or pull request on GitHub.com.

For Flutter it needs the SDK preinstalled through .github/workflows/copilot-setup-steps.yml. The file holds a single job that must be named copilot-setup-steps. Only steps, permissions, runs-on, services, snapshot and timeout-minutes (maximum 59) are honoured. It runs on Ubuntu by default, and it does not trigger unless the file is on your default branch. One option for installing Flutter in Actions is the third-party subosito/flutter-action@v2, which can read the version from pubspec.yaml. I found no official Flutter example of this file, so confirm the agent can run flutter test before relying on it.

Cloud agent MCP is configured separately, under Settings > Copilot > MCP servers, as JSON with an mcpServers object and a required tools allowlist per server. GitHub and Playwright servers are on by default, only MCP tools are supported, and code review shares the configuration.

How do I use Copilot on client Flutter projects?

I treat it like every other agent: shared rules, small tasks, tests as the gate, and I read every diff. This is my general workflow rather than a Copilot-specific one. Across 4+ years and 20+ shipped Flutter apps, including TourVista, which launched on both stores in 28 days, that routine has mattered more than which tool I picked.

  1. Plan first for anything touching more than one screen, then switch to Agent.
  2. Run the app in debug mode so Copilot can hot reload. Flutter apps register with the Dart Tooling Daemon automatically in debug and profile mode, unless --no-dds is passed.
  3. Invoke skills by name for repeatable jobs like widget tests.
  4. Gate on tests: no change is done until flutter analyze and flutter test pass. My guide to testing Flutter apps with AI agents covers that setup.
  5. Review pubspec.yaml, platform folders and anything touching payments or user data line by line.

For the Antigravity side of the same workflow, see my Antigravity guide for Flutter.

Frequently Asked Questions

Is agent mode available on the GitHub Copilot Free plan?

Yes. As of October 2026, GitHub's plans page lists agent mode and MCP server support on every plan, including Free. Agent mode covers VS Code, Visual Studio, JetBrains, Eclipse and Xcode. Paid plans are Pro at $10 a month, Pro+ at $39 and Max at $100.

Which Copilot plans include the cloud agent and code review?

As of October 2026, neither is included in Copilot Free, so you need a paid plan: Pro, Pro+ or Max. Check GitHub's plans page before committing a team, since plans change.

Why is Copilot not reading my .vscode/mcp.json?

Check the top-level key is servers, not mcpServers, and that you run Dart 3.9 or later. In a Copilot harness session, the server arrives through VS Code forwarding, which skips servers that use ${input:...}. If forwarding does not suit you, use a root .mcp.json with an mcpServers object, as shown in the MCP section above.

Can Copilot hot reload my Flutter app?

Yes, through the Dart MCP server's hot_reload and hot_restart tools, both on by default. Run the app in debug mode so it registers with the Dart Tooling Daemon, and add the official flutter-hot-reload rule to copilot-instructions.md so Copilot reloads after editing widgets.

Does GitHub Copilot support AGENTS.md?

Yes. VS Code's Copilot harness reads it as project instructions, and the cloud agent and code review on GitHub.com read it too, with the nearest file in the directory tree taking precedence. Copilot Chat on GitHub.com and code review inside VS Code do not use it.

Does Copilot code review use my custom instructions?

Yes, by default. It reads repository instructions, agent instructions and agent skills from the pull request's head branch. You can switch this off in the repository's code review settings, or hide one path-specific file with excludeAgent: "code-review".

What is the difference between Ask, Agent and Plan in VS Code?

Ask answers questions without touching your code. Agent implements changes and validates the result. Plan writes an implementation plan you review before any code changes, and is also available as /plan. For Flutter features I plan first, then run Agent.

Is GitHub Copilot or Claude Code better for Flutter?

In my view, neither is better across the board. Usage surveys measure how many developers pick a tool, not the quality of its Flutter code. Choose Copilot if your team works in VS Code and GitHub pull requests, since code review and the cloud agent read the same instruction files and skills you set up for the editor. For a terminal-first workflow, see my Claude Code guide for Flutter developers, and for a wider view, my comparison of AI coding tools for Flutter.

If you want your Flutter team set up with Copilot, MCP and project rules that keep generated code shippable, or need an AI feature built into your app, see my Flutter AI development service or get in touch.

Afaq Zahir

Written by

Afaq Zahir

Flutter mobile product engineer with 4+ years shipping 20+ apps to the App Store and Google Play. Led Flutter teams at Metasense and Apptex.

GitHub ↗LinkedIn ↗Last reviewed
Book a call