DCM MCP Server
DCM MCP Server is available only for DCM 1.31.0+.
The DCM MCP server for Flutter and Dart works with any MCP client that supports stdio
as the transport medium. To access all the features of the DCM MCP server, a client must support Tools and Roots capabilities.
If you are using a client that claims it supports roots but doesn't actually set them, pass --force-roots-fallback
to enable tools for managing the roots.
Here is an overview of a few things the MCP server can do:
- Analyze and fix errors in your project's code.
- Apply fixes for unused code, unused files and dependency issues
- Format code.
- Generate a baseline.
- Generate a preview for lint rules and metrics.
- Calculate metrics.
- Run code quality checks (detection of unused code, unused files, parameter issues, etc.).
- Analyze your Flutter widgets and image assets.
Set up your MCP client​
To start the DCM MCP server, configure your preferred client to run dcm start-mcp-server
.
GitHub Copilot in VS Code​
By default, the DCM extension uses the VS Code MCP API to register the DCM MCP server.
Explicitly enable or disable the DCM MCP server by configuring the dcm.enableMcpServer
setting in your VS Code settings.
To change this globally, update your user settings:
- In VS Code, click
View
>Command Palette
and then search forPreferences: Open User Settings (JSON)
. - Add
"dcm.enableMcpServer": true
.
If you'd like this setting to apply only to a specific workspace, add the entry to your workspace settings:
- In VS Code, click
View
>Command Palette
and then search forPreferences: Open Workspace Settings (JSON)
. - Add
"dcm.enableMcpServer": true
.
For more information, see the official VS Code documentation for enabling MCP support.
Cursor​
To quickly configure the DCM MCP Server, click this button:
Alternatively, you can configure the server manually:
- Go to
Cursor
>Settings
>Cursor Settings
>Tools & Integrations
. - Click
Add Custom MCP
orNew MCP Server
depending on whether you already have other MCP servers configured. - Edit the
.cursor/mcp.json
file in your local project (configuration will only apply to this project) or edit the global~/.cursor/mcp.json
file in your home directory (configuration will apply for all projects) to configure the DCM MCP server:
{
"mcpServers": {
"dcm": {
"command": "dcm",
"args": ["start-mcp-server", "--force-roots-fallback", "--client=cursor"]
}
}
}
For more information, see the official Cursor documentation for installing MCP servers.
IntelliJ​
- Go to
Settings
|Tools
|AI Assistant
|Model Context Protocol (MCP)
. - Click
+ Add
. - In the
New MCP Server
dialog, provide a JSON configuration:
{
"mcpServers": {
"dcm": {
"command": "dcm",
"args": ["start-mcp-server", "--client=intellij"]
}
}
}
For more information, see the official IntelliJ documentation for installing MCP servers.
Android Studio​
Gemini in Android Studio's agent can interact with external tools using the Model Context Protocol (MCP).
To add an MCP server, create a mcp.json
file and place it in the configuration directory of Studio. The mcp.json
file should follow this format:
{
"mcpServers": {
"dcm": {
"command": "dcm",
"args": ["start-mcp-server", "--client=as"]
}
}
}
For more information, see the official Android Studio documentation for installing MCP servers.
Gemini CLI​
To configure the Gemini CLI to use the DCM MCP server, add a dcm
entry to the mcpServers
section of the Gemini config.
- To enable server for all projects on your device, edit the
~/.gemini/settings.json
file in your home directory. - To enable the server for a specific project, edit the
.gemini/settings.json
file in the project's root directory.
{
"mcpServers": {
"dcm": {
"command": "dcm",
"args": ["start-mcp-server", "--client=gemini"]
}
}
}