Skip to main content

Global Configuration

The LeanMCP CLI stores configuration in ~/.leanmcp/config.json.

Config File Location

path
string
~/.leanmcp/config.json on Unix-like systemsC:\Users\<username>\.leanmcp\config.json on Windows

Configuration Schema

apiKey
string
Your LeanMCP API key (set via leanmcp login)
apiUrl
string
API endpoint URL. Defaults to https://api.leanmcp.comAllowed values:
  • https://api.leanmcp.com (production)
  • https://devapi.leanmcp.com (development)
  • https://qaapi.leanmcp.com (QA)
  • http://localhost:3001 (local testing)
lastUpdated
string
ISO timestamp of last configuration update

Project Configuration

Each deployed project has a local configuration file at .leanmcp/config.json in the project directory.

Project Config Schema

projectId
string
required
Unique project identifier from LeanMCP cloud
projectName
string
required
Human-readable project name
subdomain
string
required
Deployment subdomain (e.g., ‘my-app’ for my-app.leanmcp.app)
url
string
required
Full deployment URL (e.g., https://my-app.leanmcp.app)
lastDeployedAt
string
required
ISO timestamp of last deployment
buildId
string
ID of the last successful build
deploymentId
string
ID of the current active deployment

Example

.leanmcp/config.json
{
  "projectId": "proj_abc123def456",
  "projectName": "my-mcp-server",
  "subdomain": "my-app",
  "url": "https://my-app.leanmcp.app",
  "lastDeployedAt": "2026-03-03T10:30:00.000Z",
  "buildId": "build_xyz789",
  "deploymentId": "deploy_qrs012"
}

Environment Variables

The CLI respects the following environment variables:

Authentication

LEANMCP_API_KEY
string
Override API key from config file (not recommended for production)

AWS Cognito (if using Cognito auth)

AWS_REGION
string
AWS region for Cognito
COGNITO_USER_POOL_ID
string
Cognito User Pool ID
COGNITO_CLIENT_ID
string
Cognito App Client ID
COGNITO_CLIENT_SECRET
string
Cognito App Client Secret (if using client credentials)

Auth0 (if using Auth0 auth)

AUTH0_DOMAIN
string
Auth0 domain (e.g., ‘your-tenant.auth0.com’)
AUTH0_CLIENT_ID
string
Auth0 application client ID
AUTH0_CLIENT_SECRET
string
Auth0 application client secret
AUTH0_AUDIENCE
string
Auth0 API audience

Clerk (if using Clerk auth)

CLERK_FRONTEND_API
string
Clerk frontend API domain
CLERK_SECRET_KEY
string
Clerk secret key

TypeScript Configuration

The CLI generates projects with the following recommended tsconfig.json:
tsconfig.json
{
  "compilerOptions": {
    "module": "ESNext",
    "target": "ES2022",
    "moduleResolution": "Bundler",
    "esModuleInterop": true,
    "strict": true,
    "skipLibCheck": true,
    "outDir": "dist",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  },
  "include": ["**/*.ts"],
  "exclude": ["node_modules", "dist"]
}
The experimentalDecorators and emitDecoratorMetadata options are required for using @Tool, @Authenticated, @Elicitation, and other decorators.

Package.json Scripts

Generated projects include these npm scripts:
package.json
{
  "scripts": {
    "dev": "leanmcp dev",
    "build": "leanmcp build",
    "start": "leanmcp start",
    "inspect": "npx @modelcontextprotocol/inspector node dist/main.js",
    "start:node": "node dist/main.js",
    "clean": "rm -rf dist"
  }
}

Build docs developers (and LLMs) love