This guide covers the required environment variables, API keys, and configuration needed to run protoLabs Studio locally or in production.
Before setting up protoLabs Studio, ensure you have:
- Node.js 22.x or later
- npm 10.x or later
- Git 2.x or later
- Anthropic API key (for Claude models)
- GitHub account (for repository operations)
- Discord bot (optional, for Discord integration)
protoLabs Studio uses environment variables for configuration. Create a .env file in the project root:
cp .env.example .envVariable: ANTHROPIC_API_KEY
Description: Anthropic API key for Claude models
How to get: https://console.anthropic.com/settings/keys
ANTHROPIC_API_KEY=sk-ant-api03-...Alternative: Use Claude Code CLI authentication:
claude auth login
# No need to set ANTHROPIC_API_KEY if using CLI authVariables: HOST, HOSTNAME, PORT
Description: Server binding and user-facing URLs
Defaults: HOST=0.0.0.0, HOSTNAME=localhost, PORT=3008
# Development
HOST=0.0.0.0
HOSTNAME=localhost
PORT=3008
# Production
HOST=0.0.0.0
HOSTNAME=protolabs.example.com
PORT=3008Note: HOST is the binding address (use 0.0.0.0 for all interfaces), while HOSTNAME is used in generated URLs.
Variable: VITE_HOSTNAME
Description: Hostname for frontend API URLs
Default: localhost
# Development
VITE_HOSTNAME=localhost
# Production
VITE_HOSTNAME=protolabs.example.comVariable: DATA_DIR
Description: Data storage directory for settings, credentials, and sessions
Default: ./data
DATA_DIR=./dataDirectory structure:
data/
├── settings.json # Global settings
├── credentials.json # API keys
├── sessions-metadata.json # Chat sessions
└── agent-sessions/ # Conversation histories
Variable: ALLOWED_ROOT_DIRECTORY
Description: Restrict file operations to specific directory (security feature)
Default: None (no restriction)
# Restrict to specific directory
ALLOWED_ROOT_DIRECTORY=/home/user/projectsVariable: GITHUB_TOKEN
Description: GitHub personal access token for repository operations
How to get: https://github.com/settings/tokens/new
Required scopes:
repo- Full control of private repositoriesread:org- Read org and team membership (if using organizations)
GITHUB_TOKEN=ghp_...Variables: GITHUB_REPO_OWNER, GITHUB_REPO_NAME
Description: Default GitHub repository for operations
GITHUB_REPO_OWNER=my-org
GITHUB_REPO_NAME=my-projectVariables: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY
Description: Langfuse API keys for observability and tracing
How to get: https://cloud.langfuse.com/settings
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...Variable: LANGFUSE_BASE_URL
Description: Langfuse API URL
Default: https://cloud.langfuse.com
# Cloud (default)
LANGFUSE_BASE_URL=https://cloud.langfuse.com
# Self-hosted
LANGFUSE_BASE_URL=https://langfuse.example.comVariable: DISCORD_TOKEN
Description: Discord bot token for event routing and notifications
How to get: https://discord.com/developers/applications
Required bot permissions:
- Send Messages
- Read Message History
- Add Reactions
- Embed Links
DISCORD_TOKEN=MTIzNDU2Nzg5MDEyMzQ1Njc4OQ...Variable: DISCORD_GUILD_ID
Description: Discord server (guild) ID
DISCORD_GUILD_ID=1234567890123456789Variables: Channel IDs for specific purposes
DISCORD_CHANNEL_SUGGESTIONS=1234567890123456789
DISCORD_CHANNEL_PROJECT_PLANNING=1234567890123456789
DISCORD_CHANNEL_AGENT_LOGS=1234567890123456789
DISCORD_CHANNEL_CODE_REVIEW=1234567890123456789
DISCORD_CHANNEL_INFRA=1234567890123456789How to get channel IDs:
- Enable Developer Mode in Discord (User Settings → Advanced)
- Right-click channel → Copy ID
Variable: AUTOMAKER_MOCK_AGENT
Description: Enable mock agent mode for CI testing (no real API calls)
Default: false
# Enable for CI/testing
AUTOMAKER_MOCK_AGENT=trueVariable: AUTOMAKER_AUTO_LOGIN
Description: Skip login prompt in development
Default: false (disabled in production)
# Enable for development
AUTOMAKER_AUTO_LOGIN=trueSecurity: This is automatically disabled when NODE_ENV=production.
File: data/settings.json
{
"defaultModel": "sonnet",
"mcpServers": {
"automaker": {
"command": "node",
"args": ["./packages/mcp-server/dist/index.js"],
"env": {
"AUTOMAKER_API_KEY": "..."
}
}
}
}File: .automaker/settings.json (per-project)
{
"projectPath": "/path/to/project",
"defaultModel": "sonnet",
"complexityThresholds": {
"small": "haiku",
"medium": "sonnet",
"large": "sonnet",
"architectural": "opus"
}
}npm installnpm run build:packages# Copy example env file
cp .env.example .env
# Add your Anthropic API key
echo "ANTHROPIC_API_KEY=sk-ant-api03-YOUR_KEY_HERE" >> .env# Interactive launcher
npm run dev
# Or start web directly
npm run dev:webVisit http://localhost:3007 to access the UI.
Add to .gitignore:
.env
.env.*
data/credentials.json
data/settings.json
.env.development
.env.production
.env.test- Rotate API keys every 90 days
- Rotate GitHub tokens annually
- Use scoped tokens with minimal permissions
Use ALLOWED_ROOT_DIRECTORY to limit file operations:
ALLOWED_ROOT_DIRECTORY=/home/automaker/projectsIssue: ANTHROPIC_API_KEY is missing or invalid.
Solution: Verify API key is set:
echo $ANTHROPIC_API_KEY
# Should print your API keyIssue: Port 3008 is already bound.
Solution: Change port or kill existing process:
# Change port
export PORT=3009
# Or kill existing process
lsof -ti:3008 | xargs killIssue: Frontend can't reach backend.
Solution: Verify VITE_HOSTNAME matches your backend hostname:
# For local development
VITE_HOSTNAME=localhost- Monorepo Architecture - Package structure
- Git Workflow - Branch strategies
- MCP Tools Reference - MCP server configuration
- Self-Hosting - Production deployment guide