🖱️ Cursor and WSL
Here I want to share a short guide about setting up Cursor to work well with WSL.
Step 1: Point Cursor to WSL
First, you need to open your project which located inside WSL. Since Cursor is based on VS Code, you can just follow the VS Code tutorial, or simply:
- Search for the “WSL” extension in the “Extensions” tab and click “Install”.
- Look at the bottom left corner for a new button that looks like “><”.
- Click it and select “Connect to WSL” or “Connect to WSL using Distro…”.
After this, you can open projects from WSL.
Step 2: Edit your MCPs configuration
If you use MCP, you’ll probably want to run it in WSL too. As of version 0.49.0
, Cursor needs an extra change for this.
Usually your mcp.json
looks like this:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
}
}
}
To make it run in WSL you need to change it to something like this:
{
"mcpServers": {
"context7": {
"command": "wsl",
"args": ["bash", "-c", "'npx -y @upstash/context7-mcp@latest'"]
}
}
}
Step 3: Edit your WSL $PATH variable
To be able to run cursor
and cursor-tunnel.exe
from WSL, add Cursor’s bin/
folder to your $PATH
like this:
export PATH=$PATH:/mnt/c/Users/seroperson/AppData/Local/Programs/cursor/resources/app/bin
Also take a look on the other notes: