Overview
LeanMCP provides three essential commands for your development workflow:leanmcp dev- Development server with hot-reloadleanmcp build- Production buildleanmcp start- Build and run production server
leanmcp dev
Start the development server with hot-reload and UI component building.What It Does
Terminal Output
Hot-Reload Behavior
When you modify a file:@UIApp:
@UIApp:
Testing Your Server
Stopping the Dev Server
PressCtrl+C to stop the server gracefully.
leanmcp build
Build UI components and compile TypeScript for production.What It Does
Terminal Output
Output Directory Structure
When to Use Build
- Before deploying to production
- To verify TypeScript compilation
- To test production builds locally
- For CI/CD pipelines
leanmcp start
Build and start the production server in one command.What It Does
Terminal Output
Production vs Development
| Feature | leanmcp dev | leanmcp start |
|---|---|---|
| TypeScript compilation | tsx watch (hot-reload) | tsc (compiled) |
| UI component builds | Development mode | Production mode (minified) |
| File watching | ✓ Yes | ✗ No |
| Performance | Slower (watch overhead) | Faster (compiled) |
| Use case | Local development | Production/testing |
Stopping the Server
PressCtrl+C:
NPM Script Aliases
Yourpackage.json includes convenient aliases:
package.json
Common Workflows
Local Development
Test Production Build Locally
CI/CD Pipeline
.github/workflows/deploy.yml
Troubleshooting
Port Already in Use
.env:
.env
TypeScript Compilation Errors
dev or build.
UI Component Build Failures
Module Not Found
Environment Variables
Common Configuration
.env
Loading Environment Variables
main.ts
Next Steps
Deploy to Cloud
Deploy your server to LeanMCP Cloud
Environment Variables
Manage secrets and configuration
Monitoring
Monitor your deployed server
UI Components
Build interactive UI components