Get an API key from the CLI

What you'll have · ~2 min

A free API key minted from your terminal in under a minute, stored locally at ~/.mcpindex/credentials.json, with a clear picture of what the login flow does and does not store.

The gate works with no account. An API key only matters if you opt into cloud tiers or higher rate limits. If that is not you, you can skip this. If it is, here is the whole flow.

  1. 01

    Run the login command#

    The login command ships with the npm SDK, not the Python gate. Run it with npx (no install needed):

    Mint a free API key

    GitHub by default; add --provider google for Google. Installed the SDK globally? Run: mcpindex login

    npx @mcp-index/sdk login
  2. 02

    Sign in in the browser#

    Your terminal prints Opening your browser to sign in: with a URL (paste it yourself if the browser does not open). The browser opens to GitHub, or Google if you passed --provider google. After you authorize, the page shows Signed in. You can close this tab and return to your terminal. The key is handed back to the CLI over a loopback callback bound to 127.0.0.1 with a one-time nonce, so nothing but your own CLI can receive it. The flow times out after 180 seconds if you do not finish.

  3. 03

    Where the key lives#

    Back in the terminal you see Signed in. Your mcpindex key is stored. The key itself is never printed. It is written to ~/.mcpindex/credentials.json with 0600 permissions. Check your status anytime with mcpindex whoami, which shows the key's path but never the key.

    Not seeing this?

    No browser (a remote or headless box)? The command prints the sign-in URL, open it on any machine and complete the flow, since the callback returns to the loopback port the CLI opened. Google not working? That provider must be configured server-side; GitHub is the default.

  4. 04

    What login stores about you#

    Identity is stored server-side as a one-way hash of the provider and subject, never your email or any other personal detail. The key is a free-tier key; it raises your rate limits and unlocks opt-in cloud tiers, and the gate itself keeps working locally with or without it.

NextRead the public drift ledger
Questions
Where does mcpindex store my API key after login?
In ~/.mcpindex/credentials.json with 0600 file permissions. The key is never printed to your terminal; the login flow only confirms 'Your mcpindex key is stored.' Run mcpindex whoami to see the key's path (not the key itself).
Do I need an account to use the mcpindex gate?
No. The gate installs and runs locally with no account. An API key from mcpindex login only matters if you opt into higher rate limits or cloud tiers. Login stores a one-way identity hash, never your email.