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

mcli auth login --api-key <your-api-key>
Example:
mcli auth login --api-key airtrain_1234567890abcdef...

Verify Authentication

Check if you’re logged in:
mcli auth status

Logout

Remove stored credentials:
mcli auth logout

Credential Storage

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

Troubleshooting

Authentication Failed

 Authentication failed
Your API key is invalid or has expired.
Please run: mcli auth login --api-key <your-key>
Solutions:
  • Verify your API key is correct
  • Check if the API key has expired
  • Ensure the API key has proper permissions

Access Denied

 Access denied
Your API key doesn't have permission to [action].
Solutions:
  • Check API key scopes in the dashboard
  • Create a new API key with required permissions

Next Steps

Project Management

Start creating and managing MCP projects