mcp-server-cloudflare icon indicating copy to clipboard operation
mcp-server-cloudflare copied to clipboard

anyone able to get this to work in cursor?

Open rawwerks opened this issue 9 months ago • 6 comments

i can get the custom run command working with my id, but i can't seem to get cursor to see the cloudflare mcp

Image

rawwerks avatar Feb 18 '25 20:02 rawwerks

I did your still in the dspy discord this is batman

jmanhype avatar Feb 26 '25 16:02 jmanhype

@jmanhype I'm also interested. Could you share your solution here? 🙏

Pekket avatar Feb 26 '25 16:02 Pekket

@jmanhype batman to the rescue!

what's the secret?

rawwerks avatar Feb 26 '25 17:02 rawwerks

Any updates on that? 👀

scouech avatar Feb 26 '25 20:02 scouech

Hey! To get your Cloudflare MCP server working in Cursor, you need to combine the 'command' and 'args' from your config file into a single string and use type 'command'. For example, if your config file looks like:

{ "mcpServers": { "your-mcp-server-name": { "command": "/path/to/workers-mcp", "args": [ "run", "your-mcp-server-name", "https://your-server-url.workers.dev", "/path/to/your/project" ], "env": {} } } }

In Cursor, create an MCP server entry with type: command and "/path/to/workers-mcp run your-mcp-server-name https://your-server-url.workers.dev /path/to/your/project"

Let me know if that works for you!

dinasaur404 avatar Feb 27 '25 15:02 dinasaur404

thanks for this suggestion, i will give it a try.

for any others struggling, i've found it easier to prompt cursor to use the wrangler cli.

rawwerks avatar Feb 27 '25 18:02 rawwerks

  1. Authenticate your MCP server https://github.com/cloudflare/mcp-server-cloudflare?tab=readme-ov-file#setup
  2. Log into Cloudflare's website and copy the account ID
Image
  1. Edit mcp.json as such
{
  "mcpServers": {
    "cloudflare": {
      "command": "npx",
      "args": [
        "@cloudflare/mcp-server-cloudflare run <paste-account-id>"
      ]
    }
  }
}
  1. Cursor MCP panel should look like this. Might need to hit refresh to connect.
Image
  1. Use Claude 3.7, looks like most other models struggle to choose the right tools.
  2. I've had success structuring my prompt as "[ACTION I WANT TO HAPPEN] on cloudflare".
Image

jorgecolonconsulting avatar Mar 23 '25 20:03 jorgecolonconsulting

Adding to this thread

When you run npx @cloudflare/mcp-server-cloudflare init, it will login to Cloudflare using the wrangler CLI via npx wrangler login and host the credentials at the path according to the OS.

for macOS:

cat "~/Library/Preferences/.wrangler/config/default.toml"

On Claude by default it does this setup:

"cloudflare": {
     "command": "/opt/homebrew/bin/node",
      "args": [
        "~/.npm/_npx/384319a4c8dff50b/node_modules/@cloudflare/mcp-server-cloudflare/dist/index.js",
        "run",
        "112365757565fjgiv5d8ea"
     ]
 }

but you can simply have:

"cloudflare": {
            "command": "npx",
            "args": [
                "-y",
                "@cloudflare/mcp-server-cloudflare",
                "run",
                "112365757565fjgiv5d8ea"
            ]
        }

albertocavalcante avatar Mar 31 '25 06:03 albertocavalcante

This shouldn't be relevant anymore due to moving to remote MCP servers. All of our servers should be compatible with cursor via mcp-remote. If you run into issues, please let us know which servers have issues.

cmsparks avatar May 01 '25 19:05 cmsparks