Skip to content

Commit ecc43e2

Browse files
committed
chore: guide users always upgrade to latest
1 parent f3738a3 commit ecc43e2

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ No installation needed — `uvx` runs it directly.
1919
Uses a local SentenceTransformers model (`sentence-transformers/all-MiniLM-L6-v2`). No API key required:
2020

2121
```bash
22-
claude mcp add cocoindex-code -- uvx cocoindex-code
22+
claude mcp add cocoindex-code -- uvx cocoindex-code@latest
2323
```
2424

2525
### With a Cloud or Custom Embedding Model
@@ -32,7 +32,7 @@ Set `COCOINDEX_CODE_EMBEDDING_MODEL` to any [LiteLLM-supported model](https://do
3232
```bash
3333
claude mcp add cocoindex-code \
3434
-e COCOINDEX_CODE_EMBEDDING_MODEL=ollama/nomic-embed-text \
35-
-- uvx cocoindex-code
35+
-- uvx cocoindex-code@latest
3636
```
3737

3838
Set `OLLAMA_API_BASE` if your Ollama server is not at `http://localhost:11434`.
@@ -46,7 +46,7 @@ Set `OLLAMA_API_BASE` if your Ollama server is not at `http://localhost:11434`.
4646
claude mcp add cocoindex-code \
4747
-e COCOINDEX_CODE_EMBEDDING_MODEL=text-embedding-3-small \
4848
-e OPENAI_API_KEY=your-api-key \
49-
-- uvx cocoindex-code
49+
-- uvx cocoindex-code@latest
5050
```
5151

5252
</details>
@@ -60,7 +60,7 @@ claude mcp add cocoindex-code \
6060
-e AZURE_API_KEY=your-api-key \
6161
-e AZURE_API_BASE=https://your-resource.openai.azure.com \
6262
-e AZURE_API_VERSION=2024-06-01 \
63-
-- uvx cocoindex-code
63+
-- uvx cocoindex-code@latest
6464
```
6565

6666
</details>
@@ -72,7 +72,7 @@ claude mcp add cocoindex-code \
7272
claude mcp add cocoindex-code \
7373
-e COCOINDEX_CODE_EMBEDDING_MODEL=gemini/text-embedding-004 \
7474
-e GEMINI_API_KEY=your-api-key \
75-
-- uvx cocoindex-code
75+
-- uvx cocoindex-code@latest
7676
```
7777

7878
</details>
@@ -84,7 +84,7 @@ claude mcp add cocoindex-code \
8484
claude mcp add cocoindex-code \
8585
-e COCOINDEX_CODE_EMBEDDING_MODEL=mistral/mistral-embed \
8686
-e MISTRAL_API_KEY=your-api-key \
87-
-- uvx cocoindex-code
87+
-- uvx cocoindex-code@latest
8888
```
8989

9090
</details>
@@ -96,7 +96,7 @@ claude mcp add cocoindex-code \
9696
claude mcp add cocoindex-code \
9797
-e COCOINDEX_CODE_EMBEDDING_MODEL=voyage/voyage-code-3 \
9898
-e VOYAGE_API_KEY=your-api-key \
99-
-- uvx cocoindex-code
99+
-- uvx cocoindex-code@latest
100100
```
101101

102102
</details>
@@ -108,7 +108,7 @@ claude mcp add cocoindex-code \
108108
claude mcp add cocoindex-code \
109109
-e COCOINDEX_CODE_EMBEDDING_MODEL=cohere/embed-english-v3.0 \
110110
-e COHERE_API_KEY=your-api-key \
111-
-- uvx cocoindex-code
111+
-- uvx cocoindex-code@latest
112112
```
113113

114114
</details>
@@ -122,7 +122,7 @@ claude mcp add cocoindex-code \
122122
-e AWS_ACCESS_KEY_ID=your-access-key \
123123
-e AWS_SECRET_ACCESS_KEY=your-secret-key \
124124
-e AWS_REGION_NAME=us-east-1 \
125-
-- uvx cocoindex-code
125+
-- uvx cocoindex-code@latest
126126
```
127127

128128
</details>
@@ -134,7 +134,7 @@ claude mcp add cocoindex-code \
134134
claude mcp add cocoindex-code \
135135
-e COCOINDEX_CODE_EMBEDDING_MODEL=nebius/BAAI/bge-en-icl \
136136
-e NEBIUS_API_KEY=your-api-key \
137-
-- uvx cocoindex-code
137+
-- uvx cocoindex-code@latest
138138
```
139139

140140
</details>
@@ -182,12 +182,12 @@ If `COCOINDEX_CODE_ROOT_PATH` is not set, the codebase root is discovered by:
182182

183183
## MCP Tools
184184

185-
### `query`
185+
### `search`
186186

187187
Search the codebase using semantic similarity.
188188

189189
```
190-
query(
190+
search(
191191
query: str, # Natural language query or code snippet
192192
limit: int = 10, # Maximum results (1-100)
193193
offset: int = 0, # Pagination offset

src/cocoindex_code/server.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
This allows you to quickly and cheaply search for code related to a concept or functionality
1717
across the entire codebase.
1818
19-
Use the `query` tool when you need to:
19+
Use the `search` tool when you need to:
2020
- Find code related to a concept or functionality
2121
- Search for implementations of specific features
2222
- Discover how something is done in the codebase
2323
- Find similar code patterns
2424
25-
The `query` tool has a `refresh_index` parameter (default: True) that refreshes
25+
The `search` tool has a `refresh_index` parameter (default: True) that refreshes
2626
the index before searching. Set it to False for consecutive queries to avoid
2727
redundant refreshes.
2828
@@ -55,8 +55,8 @@ class CodeChunkResult(BaseModel):
5555
score: float = Field(description="Similarity score (0-1, higher is better)")
5656

5757

58-
class QueryResultModel(BaseModel):
59-
"""Result from query tool."""
58+
class SearchResultModel(BaseModel):
59+
"""Result from search tool."""
6060

6161
success: bool
6262
results: list[CodeChunkResult] = Field(default_factory=list)
@@ -69,14 +69,14 @@ class QueryResultModel(BaseModel):
6969

7070

7171
@mcp.tool(
72-
name="query",
72+
name="search",
7373
description=(
7474
"Search the codebase using semantic similarity. "
7575
"Returns relevant code chunks with file locations and similarity scores. "
7676
"Use natural language queries or code snippets to find related code."
7777
),
7878
)
79-
async def query(
79+
async def search(
8080
query: str = Field(description="Natural language query or code snippet to search for"),
8181
limit: int = Field(
8282
default=10,
@@ -96,7 +96,7 @@ async def query(
9696
"Set to False for consecutive queries to skip redundant refreshes."
9797
),
9898
),
99-
) -> QueryResultModel:
99+
) -> SearchResultModel:
100100
"""Query the codebase index."""
101101
try:
102102
# Refresh index if requested
@@ -105,7 +105,7 @@ async def query(
105105

106106
results = await query_codebase(query=query, limit=limit, offset=offset)
107107

108-
return QueryResultModel(
108+
return SearchResultModel(
109109
success=True,
110110
results=[
111111
CodeChunkResult(
@@ -123,12 +123,12 @@ async def query(
123123
)
124124
except RuntimeError as e:
125125
# Index doesn't exist
126-
return QueryResultModel(
126+
return SearchResultModel(
127127
success=False,
128128
message=str(e),
129129
)
130130
except Exception as e:
131-
return QueryResultModel(
131+
return SearchResultModel(
132132
success=False,
133133
message=f"Query failed: {e!s}",
134134
)

0 commit comments

Comments
 (0)