Overview
ntcli uses environment variables to configure various aspects of its behavior, from API endpoints to authentication settings. Most variables have sensible defaults and are managed automatically.Authentication Variables
OAuth Configuration (Optional)
These variables are automatically configured for the production environment and rarely need to be modified:Clerk OAuth client ID for authenticationDefault: Automatically configured for production
When to modify: Custom Clerk environment only (advanced use cases)
When to modify: Custom Clerk environment only (advanced use cases)
Clerk domain for OAuth authenticationDefault: Automatically configured for production
When to modify: Custom Clerk environment only (advanced use cases)
When to modify: Custom Clerk environment only (advanced use cases)
API Configuration
Dual-Domain Architecture
NimbleTools uses a dual-domain architecture separating management operations from MCP runtime operations:Management API endpoint for workspaces, tokens, secrets, and server managementDefault:
Purpose: Workspace operations, token management, server deployment
https://api.nimbletools.dev
Purpose: Workspace operations, token management, server deployment
MCP Runtime endpoint for MCP protocol operationsDefault:
Purpose: MCP tool calls, server communication
https://mcp.nimbletools.dev
Purpose: MCP tool calls, server communication
Default port for OAuth callback serverDefault:
Range:
41247
Range:
1024-65535
(unprivileged ports)Debug and Development
Enable detailed HTTP debugging outputDefault:
Values:
false
Values:
1
, true
, yes
(to enable)Node.js environment settingDefault:
Values:
production
Values:
development
, staging
, production
Disable TLS certificate validation (development only)Default:
Values:
Use case: Local development with self-signed certificates
1
(enabled)Values:
0
(disable validation), 1
(enable validation)Use case: Local development with self-signed certificates
Usage Examples
Development Environment
Set up ntcli for local development:CI/CD Environment
Configure ntcli for automated deployments:Corporate/Enterprise
Configure for enterprise deployments:Setting Environment Variables
Temporary (Current Session)
Persistent (Shell Profile)
Add to
~/.bashrc
or ~/.bash_profile
:Using .env Files
Create a.env
file in your project directory:
Environment Variable Precedence
Variables are resolved in the following order (highest to lowest priority):- Command-line flags (e.g.,
--port 3000
) - Environment variables (e.g.,
NTCLI_DEFAULT_PORT=3000
) - Configuration files (future feature)
- Built-in defaults
Example Priority Resolution
Debug Output Control
Enable Debug Mode
- HTTP request/response details
- Authentication flow steps
- API endpoint resolutions
- Token exchange information
- Error stack traces
Debug Output Example
Validation and Troubleshooting
Check Current Configuration
Test Configuration
Common Issues
API endpoint not reachable
API endpoint not reachable
Symptoms: Connection timeout, DNS resolution errorsCheck:Solution: Verify the API URLs are correct and accessible
OAuth callback port in use
OAuth callback port in use
Symptoms: “Port already in use” error during loginCheck:Solution: Use a different port or stop the conflicting process
Authentication failures
Authentication failures
Symptoms: OAuth errors, invalid client IDCheck:Solution: Reset OAuth variables or contact support
Security Considerations
Sensitive Variables
Some environment variables contain sensitive information:Variable | Sensitivity | Recommendation |
---|---|---|
CLERK_OAUTH_CLIENT_ID | Medium | Don’t share publicly |
CLERK_DOMAIN | Low | Safe to share |
NTCLI_MANAGEMENT_API_URL | Low | Safe to share |
NTCLI_MCP_API_URL | Low | Safe to share |
NTCLI_DEBUG | Low | Disable in production |
Best Practices
Development
Use separate OAuth clients and API endpoints for development
Production
Disable debug mode and use production OAuth settings
CI/CD
Store sensitive variables in secure CI/CD secret management
Teams
Document environment setup in team onboarding guides