CleanClean
API Reference

API Overview

REST API and MCP interface for Clean.

Clean exposes two interfaces:

  • REST API — HTTP endpoints for indexing, searching, and managing repos
  • MCP server — Model Context Protocol interface used by AI agents

Both are served from the same process on port 8000 by default.

Base URL

http://localhost:8000

Authentication

All requests require a Bearer token:

Authorization: Bearer YOUR_API_KEY

Your API key (clean_sk_...) is available in the dashboard under API Keys.

Response formats

FormatHeader / paramNotes
TOON (default)Compact tabular, 30–40% fewer tokens
JSON?format=jsonStandard JSON

Rate limits

LimitValue
Per IP60 req/min
Per API key120 req/min

Endpoints

  • SearchGET /search
  • RepositoriesPOST /repos/index, GET /repos, GET /repos/{owner}/{repo}/status
  • MCP toolssearch_code, index_repo, list_repos

On this page