You can easily decoulple your MCP servers from your MCP clients with the existing stdio <-> tcp tool, such as ncat (which is part of the nmap tool). Without any code changes to the existsing MCP servers available, you can serve them on a TCP port. For example, this is how I run the filesystem MCP server
ncat -lkp 7002 -e "/usr/local/bin/npx -y @modelcontextprotocol/server-filesystem /tmp"
On the mcp client side (such as Claude desktop or Cline), you would simply run another ncat as client to connect to the server
ncat 127.0.0.1 7002
That’s all. now you are serving MCP server over the network. Of course you can run multiple MCP servers on different ports.
on MacOS, you can install nmap with brew: brew install nmap
No comments:
Post a Comment