API keys, tokens, and environment setup for the Kun engine

Secrets & Environment

Secrets needed for the Kun engine's MCP servers and Anthropic products.

Required Secrets

SecretPurposeUsed By
ANTHROPIC_API_KEYClaude Code + Agent SDKCore engine
GITHUB_TOKENGitHub MCP, repos, PRsgithub MCP
VERCEL_TOKENDeployment automationvercel MCP
SLACK_BOT_TOKENSlack messagingslack MCP
SLACK_WORKSPACE_IDSlack workspace targetslack MCP

Setup Process

1. Request Access

Contact your team admin to request the following:

# You'll receive these credentials
ANTHROPIC_API_KEY=sk-ant-***
GITHUB_TOKEN=ghp_***
VERCEL_TOKEN=***

2. Configure Claude Code

Add your Anthropic API key to Claude Code:

# Set the API key
export ANTHROPIC_API_KEY="your-key-here"
 
# Or add to your shell profile (~/.zshrc or ~/.bashrc)
echo 'export ANTHROPIC_API_KEY="your-key-here"' >> ~/.zshrc

3. Configure GitHub

Authenticate with GitHub CLI:

# Login with your token
gh auth login --with-token < token.txt
 
# Or interactively
gh auth login

4. Configure Vercel (Optional)

For deployment access:

# Login to Vercel
vercel login
 
# Or use token
vercel --token YOUR_TOKEN

Project-Specific Environment Variables

Each project may have its own .env file requirements. Check the project's README or ask the team for:

  • Database connection strings
  • Third-party API keys
  • Feature flags
  • Service URLs

Example .env Structure

# Database
DATABASE_URL="postgresql://..."
 
# Auth
NEXTAUTH_SECRET="..."
NEXTAUTH_URL="http://localhost:3000"
 
# APIs
STRIPE_SECRET_KEY="sk_..."
RESEND_API_KEY="re_..."

Security Guidelines

  1. Never commit secrets to git repositories
  2. Use .env.local for local development (already in .gitignore)
  3. Rotate keys if you suspect they've been compromised
  4. Use environment variables instead of hardcoding values

Requesting New Secrets

If you need access to a new service:

  1. Open an issue in the project repository
  2. Describe what access you need and why
  3. Admin will provision and share securely

Troubleshooting

Claude Code Not Authenticating

# Verify key is set
echo $ANTHROPIC_API_KEY
 
# Test connection
claude --version

GitHub Permission Denied

# Check auth status
gh auth status
 
# Re-authenticate if needed
gh auth login

Vercel Deployment Fails

# Check login status
vercel whoami
 
# Link project if needed
vercel link