website icon indicating copy to clipboard operation
website copied to clipboard

Not sure if Cursor still requires the experimental flag when setting up the MCP server

Open sethladd opened this issue 2 months ago • 15 comments

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.

sethladd avatar Nov 03 '25 04:11 sethladd

cc @anderdobo , wdyt?

sethladd avatar Nov 03 '25 04:11 sethladd

@johnpryan?

sfshaza2 avatar Nov 03 '25 17:11 sfshaza2

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

johnpryan avatar Nov 04 '25 21:11 johnpryan

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)

DanTup avatar Nov 05 '25 10:11 DanTup

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.

jakemac53 avatar Nov 05 '25 16:11 jakemac53

Thanks for flagging that, Cursor claims that they support roots, but I can't verify if this is still required.

johnpryan avatar Nov 05 '25 22:11 johnpryan

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).

DanTup avatar Nov 06 '25 11:11 DanTup

We should definitely re-validate whether they actually set roots. If they do, we can stop shaming them in the help text LOL

jakemac53 avatar Nov 06 '25 19:11 jakemac53

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.

DanTup avatar Nov 06 '25 19:11 DanTup

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.

jakemac53 avatar Nov 06 '25 20:11 jakemac53

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:

Image

I've filed https://github.com/dart-lang/ai/issues/310 with the details.

DanTup avatar Nov 11 '25 17:11 DanTup

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):

Image

@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.

DanTup avatar Nov 26 '25 15:11 DanTup

[@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.

jakemac53 avatar Dec 01 '25 16:12 jakemac53

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?

DanTup avatar Dec 03 '25 12:12 DanTup

Yeah I think we should keep the flag

jakemac53 avatar Dec 03 '25 15:12 jakemac53