Skip to content

Commit 0205b3d

Browse files
authored
Merge pull request #1 from cocoindex-io/badmonster0-patch-1
Revise README for clarity and additional features
2 parents a42a843 + 9ed2fe8 commit 0205b3d

1 file changed

Lines changed: 59 additions & 106 deletions

File tree

README.md

Lines changed: 59 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,72 @@
1-
# CocoIndex Code
1+
<h1 align="center">CocoIndex Code </h1>
22

3-
An MCP (Model Context Protocol) server for indexing and querying codebases using [CocoIndex](https://cocoindex.io).
3+
<h1 align="center">light weight MCP for code that just works </h1>
44

5-
## Features
6-
7-
- **Semantic Code Search**: Find relevant code using natural language queries
8-
- **Incremental Indexing**: Only re-indexes changed files for fast updates
9-
- **Multi-Language Support**: Python, JavaScript/TypeScript, Rust, Go, Java, C/C++, C#, SQL, Shell
10-
- **Flexible Embeddings**: Local SentenceTransformers (default) or 100+ cloud providers via [LiteLLM](https://docs.litellm.ai/docs/embedding/supported_embedding)
11-
- **SQLite Storage**: Portable, no external database required
125

13-
## Prerequisites
6+
A super light-weight, effective embedded MCP that understand and searches your codebase that just works! Using [CocoIndex](https://github.com/cocoindex-io/cocoindex) - an Rust-based ultra performant data transformation engine. No blackbox. Works for Claude, Codex, Cursor - any coding agent.
147

15-
Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/) (which provides `uvx`):
16-
17-
```bash
18-
curl -LsSf https://astral.sh/uv/install.sh | sh
19-
```
8+
- Instant token saving by 70%.
9+
- **1 min setup** - Just claude/codex mcp add works!
2010

21-
## Usage with Claude Code
11+
<div align="center">
2212

23-
No installation needed — `uvx` runs it directly.
13+
[![GitHub](https://img.shields.io/github/stars/cocoindex-io/cocoindex?color=5B5BD6)](https://github.com/cocoindex-io/cocoindex)
14+
[![Documentation](https://img.shields.io/badge/Documentation-394e79?logo=readthedocs&logoColor=00B9FF)](https://cocoindex.io/docs/getting_started/quickstart)
15+
[![License](https://img.shields.io/badge/license-Apache%202.0-5B5BD6?logoColor=white)](https://opensource.org/licenses/Apache-2.0)
16+
[![PyPI version](https://img.shields.io/pypi/v/cocoindex?color=5B5BD6)](https://pypi.org/project/cocoindex/)
17+
<!--[![PyPI - Downloads](https://img.shields.io/pypi/dm/cocoindex)](https://pypistats.org/packages/cocoindex) -->
18+
[![PyPI Downloads](https://static.pepy.tech/badge/cocoindex/month)](https://pepy.tech/projects/cocoindex)
19+
[![CI](https://github.com/cocoindex-io/cocoindex/actions/workflows/CI.yml/badge.svg?event=push&color=5B5BD6)](https://github.com/cocoindex-io/cocoindex/actions/workflows/CI.yml)
20+
[![release](https://github.com/cocoindex-io/cocoindex/actions/workflows/release.yml/badge.svg?event=push&color=5B5BD6)](https://github.com/cocoindex-io/cocoindex/actions/workflows/release.yml)
21+
[![Link Check](https://github.com/cocoindex-io/cocoindex/actions/workflows/links.yml/badge.svg)](https://github.com/cocoindex-io/cocoindex/actions/workflows/links.yml)
22+
[![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek)
23+
[![Discord](https://img.shields.io/discord/1314801574169673738?logo=discord&color=5B5BD6&logoColor=white)](https://discord.com/invite/zpA9S2DR7s)
2424

25-
### Default (Local Embeddings)
25+
🌟 Please help star [CocoIndex](https://github.com/cocoindex-io/cocoindex) if you like this project!
26+
</div>
2627

27-
Uses a local SentenceTransformers model (`sentence-transformers/all-MiniLM-L6-v2`). No API key required:
28+
## Get Started - zero config, let's go!!
2829

30+
### Claude
2931
```bash
3032
claude mcp add cocoindex-code \
3133
-- uvx --prerelease=explicit --with "cocoindex>=1.0.0a13" cocoindex-code@latest
3234
```
3335

34-
### With a Cloud or Custom Embedding Model
36+
### Codex
37+
```bash
38+
codex mcp add cocoindex-code \
39+
-- uvx --prerelease=explicit --with "cocoindex>=1.0.0a13" cocoindex-code@latest
40+
```
41+
42+
## Features
43+
- **Semantic Code Search**: Find relevant code using natural language queries when grep doesn't work well, and save tokens immediately.
44+
- **Ultra Performant to code changes**:⚡ Built on top of ultra performant [Rust indexing engine](https://github.com/cocoindex-io/cocoindex/edit/main/README.md). Only re-indexes changed files for fast updates.
45+
- **Multi-Language Support**: Python, JavaScript/TypeScript, Rust, Go, Java, C/C++, C#, SQL, Shell
46+
- **Embedded**: Portable and just works, no database setup required!
47+
- **Flexible Embeddings**: By default, no API key required with Local SentenceTransformers - totally free! You can customize 100+ cloud providers.
48+
49+
50+
## Configuration
51+
52+
| Variable | Description | Default |
53+
|----------|-------------|---------|
54+
| `COCOINDEX_CODE_ROOT_PATH` | Root path of the codebase | Auto-discovered (see below) |
55+
| `COCOINDEX_CODE_EMBEDDING_MODEL` | Embedding model (see below) | `sbert/sentence-transformers/all-MiniLM-L6-v2` |
56+
57+
58+
### Root Path Discovery
59+
60+
If `COCOINDEX_CODE_ROOT_PATH` is not set, the codebase root is discovered by:
61+
62+
1. Finding the nearest parent directory containing `.cocoindex_code/`
63+
2. Finding the nearest parent directory containing `.git/`
64+
3. Falling back to the current working directory
65+
66+
### Embedding model
67+
By default - this project use a local SentenceTransformers model (`sentence-transformers/all-MiniLM-L6-v2`). No API key required and completely free!
68+
69+
Use a code specific embedding model can achieve better semantic understanding for your results, this project supports all models on Ollama and 100+ cloud providers.
3570

3671
Set `COCOINDEX_CODE_EMBEDDING_MODEL` to any [LiteLLM-supported model](https://docs.litellm.ai/docs/embedding/supported_embedding), along with the provider's API key:
3772

@@ -150,44 +185,8 @@ claude mcp add cocoindex-code \
150185

151186
Any model supported by LiteLLM works — see the [full list of embedding providers](https://docs.litellm.ai/docs/embedding/supported_embedding).
152187

153-
### Setup `.gitignore`
154-
155-
Add the index directory to your `.gitignore` so it isn't committed:
156-
157-
```bash
158-
echo .cocoindex_code >> .gitignore
159-
```
160-
161-
### Uninstall
162-
163-
Remove the MCP server and delete the local index:
164188

165-
```bash
166-
claude mcp remove cocoindex-code
167-
rm -rf .cocoindex_code
168-
```
169-
170-
## Configuration
171-
172-
| Variable | Description | Default |
173-
|----------|-------------|---------|
174-
| `COCOINDEX_CODE_ROOT_PATH` | Root path of the codebase | Auto-discovered (see below) |
175-
| `COCOINDEX_CODE_EMBEDDING_MODEL` | Embedding model (see below) | `sbert/sentence-transformers/all-MiniLM-L6-v2` |
176-
177-
### Embedding Model
178189

179-
The `COCOINDEX_CODE_EMBEDDING_MODEL` variable uses a prefix to select the embedding backend:
180-
181-
- **`sbert/`** prefix — uses [SentenceTransformers](https://www.sbert.net/) (runs locally, no API key needed). Example: `sbert/sentence-transformers/all-MiniLM-L6-v2`
182-
- **Otherwise** — uses [LiteLLM](https://docs.litellm.ai/docs/embedding/supported_embedding) (supports 100+ providers). Example: `text-embedding-3-small`
183-
184-
### Root Path Discovery
185-
186-
If `COCOINDEX_CODE_ROOT_PATH` is not set, the codebase root is discovered by:
187-
188-
1. Finding the nearest parent directory containing `.cocoindex_code/`
189-
2. Finding the nearest parent directory containing `.git/`
190-
3. Falling back to the current working directory
191190

192191
## MCP Tools
193192

@@ -217,22 +216,8 @@ Returns matching code chunks with:
217216
- Line numbers (start/end)
218217
- Similarity score
219218

220-
## Index Storage
221219

222-
The index is stored in `.cocoindex_code/` under your codebase root:
223-
224-
```
225-
your-project/
226-
├── .cocoindex_code/
227-
│ ├── target_sqlite.db # Vector index (SQLite + sqlite-vec)
228-
│ └── cocoindex.db/ # CocoIndex state
229-
├── src/
230-
│ └── ...
231-
```
232-
233-
Add `.cocoindex_code/` to your `.gitignore`.
234-
235-
## Supported File Types
220+
## Supported Languages
236221

237222
- **Python**: `.py`, `.pyi`
238223
- **JavaScript**: `.js`, `.jsx`, `.mjs`, `.cjs`
@@ -256,42 +241,10 @@ Common generated directories are automatically excluded:
256241
- `dist/`
257242
- `vendor/` (Go vendored dependencies, matched by domain-based child paths)
258243

259-
## Development
260-
261-
### Local Testing with Claude Code
262-
263-
To test locally without installing the package, use the Claude Code CLI:
264-
265-
```bash
266-
claude mcp add cocoindex-code \
267-
-- uv run --project /path/to/cocoindex-code cocoindex-code
268-
```
269-
270-
Or add to `.mcp.json` in your project root:
271-
272-
```json
273-
{
274-
"mcpServers": {
275-
"cocoindex-code": {
276-
"command": "uv",
277-
"args": ["run", "--project", "/path/to/cocoindex-code", "cocoindex-code"]
278-
}
279-
}
280-
}
281-
```
282-
283-
### Running Tests
244+
## Large codebase / Enterprise
245+
[CocoIndex](https://github.com/cocoindex-io/cocoindex) is an ultra effecient indexing engine that also works on large codebase at scale on XXX G for enterprises. In enterprise scenarios it is a lot more effecient to do index share with teammates when there are large repo or many repos. We also have advanced features like branch dedupe etc designed for enterprise users.
284246

285-
```bash
286-
# Install dev dependencies
287-
uv sync --group dev
288-
289-
# Run tests
290-
uv run pytest tests/ -v
291-
292-
# Run pre-commit hooks
293-
uv run pre-commit run --all-files
294-
```
247+
If you need help with remote setup, please email our maintainer linghua@cocoindex.io, happy to help!!
295248

296249
## License
297250

0 commit comments

Comments
 (0)