Authentication

One browser login covers everything. The session is captured once and both tool layers use it from then on.

Why the browser #

The Minehut dashboard sits behind Cloudflare, and its session system has changed several times over the years. A real browser login solves the challenges that come with that, in the same way a human opening the panel would. The captured session then powers the fast API tools.

The login flow #

  1. Ask your AI to call browser_login_panel with your Minehut email and password.
  2. A browser opens the dashboard and fills the login form automatically.
  3. A Cloudflare challenge or 2FA prompt may appear. Call browser_wait_manual so you can finish it by hand.
  4. The session token is captured and stored in ~/.minehut-mcp/session.json with file permissions 600.
  5. All minehut_* API tools become active. The browser stays available for anything the API does not cover.
Visible window first. Set MINEHUT_HEADLESS=0 in the client config for the first login. Cloudflare challenges are easier to solve when you can see the window.

What gets stored #

PathContents
~/.minehut-mcp/session.json Captured token and session id, permissions 600
~/.minehut-mcp/browser-profile Persistent browser profile holding the dashboard cookies, so later starts stay logged in
~/.minehut-mcp/shot-*.png Screenshots taken with browser_screenshot

Without the browser #

The API layer also accepts a session set directly through environment variables:

export MINEHUT_TOKEN="your-token"
export MINEHUT_SESSION_ID="your-session-id"

Tokens found in the dashboard's localStorage under keys such as minehut_auth_token and minehut_session_id are picked up automatically by browser_wait_manual and by the login flow.

When the session expires #

Minehut sessions expire on login, logout or long inactivity. Rejected sessions return a clear error from the API tools that tells the AI to re-run browser_login_panel. The stored browser profile usually makes the next login a single click, because Cloudflare already trusts the cookies.

Treat the token like a password. Anyone with the file contents can control your Minehut account. Do not paste credentials or tokens into public chats, logs or issues.