This document explains how Claude Context MCP handles codebase indexing asynchronously in the background.
Claude Context MCP server allows users to start indexing and get an immediate response, while the actual indexing happens in the background. Users can search and monitor progress at any time.
The sequence diagram above demonstrates the timing and interaction between the agent, MCP server, and background process.
The agent receives an immediate response when starting indexing, then the users can perform searches and status checks through the agent while indexing continues in the background.
The flow diagram above shows the complete indexing workflow, illustrating how the system handles different states and user interactions. The key insight is that indexing starts immediately but runs in the background, allowing users to interact with the system at any time.
index_codebase- Starts background indexing, returns immediatelysearch_code- Searches codebase (works during indexing with partial results)get_indexing_status- Shows current progress and statusclear_index- Removes indexed data
indexed- ✅ Ready for searchindexing- 🔄 Background process runningindexfailed- ❌ Error occurred, can retrynot_found- ❌ Not indexed yet
- Non-blocking: Agent gets immediate response
- Progressive: Can search partial results while indexing
- Resilient: Handles errors gracefully with retry capability
- Transparent: Always know current status

