# =============================================================================
# Relace MCP Server - Environment Variables
# =============================================================================
# Copy this file to .env for local development.
# For MCP usage, set these in your mcp_config.json "env" section instead.
# =============================================================================
# Relace API Key (get yours at: https://app.relace.ai/settings/billing)
RELACE_API_KEY=rlc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Restrict file access to this directory (prevents path traversal attacks)
# Defaults to current working directory if not set
# MCP_BASE_DIR=/path/to/your/project
# Additional allowed paths (comma-separated, supports ~ expansion)
# These paths are accessible for read/write in addition to MCP_BASE_DIR.
# MCP_EXTRA_PATHS=~/dotfiles,~/.config/nvim
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------
# Local file logging (default: off)
# Options: off | safe | full (also accepts 1/true/yes as safe)
# MCP_LOGGING=off
# Log level for stderr output (default: WARNING)
# MCP_LOG_LEVEL=WARNING
# -----------------------------------------------------------------------------
# Feature Toggles
# -----------------------------------------------------------------------------
# Enable cloud tools: cloud_sync, cloud_search, cloud_list, cloud_info, cloud_clear
# RELACE_CLOUD_TOOLS=1
# Enable agentic_retrieval tool
# Requires RELACE_CLOUD_TOOLS=1 or a local backend (codanna/chunkhound)
# MCP_SEARCH_RETRIEVAL=1
# Retrieval backend (default: relace)
# Options: relace | codanna | chunkhound | none | auto
# MCP_RETRIEVAL_BACKEND=relace
# -----------------------------------------------------------------------------
# Apply API (fast_apply tool)
# -----------------------------------------------------------------------------
# Provider (default: relace; set to any label to use OpenAI-compatible endpoint)
# APPLY_PROVIDER=relace
# API key (required for non-relace providers; relace falls back to RELACE_API_KEY)
# APPLY_API_KEY=
# Endpoint (required for non-relace providers)
# APPLY_ENDPOINT=https://instantapply.endpoint.relace.run/v1/apply
# Model (default: auto)
# APPLY_MODEL=auto
# Timeout in seconds (default: 60)
# APPLY_TIMEOUT_SECONDS=60
# Temperature (default: 0.0, range: 0.0-2.0)
# APPLY_TEMPERATURE=0.0
# Semantic check after merge (default: disabled)
# APPLY_SEMANTIC_CHECK=1
# Override apply prompt YAML (developer/debug)
# APPLY_PROMPT_FILE=/path/to/apply_openai.yaml
# -----------------------------------------------------------------------------
# Search API (agentic_search tool)
# -----------------------------------------------------------------------------
# Provider (default: relace; set to any label to use OpenAI-compatible endpoint)
# SEARCH_PROVIDER=relace
# API key (required for non-relace providers; relace falls back to RELACE_API_KEY)
# SEARCH_API_KEY=
# Endpoint (required for non-relace providers)
# SEARCH_ENDPOINT=https://search.endpoint.relace.run/v1/search
# Model (default: relace-search)
# SEARCH_MODEL=relace-search
# Timeout in seconds (default: 120)
# SEARCH_TIMEOUT_SECONDS=120
# Temperature (default: 1.0, range: 0.0-2.0)
# SEARCH_TEMPERATURE=1.0
# Max agent turns (default: 6)
# SEARCH_MAX_TURNS=6
# Parallel tool calls per turn (default: enabled)
# SEARCH_PARALLEL_TOOL_CALLS=1
# Tool allowlist (comma/space separated; report_back always enabled, bash requires opt-in)
# SEARCH_ENABLED_TOOLS=view_file,view_directory,grep_search,glob
# Include `strict` field in tool schemas (default: 1; set 0 if endpoint rejects it)
# SEARCH_TOOL_STRICT=1
# Nucleus sampling (optional; some providers like Mistral require top_p=1)
# SEARCH_TOP_P=1
# Override search prompt YAML (developer/debug)
# SEARCH_PROMPT_FILE=/path/to/search.yaml
# --- LSP (find_symbol tool within agentic_search) ---
# LSP tools mode: false (default) | true | auto
# SEARCH_LSP_TOOLS=false
# LSP timeout in seconds (default: 15)
# SEARCH_LSP_TIMEOUT_SECONDS=15
# Max concurrent LSP clients (default: 2)
# SEARCH_LSP_MAX_CLIENTS=2
# -----------------------------------------------------------------------------
# Agentic Retrieval
# -----------------------------------------------------------------------------
# Auto-sync before retrieval (default: enabled when cloud tools are on)
# RELACE_AGENTIC_AUTO_SYNC=1
# Override retrieval prompt YAML (developer/debug)
# RETRIEVAL_PROMPT_FILE=/path/to/retrieval_relace.yaml
# -----------------------------------------------------------------------------
# Cloud / Repo Sync (cloud_* tools)
# -----------------------------------------------------------------------------
# Relace Repos API endpoint (default: https://api.relace.run/v1)
# RELACE_API_ENDPOINT=https://api.relace.run/v1
# Pre-configured Repo ID (skip list/create)
# RELACE_REPO_ID=
# Sync timeout in seconds (default: 300)
# RELACE_REPO_SYNC_TIMEOUT=300
# Max files per sync (default: 5000)
# RELACE_REPO_SYNC_MAX_FILES=5000
# Concurrent upload workers (default: 8)
# RELACE_UPLOAD_MAX_WORKERS=8
# -----------------------------------------------------------------------------
# Miscellaneous
# -----------------------------------------------------------------------------
# Project default encoding (e.g., gbk, big5, shift_jis; auto-detected if unset)
# RELACE_DEFAULT_ENCODING=
# Custom .env file path (default: auto-discover from current directory)
# MCP_DOTENV_PATH=/path/to/.env