| tags |
|
||||
|---|---|---|---|---|---|
| aliases |
|
A VS Code extension that integrates CodeRAG directly into the editor. It auto-starts the MCP server, connects via SSE, provides search commands, a sidebar webview, and auto-configures Claude Code for MCP access.
Package: code-rag-vscode
Publisher: coderag
Engine: VS Code ^1.85.0
Build: esbuild (bundled CJS)
The extension activates when the workspace contains a .coderag.yaml file:
"activationEvents": ["workspaceContains:.coderag.yaml"]On activation, the extension:
- Creates an output channel (
CodeRAG) - Initializes the status bar
- Detects Claude Code and auto-writes MCP config if needed
- Starts the MCP server via
ServerManager - Connects the
McpClientover SSE tolocalhost:3100 - Fetches initial index status and updates the status bar
| Command ID | Title | Description |
|---|---|---|
coderag.search |
CodeRAG: Search | Opens a search input, queries the MCP server, and displays results |
coderag.index |
CodeRAG: Index | Triggers a re-index of the codebase |
coderag.status |
CodeRAG: Status | Shows index health, chunk count, and model info |
coderag.configureClaude |
CodeRAG: Configure Claude Code | Manually writes Claude Code MCP settings |
graph TD
A[extension.ts] -->|creates| B[ServerManager]
A -->|creates| C[McpClient]
A -->|creates| D[StatusBarManager]
A -->|creates| E[ClaudeConfigManager]
A -->|registers| F[Search Command]
A -->|registers| G[Index Command]
A -->|registers| H[Status Command]
A -->|registers| I[Configure Claude Command]
A -->|registers| J[SearchPanel]
B -->|spawns| K[coderag serve --port 3100]
C -->|SSE| K
J -->|uses| C
D -->|shows| L[Status Bar Item]
Manages the lifecycle of the coderag serve process:
- Auto-starts
coderag serve --port 3100as a child process - Monitors process health via
ensureRunning() - Stops the server on extension deactivation
- Logs server output to the CodeRAG output channel
Connects to the MCP server over SSE transport:
- Endpoint:
http://localhost:3100/sse - Provides methods for search, index, and status operations
- Handles connection lifecycle (connect/disconnect)
- Default port:
3100
Displays a status bar item in the VS Code footer:
- Shows connection state:
connected,disconnected,error - Displays the current chunk count when connected
- Updates on index operations and connection state changes
Auto-configures Claude Code to use the CodeRAG MCP server:
- Detects whether Claude Code is installed
- Checks if
.claude/settings.jsonalready has CodeRAG configured - Writes the MCP server configuration pointing to
http://localhost:3100/sse - Runs automatically on activation (if Claude Code is detected and not yet configured)
- Can also be triggered manually via the
coderag.configureClaudecommand
A webview sidebar panel for interactive search:
- Registered as a webview view in the
coderag-sidebaractivity bar container - Provides a search input with real-time results
- Results show file paths, chunk types, scores, and snippets
- Click results to open the corresponding file in the editor
The extension contributes an activity bar container:
{
"viewsContainers": {
"activitybar": [{
"id": "coderag-sidebar",
"title": "CodeRAG",
"icon": "$(search)"
}]
},
"views": {
"coderag-sidebar": [{
"type": "webview",
"id": "coderag.searchPanel",
"name": "Search"
}]
}
}| Event | Action |
|---|---|
| Activate | Create managers, register commands, auto-configure Claude, start server, connect client |
| Deactivate | Disconnect MCP client, stop server, dispose status bar |
| SIGINT/SIGTERM | Server manager cleans up child process |
Note: > Commands are registered and available even before the server connects. If the server is unavailable, commands will show appropriate error messages.
- MCP Server -- the MCP server that the extension connects to
- CLI -- the
coderag servecommand used byServerManager