leanmcp create <name> # Create a new projectleanmcp add <service> # Add a service to existing projectleanmcp dev # Start development server with hot-reloadleanmcp build # Build for productionleanmcp start # Start production server# Cloud commandsleanmcp login # Authenticate with LeanMCP Cloudleanmcp logout # Remove API keyleanmcp whoami # Show login statusleanmcp deploy <folder> # Deploy to LeanMCP Cloudleanmcp projects list # List your cloud projectsleanmcp projects get <id> # Get project detailsleanmcp projects delete <id> # Delete a project# Environment variablesleanmcp env list # List environment variablesleanmcp env set KEY=val # Set environment variableleanmcp env get KEY # Get environment variableleanmcp env remove KEY # Remove environment variableleanmcp env pull # Pull to .env fileleanmcp env push # Push from .env file
my-mcp-server/├── main.ts # Entry point with HTTP server├── package.json # Dependencies and scripts├── tsconfig.json # TypeScript configuration└── mcp/ # Services directory └── example.ts # Example service with tools
Automatically rebuilds UI components when modified
Hot-reloads when adding/removing @UIApp decorators
$ leanmcp devLeanMCP Development Serverℹ Found 2 @UIApp component(s)ℹ UI components builtStarting development server...[HTTP][INFO] Server running on http://localhost:3001[HTTP][INFO] MCP endpoint: http://localhost:3001/mcp
$ leanmcp loginLeanMCP LoginTo authenticate, you need an API key from LeanMCP.Steps: 1. Go to: https://leanmcp.com/api-keys 2. Create a new API key with "BUILD_AND_DEPLOY" scope 3. Copy the API key and paste it below? Enter your API key: airtrain_xxxxx...✔ API key validated and savedLogin successful! Config saved to: ~/.leanmcp/config.json
# List all projectsleanmcp projects list# Get project detailsleanmcp projects get <project-id># Delete a projectleanmcp projects delete <project-id>leanmcp projects delete <project-id> --force # Skip confirmation
Manage environment variables on your deployed Lambda functions:
# List environment variablesleanmcp env listleanmcp env list --reveal # Show actual values# Set variablesleanmcp env set API_KEY=sk-123 DEBUG=true# Get a specific variableleanmcp env get API_KEY --reveal# Remove a variableleanmcp env remove OLD_KEY# Pull to local .env fileleanmcp env pull# Push from local .env fileleanmcp env pushleanmcp env push --replace # Replace all variables
Changes to environment variables are applied immediately and will take effect after a cold start. See the Environment Variables guide for detailed documentation.
npm run dev # Start with hot reload (tsx watch)npm run build # Build for productionnpm run start # Run production buildnpm run clean # Remove build artifacts