Install
Use Go 1.25 or newer and a private working directory. Download recover-image.go, go.mod and go.sum into that directory. Resolve and verify the normal declared dependencies:encoding/json compatibility implementation. You may see a compatibility warning on stderr. No custom build tags, linker flags or dependency patches are needed.
Run the recovery example
Provide your Magic Hour API key through the process environment and pass an image project ID you already saved:https://mcp.magichour.ai/. The native session’s Headers configuration sends the Bearer credential to this fixed first-party endpoint. Redirects are rejected. The key is not part of tool arguments or printed output.
The program uses officialmcp.GetTools for discovery, selects account_retrieve and image_projects_retrieve_details, and invokes each through Eino’s tool.InvokableTool interface. It checks account ID/credit types without printing their values. The saved project’s returned ID must match the requested ID, and its status must be a string.
An example output shape is:
Verification scope
The exact example was built and run with Go 1.27.3 on Linux/arm64, Eino 0.9.22, officialmcp 0.1.1 and the official MCP Go SDK 1.6.1. On October 24, 2026, the native adapter discovered 48 tools, invoked account retrieval and saved-image retrieval once each, verified account field types, and returned the same saved project ID withcomplete status. The underlying HTTP retry count was not instrumented.
The program exited successfully after its native session closed. Output contained only the safe result above; stderr contained the stock Sonic compatibility warning. No key, private account values or download URLs were printed. The child process and private runtime directory were removed after validation.
This verifies direct native Eino tool invocation. An Agent, model-driven conversation, new generation and media download were not run.