Self-Hosting (Local)
Configuration
Environment variables that control the local Clean MCP server.
The local edition is configured entirely through environment variables — there's no config file to manage. Set them in the environment your MCP client launches the server in (or inline before the command).
Data locations
| Variable | Default | Controls |
|---|---|---|
CLEAN_REPOS_DIR | ~/.clean/repos | Where GitHub repos are cloned for indexing. |
CLEAN_DB_PATH | ~/.clean/metadata.db | The SQLite metadata store (which repos are indexed, their status). |
CLEAN_PERSIST_PATH | ~/.clean/index | The LanceDB vector store. |
Example — store the index on a different volume:
Embedding & indexing
| Variable | Default | Controls |
|---|---|---|
CLEAN_EMBEDDING_MODEL | all-MiniLM-L6-v2 | The sentence-transformer model used to embed code (384-dim). A smaller model means faster, cheaper indexing. |
CLEAN_SHOW_PROGRESS_BAR | false | Whether to show an embedding progress bar. |
Tooling
| Variable | Default | Controls |
|---|---|---|
CLEAN_DISABLE_INDEX_TOOL | unset | When set, hides the index_repo and delete_repo tools (used for benchmarks or read-only deployments). |
Setting these in your agent's MCP config keeps them scoped to Clean. For example, in .mcp.json you can add an "env" block alongside "command" and "args".
Worked example
A .mcp.json that pins a default repo and relocates the index: