opencode-codebase-index 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **Stop grepping for concepts. Start searching for meaning.**
10
10
 
11
- **opencode-codebase-index** brings semantic understanding to your [OpenCode](https://opencode.ai) workflow. Instead of guessing function names or grepping for keywords, ask your codebase questions in plain English.
11
+ **opencode-codebase-index** brings semantic understanding to your [OpenCode](https://opencode.ai) workflow — and now to any MCP-compatible client like Cursor, Claude Code, and Windsurf. Instead of guessing function names or grepping for keywords, ask your codebase questions in plain English.
12
12
 
13
13
  ## 🚀 Why Use This?
14
14
 
@@ -16,7 +16,8 @@
16
16
  - ⚡ **Blazing Fast Indexing**: Powered by a Rust native module using `tree-sitter` and `usearch`. Incremental updates take milliseconds.
17
17
  - 🌿 **Branch-Aware**: Seamlessly handles git branch switches — reuses embeddings, filters stale results.
18
18
  - 🔒 **Privacy Focused**: Your vector index is stored locally in your project.
19
- - 🔌 **Model Agnostic**: Works out-of-the-box with GitHub Copilot, OpenAI, Gemini, or local Ollama models.
19
+ 🔌 **Model Agnostic**: Works out-of-the-box with GitHub Copilot, OpenAI, Gemini, or local Ollama models.
20
+ 🌐 **MCP Server**: Use with Cursor, Claude Code, Windsurf, or any MCP-compatible client — index once, search from anywhere.
20
21
 
21
22
  ## ⚡ Quick Start
22
23
 
@@ -39,6 +40,52 @@
39
40
  Ask:
40
41
  > "Find the function that handles credit card validation errors"
41
42
 
43
+ ## 🌐 MCP Server (Cursor, Claude Code, Windsurf, etc.)
44
+
45
+ Use the same semantic search from any MCP-compatible client. Index once, search from anywhere.
46
+
47
+ 1. **Install dependencies**
48
+ ```bash
49
+ npm install opencode-codebase-index @modelcontextprotocol/sdk zod
50
+ ```
51
+
52
+ 2. **Configure your MCP client**
53
+
54
+ **Cursor** (`.cursor/mcp.json`):
55
+ ```json
56
+ {
57
+ "mcpServers": {
58
+ "codebase-index": {
59
+ "command": "npx",
60
+ "args": ["opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ **Claude Code** (`claude_desktop_config.json`):
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "codebase-index": {
71
+ "command": "npx",
72
+ "args": ["opencode-codebase-index-mcp", "--project", "/path/to/your/project"]
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ 3. **CLI options**
79
+ ```bash
80
+ npx opencode-codebase-index-mcp --project /path/to/repo # specify project root
81
+ npx opencode-codebase-index-mcp --config /path/to/config # custom config file
82
+ npx opencode-codebase-index-mcp # uses current directory
83
+ ```
84
+
85
+ The MCP server exposes all 8 tools (`codebase_search`, `codebase_peek`, `find_similar`, `index_codebase`, `index_status`, `index_health_check`, `index_metrics`, `index_logs`) and 4 prompts (`search`, `find`, `index`, `status`).
86
+
87
+ The MCP dependencies (`@modelcontextprotocol/sdk`, `zod`) are optional peer dependencies — they're only needed if you use the MCP server.
88
+
42
89
  ## 🔍 See It In Action
43
90
 
44
91
  **Scenario**: You're new to a codebase and need to fix a bug in the payment flow.
@@ -131,6 +178,7 @@ graph TD
131
178
  - **Native speed**: Core logic written in Rust for maximum performance
132
179
  - **Memory efficient**: F16 vector quantization reduces index size by 50%
133
180
  - **Branch-aware**: Automatically tracks which chunks exist on each git branch
181
+ - **Provider validation**: Detects embedding provider/model changes and requires rebuild to prevent garbage results
134
182
 
135
183
  ## 🌿 Branch-Aware Indexing
136
184
 
@@ -493,6 +541,8 @@ CI will automatically run tests and type checking on your PR.
493
541
  ```
494
542
  ├── src/
495
543
  │ ├── index.ts # Plugin entry point
544
+ │ ├── mcp-server.ts # MCP server (Cursor, Claude Code, Windsurf)
545
+ │ ├── cli.ts # CLI entry for MCP stdio transport
496
546
  │ ├── config/ # Configuration schema
497
547
  │ ├── embeddings/ # Provider detection and API calls
498
548
  │ ├── indexer/ # Core indexing logic + inverted index