CleanClean
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

VariableDefaultControls
CLEAN_REPOS_DIR~/.clean/reposWhere GitHub repos are cloned for indexing.
CLEAN_DB_PATH~/.clean/metadata.dbThe SQLite metadata store (which repos are indexed, their status).
CLEAN_PERSIST_PATH~/.clean/indexThe LanceDB vector store.

Example — store the index on a different volume:

CLEAN_PERSIST_PATH=/data/clean/index python -m clean.local.mcp_server

Embedding & indexing

VariableDefaultControls
CLEAN_EMBEDDING_MODELall-MiniLM-L6-v2The sentence-transformer model used to embed code (384-dim). A smaller model means faster, cheaper indexing.
CLEAN_SHOW_PROGRESS_BARfalseWhether to show an embedding progress bar.

Tooling

VariableDefaultControls
CLEAN_DISABLE_INDEX_TOOLunsetWhen 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:

{
  "mcpServers": {
    "clean": {
      "command": "python",
      "args": ["-m", "clean.local.mcp_server", "--repo", "facebook/react"],
      "env": {
        "CLEAN_PERSIST_PATH": "/data/clean/index"
      }
    }
  }
}

On this page