Connecting Local MCP (STDIO) servers remotely using Proxy

So for some time now I have been tinkering with, how can I use local MCP servers remotely? Think about the scenario where I want to utilize MCP against a specific machine in another network segment, such as for running commands in Bash/zsh/PowerShell or even local file operations. Many of these MCP servers use STDIO which means that they are not actually usable outside of the host they run on.

Such as some of these listed below, like filesystem, Windows-MCP, Read and Send iMessages. What about if we want to manage a server using MCP running local commands on it remotely? W

This is where a combination of Cloudflare Access + MCPJungle + Desktop Commander MCP comes in! and actually makes this possible. MCPJungel is a special type of MCPserver that acts as a Node.JS Bridge (similiar to a proxy) that can be used as a Remote MCP Proxy that can in turn use Local MCP Servers on the host that it is running on.

So in this example now, I am going to use a MCP client as Claude on my Windows machine, that will connect to a Remote MCP (MCPJungle machine) server trough Cloudflare Access which will in turn trigger Local MCP servers.

Firstly we need a machine that will run MCPJungle (which can be found here –> https://github.com/mcpjungle/MCPJungle) or on Mac using Brew

brew install mcpjungle/mcpjungle/mcpjungle

Now before we start the server component we also need to configure the local MCP server that it should use. This is done using a JSON configuration, in my example I want to utilize, Desktop Commander MCP

{
  "name": "desktop-commander",
 "transport": "stdio",
  "description": "filesystem mcp server",
  "command": "cmd",
  "args": ["/c","npx","-y", "@wonderwhy-er/desktop-commander@latest", "."]
}

Then I run the command mcpjungle.exe register -c .\jsonfile.json

After that I run the command mcpjungle.exe start

By default the server is available on port 8080 remotely. Which by default is not a good option since we want to expose it trough a secure option. That’s where Cloudflare Access comes in, where I installed the connector service (cloudflared) on the server where I have MCPJungle installed and configured the service on port 8080 to be publicly available on one of my domains

And also published behind a authentication policy which means that I need to authenticate to my Entra ID before I am allowed to use it.
Once this is in place I can then configure my VS Code Code to point to my published Remote Address in Cloudflare.

NOTE: MCPJungle append all tools and servers to be available trough the /mcp URL

So If I ask the VSCode agent for IPConfig it triggers the run command process trough the Remote MCP Server

I can also see on the MCPJungle console that it is bridging the commands

And that I get the information back from a local MCP Terminal script

And it is really good at running consecutive tasks. However if you have a script that runs over a long time and requires a lot of information back and forth it will easily time out. So do not think of this as a good solution to handle complex script tasks that you want to use directly from an AI assistant.

Leave a Reply

Scroll to Top