Skip to main content

CLI Authentication

Authenticate the LeanMCP CLI with your API key to access your projects and deployments.

Get Your API Key

  1. Go to LeanMCP Dashboard
  2. Navigate to SettingsAPI Keys
  3. Create a new API key with appropriate permissions
  4. Copy the API key (starts with airtrain_)

Login Command

The CLI will prompt you interactively for your API key:

Verify Authentication

Check if you’re logged in:
Example Output:

Logout

Remove stored credentials:
Example Output:

Credential Storage

The CLI stores your credentials securely in:
  • macOS/Linux: ~/.leanmcp/config.json
Keep your API key secure. Do not share it or commit it to version control.

Troubleshooting

Not Authenticated

Solutions:
  • Run leanmcp login and enter your API key
  • Verify your API key is correct

API Key Invalid

Solutions:
  • Verify your API key is correct
  • Check if the API key has expired
  • Create a new API key in the dashboard

Next Steps

Project Management

Start creating and managing MCP projects