The WSL Developer's Journey: Getting Claude Code to Talk to Figma on Windows
Published: January 6, 2025 | By David Moling
As a developer who lives in WSL but needs to work with Windows applications, I recently faced an interesting challenge: getting Claude Code running in WSL to communicate with the Figma desktop app on Windows. What seemed like a simple MCP (Model Context Protocol) server connection turned into a fascinating exploration of WSL networking, SSH tunneling, and the quirks of cross-environment development.
The Problem: Two Worlds Apart
Picture this: You're running Claude Code in WSL, your development environment of choice. Meanwhile, Figma Desktop sits comfortably in Windows land, running its Dev Mode MCP server on localhost:3845
. The two should talk to each other, right? Not so fast.
david@DESKTOP-VH4HMVI:~/coding$ curl http://127.0.0.1:3845/mcp
curl: (7) Failed to connect to 127.0.0.1 port 3845 after 0 ms: Couldn't connect to server
The issue? WSL2 has its own networking stack, completely isolated from Windows. When Figma listens on 127.0.0.1
in Windows, it's invisible to WSL. It's like trying to have a conversation through a soundproof wall.
The Investigation: Following the Breadcrumbs
My first clue came from an error message in Figma: "You are currently using an old endpoint for the Dev Mode MCP server. Please change the settings in your coding tool to use the new /mcp endpoint."
But even with the right endpoint, the fundamental networking issue remained. Time to dig deeper.
Attempt 1: Using the Windows Host IP
WSL provides the Windows host IP in /etc/resolv.conf
. Maybe we could use that?
# Get Windows host IP
cat /etc/resolv.conf | grep nameserver | awk '{print $2}'
# Returns: 172.28.208.1
# Try connecting
curl http://172.28.208.1:3845/mcp
# ... timeout ...
No luck. The curl command just hung there, eventually timing out. The problem? Figma binds specifically to 127.0.0.1
, not to all network interfaces. It's a security feature, but it makes cross-environment communication tricky.
Attempt 2: Various Claude Code Configurations
I tried multiple approaches with Claude Code's MCP configuration:
# Attempt with localhost
claude mcp add --transport sse figma http://127.0.0.1:3845/sse
# Result: ✗ Failed to connect
# Attempt with Windows host IP
claude mcp add --transport sse figma http://172.28.208.1:3845/mcp
# Result: ✗ Failed to connect
Each attempt met the same fate. The two environments simply couldn't see each other.
The Solution: SSH Tunneling to the Rescue
Then it hit me: SSH tunneling! If I could create a tunnel from WSL to Windows, I could forward the port through the SSH connection. Here's how it works:
Step 1: Enable SSH Server on Windows
First, I needed Windows to accept SSH connections:
# In PowerShell as Administrator
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
Step 2: Verify Figma is Listening
netstat -an | findstr 3845
# Output: TCP 127.0.0.1:3845 0.0.0.0:0 LISTENING
Perfect! Figma was running and listening on the right port.
Step 3: Create the SSH Tunnel
The magic command that made everything work:
# In WSL
ssh -L 3845:localhost:3845 David@172.28.208.1
This creates a tunnel that forwards port 3845 from WSL's localhost to Windows' localhost through the SSH connection.
Step 4: Configure Claude Code
With the tunnel active, I could finally connect:
# Add the MCP server using localhost (through the tunnel)
claude mcp add --transport sse figma http://localhost:3845/sse
# Check the connection
claude mcp list
# Result: figma: http://localhost:3845/sse (SSE) - ✓ Connected
Success! The green checkmark was a beautiful sight after hours of troubleshooting.
The Technical Details: Why This Works
The SSH tunnel creates a secure channel between WSL and Windows. When Claude Code connects to localhost:3845
in WSL, the SSH tunnel:
- Receives the connection on WSL's localhost
- Forwards it through the SSH connection to Windows
- Connects to Windows' localhost:3845 where Figma is listening
- Relays the data back and forth
It's elegant in its simplicity, using a decades-old technology to solve a modern problem.
Making It Practical: Daily Workflow
The solution works, but opening an SSH tunnel every day gets tedious. Here are some improvements I implemented:
Bash Alias for Quick Connection
Added to ~/.bashrc
:
alias figma-tunnel='ssh -L 3845:localhost:3845 David@$(cat /etc/resolv.conf | grep nameserver | awk '"'"'{print $2}'"'"')'
Now I just type figma-tunnel
and enter my password.
SSH Config for Persistence
Created ~/.ssh/config
:
Host windows-host
HostName 172.28.208.1
User David
LocalForward 3845 localhost:3845
ServerAliveInterval 60
ServerAliveCountMax 3
This keeps the connection alive and makes it as simple as ssh windows-host
.
Lessons Learned
WSL Networking is Complex: WSL2's network isolation is great for security but can complicate inter-environment communication.
Old Solutions for New Problems: SSH tunneling, a technology from 1995, elegantly solves a 2025 development environment challenge.
Security vs. Convenience: Figma's localhost-only binding is a security feature. Our solution maintains that security while enabling the functionality we need.
Document Everything: This journey reminded me why documenting solutions is crucial. What took hours to figure out can now be implemented in minutes.
The Bigger Picture
This experience highlights a common challenge in modern development: tool fragmentation across environments. As developers, we often need to bridge different worlds - WSL and Windows, containers and host systems, local and remote environments.
The Figma MCP server integration is just one example, but the pattern applies broadly:
- Identify the networking barrier
- Find or create a bridge (SSH, proxies, port forwarding)
- Automate the solution for daily use
- Document for future reference
Conclusion
What started as a simple "connect Claude Code to Figma" task became a deep dive into WSL networking, Windows services, and SSH tunneling. The final solution is robust, secure, and relatively simple to use daily.
For developers facing similar challenges, remember: sometimes the best solutions combine old and new technologies. Don't be afraid to reach for established tools like SSH when modern environments create barriers.
Happy coding, and may your MCP servers always show that satisfying green checkmark!
Technical Environment: Windows 11, WSL2 Ubuntu, Claude Code CLI, Figma Desktop with Dev Mode