Running Non-Docker MCP Servers in Cursor: A Simple Workaround

Running Non-Docker MCP Servers in Cursor: A Simple Workaround

Are you struggling to add MCP servers to Cursor that can only be run with npx? I recently faced this exact challenge and found a simple yet effective solution using mcp-proxy.

The Problem

While Cursor’s MCP (Model Control Protocol) works great with Docker-based servers, I encountered difficulties integrating servers that can only be run with npx. Despite being able to run these servers perfectly from the terminal, they wouldn’t connect properly through Cursor’s interface.

The Solution: MCP Proxy

The workaround is surprisingly simple - use mcp-proxy to bridge the gap between Cursor and your npx-based MCP servers.

GitHub Repository: https://github.com/sparfenyuk/mcp-proxy

Step-by-Step Guide

1. Install uv (Fast Python Package Installer)

If you don’t already have uv installed, start by installing it:

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Install mcp-proxy with uv

Use uv to install the MCP proxy package:

uv tool install mcp-proxy

3. Run the proxy in your terminal

Launch the proxy with the following command, replacing “mcp-server-kubernetes” with whatever server you need to run:

mcp-proxy --sse-port 7070 --pass-environment npx -- mcp-server-kubernetes

This command:

  • Sets up an SSE (Server-Sent Events) endpoint on port 7070
  • Passes your environment variables to the server
  • Runs your npx-based MCP server through the proxy

4. Configure Cursor to use the proxy

  1. Open Cursor Settings
  2. Navigate to the MCP section
  3. Add a new SSE MCP server with the URL: http://localhost:7070/sse

5. Enjoy your newly connected MCP server!

You should now be able to use all the features of your npx-based MCP server directly within Cursor.

Why This Works

The mcp-proxy acts as a translation layer between Cursor’s expected communication format and your npx-based server. By routing the communication through the proxy’s SSE endpoint, Cursor can seamlessly interact with servers that would otherwise be incompatible.

This approach works for any MCP server that you can run from the command line but can’t directly integrate with Cursor.

I have installed a cursor-server remotely and am accessing it from my PC to work.

I tried to use MCP in a local area network by writing a simple Python code using FastMCP. I spent more than two days trying to implement it but couldn’t find a solution.

Then I came across this information and asked AI about it, who suggested a similar method might work.

After testing, I confirmed that it works for me.

In a situation where many people report connection failures whether they configure with Docker on another server or not with Docker, and only submit bugs, I’m sharing information I obtained in a short time.

My error was related to registering an MCP Server in Cursor, which you might commonly search for as “Cursor MCP client closed error”.

One of the key points was that the file that needs to be registered had to be recorded in .cursor/mcp.json on the remote site.

The content is simply written as follows.
{
“authToken”: “”,
“mcpServers”: {
“calculator”: {
“url”: “http://192.168.214.20:7070/sse”,
“transport”: “sse”
}
}
}