API Reference
MCP Tools
The tools Clean exposes to AI agents via the Model Context Protocol.
When connected via MCP, Clean exposes three tools to your agent.
search_code
Semantic search across an indexed repository.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
query | string | ✓ | Natural language search query |
repo | string | ✓ | Repository in owner/repo format |
k | integer | — | Number of results (default: 10) |
Output
TOON-formatted search results with call graph context. Equivalent to GET /search.
index_repo
Trigger indexing for a repository.
Input schema
Output
Indexing status and job ID.
list_repos
List all repositories that have been indexed.
Input schema
No input required.
Output
Array of indexed repositories with their status, entity count, and last indexed timestamp.
MCP endpoints
| Agent | Transport | Endpoint |
|---|---|---|
| Claude Code | Streamable HTTP | http://localhost:8000/mcp |
| Claude Desktop | SSE | http://localhost:8000/mcp/sse |
| Cursor | SSE | http://localhost:8000/mcp/sse |
| Antigravity | Streamable HTTP | http://localhost:8000/mcp |
| Codex | Streamable HTTP | http://localhost:8000/mcp |