SYSTEM Cited by 1 source
flymcp¶
flymcp (github.com/superfly/flymcp)
is Fly.io's "most basic" MCP
server for flyctl. Thomas Ptacek's
stated design brief: "the most basic MCP server for flyctl I
could think of … it took 30 minutes." (Source:
sources/2025-04-10-flyio-30-minutes-with-mcp-and-flyctl.)
Shape¶
- ~90 lines of Go, using mark3labs/mcp-go for the MCP protocol plumbing.
- Two tools registered:
fly logsandfly status. - MCP
stdiotransport — the MCP client (Claude Desktop, Claude Code, Cursor, …) launchesflymcpas a subprocess; tool calls round-trip as JSON blobs on stdin/stdout. - Per-call subprocess — each tool invocation shells out to
the real
flyctlbinary with--jsonand returns captured stdout verbatim. - Inherits the operator's
flyctlcredentials — whatever's already in theflyctlauth state becomes the auth boundary. No separate MCP-side login.
Canonical wiki instance of patterns/wrap-cli-as-mcp-server.
Why 90 LoC was enough¶
Three preconditions converge:
- mark3labs/mcp-go handles the MCP protocol (tool registration, stdio framing, request/response routing). The author writes tool handlers, not protocol code.
flyctl --jsonwas already done — a 2020 Fly.io design decision ("to make them easier to drive from automation") that made structured output a no-op in 2025. See concepts/structured-output-reliability.- Two read-only tools is enough to reproduce an experienced SRE's incident-diagnosis flow against a Fly- hosted app. Fewer tools = more accurate tool selection = smaller context footprint (patterns/tool-surface-minimization).
Canonical usage — unpkg incident diagnosis¶
Pointed at unpkg (the npm package
registry's CDN, running on Fly), Claude produced without further
prompting: 10-Machine global topology (11 regions named),
criticality classification of 2 non-healthy machines,
oom_killed: true event correlation. On the follow-up prompt
"try getting logs for one of the critical machines" it
extracted the kernel OOM line + per-second incident timeline:
OOM kill → SIGKILL → reboot → health-check fail → listener up
→ health-check pass, ~43 seconds end-to-end. Memory
diagnosis: Bun at ~3.7 GB of 4 GB allocated. Ptacek's read:
"annoyingly useful … faster than I find problems in apps."
See concepts/agentic-troubleshooting-loop for the planner- executor loop shape.
Security posture¶
Ptacek's own caveat on the local-MCP-server shape:
"Local MCP servers are scary. I don't like that I'm giving a Claude instance in the cloud the ability to run a native program on my machine. I think
fly logsandfly statusare safe, but I'd rather know it's safe. It would be, if I was runningflyctlin an isolated environment and not on my local machine."
Canonical wiki datum on concepts/local-mcp-server-risk; the
natural mitigation is patterns/disposable-vm-for-agentic-loop
— run flymcp + flyctl inside a throwaway Fly Machine rather
than on the operator's laptop.
Seen in¶
- sources/2025-04-10-flyio-30-minutes-with-mcp-and-flyctl — the original blog post / internal-message-turned-public writeup.
Related¶
- systems/fly-flyctl — the CLI being wrapped.
- systems/model-context-protocol — the protocol.
- systems/claude-code — example MCP client.
- patterns/wrap-cli-as-mcp-server — the pattern flymcp instantiates.
- concepts/structured-output-reliability — what
--jsonmode buys. - concepts/local-mcp-server-risk — the security concern flymcp acknowledges but does not solve.
- concepts/agentic-troubleshooting-loop — the usage pattern.
- companies/flyio.