I have some MCP servers defined in ~/.cursor/mcp.json on my local device. I’m connecting via SSH to a remote box and developing some code and running some agents on that box. Is there a way I can give these agents access to my local MCP servers?
I do not want to set up these MCP servers to run on the remote box because they require some credentials that I don’t want to copy to this box.
Hey, thanks for the question. Right now, when you connect over SSH, MCP servers run on the remote host. That means both the STDIO launch commands and any network requests happen from there.
A few options for your case:
Remote MCP server with a tunnel: run the MCP as an HTTP/SSE server locally, set up a tunnel (ngrok, cloudflared, or an SSH reverse tunnel), and point the URL in mcp.json on the remote to it. Your credentials stay local.
Switch to a local workspace: if you need access to those MCPs, you can temporarily open the project locally (no SSH).
OAuth for a remote MCP: some MCP servers support OAuth, and you can get the tokens locally.
The tunnel option is probably the easiest. The MCP server runs locally with your credentials, and remote Cursor calls it via the URL.