flycasting your mcp's

This now is possible with Release v0.3.114 · superfly/flyctl · GitHub

Start with the same Dockerfile as before:

FROM node:slim
COPY --from=flyio/flyctl flyctl /usr/bin
EXPOSE 8080
VOLUME /data
CMD [ "/usr/bin/flyctl", "mcp", "wrap", "--mcp=npx", "--", \
  "-f", "@modelcontextprotocol/server-filesystem", "/data/" ]

When you run fly lauch, add the --flycast parameter:

fly launch --flycast

This will ensure that your application isn’t accessible to the public internet. To access it, use flly mcp proxy as before, but reference the .flycast address:

{
  "mcpServers": {
    "filesystem": {
      "command": "/Users/rubys/.fly/bin/flyctl",
      "args": [
         "mcp",
         "proxy",
-        "--url=https://mcp.fly.dev/"
+        "--url=http://mcp.flycast:8080/"
       ]
    }
  }
}

Notes:

  • http instead of https
  • mcp.flycast instead of mcp.fly.dev (substitute your appname here)
  • port 8080 you are directly accessing the app

That’s it! You can still add --user and --password if you wish; but only people with access to your private network will be able to access your mcp.

2 Likes