Not sure if Cursor still requires the experimental flag when setting up the MCP server
Page URL
https://docs.flutter.dev/ai/mcp-server
Page source
https://github.com/flutter/website/blob/main/src/content/ai/mcp-server.md
Describe the problem
The other tools' MCP configurations look like:
"command": "dart",
"args": [
"mcp-server"
]
but for Cursor (on this page), we still say:
dart": {
"command": "dart",
"args": [
"mcp-server",
"--experimental-mcp-server",
"--force-roots-fallback"
]
Not sure if experimental and force-roots-fallback are still required for Cursor?
Expected fix
No response
Additional context
No response
I would like to fix this problem.
- [ ] I will try and fix this problem on docs.flutter.dev.
cc @anderdobo , wdyt?
@johnpryan?
I'm unable to use Cursor on my machine, but I don't see why we would recommend the experimental flags for Cursor and not other IDEs. https://github.com/flutter/website/pull/12634
Are we sure both of these flags aren't needed for Cursor? (cc @jakemac53)
At https://github.com/dart-lang/ai/blob/main/pkgs/dart_mcp_server/README.md#cursor it specifically mentions --force-roots-fallback is a workaround for a Cursor issue. It seems deliberate that this differs from the standard non-Cursor arguments.
(It also says --experimental-mcp-server is only required for < Dart 3.9.. I don't know if we would want to wait a little before removing it for users that might not have upgraded yet)
The --force-roots-fallback may still be needed, but --experimental-mcp-server can likely be dropped. As @DanTup said it depends on your dart version.
Thanks for flagging that, Cursor claims that they support roots, but I can't verify if this is still required.
I'm not sure exactly what the issue was with Cursor (maybe @jakemac53 can confirm), but I'll note that the help text here:
https://github.com/dart-lang/ai/blob/0a85ddf4f75cee6e3abe07cecdffae69bbdbc793/pkgs/dart_mcp_server/lib/src/arg_parser.dart#L40-L43
says:
This can be helpful for clients like Cursor which claim to have roots support but do not actually support it.
So it's not guaranteed that their docs match the behaviour (of course, it's possible that whatever the issue was has been resolved).
We should definitely re-validate whether they actually set roots. If they do, we can stop shaming them in the help text LOL
I have a VM with it installed I can test with, but I don't know what the actual issue was or how to verify it. @jakemac53 if you can tell me what to look for, I can check.
You can try just not passing the --force-roots-fallback flag, and then asking it to do something that happens in a project directory, like running tests, or adding a dependency.
I tried removing that flag, but it seems like Cursor never responds to the request for roots. However, I'm not sure if that's because of an error occurring in the server:
I've filed https://github.com/dart-lang/ai/issues/310 with the details.
With the issue above resolved, I still see the same behaviour - the roots/list response isn't responded to (although the log gets a load of null characters written):
@jakemac53 is this the problem the flag was for? Do you understand why all the null characters.. There are thousands of them but I don't know if they're coming from the server of from the Cursor client.
[@jakemac53
](https://github.com/jakemac53) is this the problem the flag was for? Do you understand why all the null characters.. There are thousands of them but I don't know if they're coming from the server of from the Cursor client.
The flag was not for this issue, it would previously respond but just with an empty list of roots IIRC.
hmm, in that case I'm not sure whether it's gotten worse, or if there is something wrong with our logging.
I found https://forum.cursor.com/t/mcp-client-does-not-support-roots-list/77248 in their forum also complaining about it not working (though it says it returns a "method not found" error).
Based on this, I think we should keep the flag?
Yeah I think we should keep the flag