Troubleshooting MCP Server Connection Issues with VS Code Continue Extension on Windows WSL2 Using Ollama
Use this when the VS Code Continue extension cannot connect to an MCP server on Windows WSL2 while using Ollama.
Quick Read
- Symptom: Use this when the VS Code Continue extension cannot connect to an MCP server on Windows WSL2 while using Ollama.
- Check first: Verify that the MCP server is running and accessible.
- Risk: Changes system state
Symptoms
Users are unable to connect the MCP server to the VS Code Continue extension while using Ollama on Windows WSL2.
Environment
Windows 10/11 with WSL2, VS Code, Ollama installed, and MCP server running.
Most Likely Causes
Misconfiguration in network settings, firewall rules, or issues with the Ollama installation.
What to Check First
- Verify that the MCP server is running and accessible.
- Check WSL2 network settings and ensure proper configuration.
- Confirm that the VS Code Continue extension is installed and updated.
Fix Steps
- Check if the MCP server is running.
Ensure the MCP server is active and listening on the expected port.
Safe to run: read-only
curl http://localhost:<MCP_PORT>
- Verify WSL2 network configuration.
Check if WSL2 has the correct network settings to communicate with the MCP server.
Example pattern only. Adjust for your environment before running.
ip addr ping localhost
- Check firewall settings on Windows.
Ensure that Windows Firewall is not blocking the MCP server port.
Safe to run: read-only
netsh advfirewall firewall show rule name=all | findstr <MCP_PORT>
- Reinstall or update the VS Code Continue extension.
Remove and reinstall the extension to ensure it is functioning correctly.
Example pattern only. Adjust for your environment before running.
code --uninstall-extension <extension-id> code --install-extension <extension-id>
- Restart WSL2 and VS Code.
Restart WSL2 and VS Code to apply any configuration changes.
Example pattern only. Adjust for your environment before running.
wsl --shutdown code
Validation
- Confirm that the VS Code Continue extension can now connect to the MCP server.
- Test the functionality of the extension after troubleshooting.
Logs to Check
- Check the VS Code output panel for extension logs.
- Review the MCP server logs for any connection attempts or errors.
Rollback and Escalation
- If the issue persists after reinstalling the extension, revert to the previous extension version.
Escalate When
- If the MCP server is not accessible after all checks, escalate to the network administrator.
- If the issue is with the extension and cannot be resolved, escalate to the development team.
Edge Cases
- If using a VPN, ensure it does not block local network traffic.
- Check for any recent Windows updates that may have affected network settings.
Notes from the Field
- Ensure that the correct port is being used for the MCP server.
- Document any changes made to the firewall or network settings for future reference.