Skip to content

Commit 8165b92

Browse files
committed
Improve the mcp setup instructions
Signed-off-by: codingjaguar <jiang.chen@zilliz.com>
1 parent d34dc4c commit 8165b92

File tree

2 files changed

+58
-67
lines changed

2 files changed

+58
-67
lines changed

README.md

Lines changed: 58 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,56 @@
99
[![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Docs-purple.svg?logo=gitbook&logoColor=white)](https://deepwiki.com/zilliztech/code-context)
1010
<a href="https://discord.gg/mKc3R95yE5"><img height="20" src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" alt="discord" /></a>
1111

12-
**Code Context** is an MCP plugin for semantic code search for Claude Code, Gemini CLI, or Cursor. It adds semantic search and code analysis, providing improved context awareness in code generation.
12+
**Code Context** is an MCP plugin that brings semantic code search to Claude Code, Gemini CLI, or any AI coding agent. By indexing your entire codebase, it gives your assistant deep context awareness for better code generation.
1313

14-
This plugin allows your coding assistant to perform semantic searches on your codebase, enabling it to answer questions and generate code with a deeper understanding of the project's context. For example, you can ask *"Where are all the authentication checks?"* and the agent will find the relevant code snippets based on meaning, not just keyword matches.
14+
AI coding assistants like Claude Code are limited by their context window and can only see part of your codebase. Code Context uses semantic search with a scalable vector database Zilliz Cloud so your assistant can find and understand relevant code from your whole project using natural language, not just keywords. This gives your AI assistant real context awareness.
1515

16-
- **Search code by meaning, not just keywords**—thanks to powerful embedding models and Zilliz Cloud vector database integration.
17-
- **Understand and navigate massive codebases** with semantic search, context-aware discovery, and AI-powered code writing.
18-
- **Accelerate your workflow** by combining the best of Gemini CLI's AI capabilities with deep, actionable code insights.
16+
---
1917

20-
> *"Code Context is a tool for code comprehension, search, and development. Unlock the full potential of your codebase, no matter its size."*
18+
## 🚀 Use Code Context as MCP in Claude Code and others
2119

22-
---
20+
Model Context Protocol (MCP) allows you to integrate Code Context with your favorite AI coding assistants.
2321

24-
## 🌟 Why Code Context?
22+
### Prerequisites
2523

26-
In the era of AI-first development, codebases are growing faster than ever. Traditional tools can't keep up:
24+
<details>
25+
<summary><strong>Get a free vector database on Zilliz Cloud</strong></summary>
2726

28-
- **Claude Code** or **Gemini CLI** lacked full context of the entire codebase. No LLM can fit millions of lines of code in context, and `grep` doesn't work unless you can remember all variable names.
29-
- **Code Context** provides semantic search, allowing you to find, understand, and reuse code using natural language rather than just `grep`. It offers true context awareness by understanding relationships, structure, and intent across your entire codebase.
30-
- **Powered by Zilliz Cloud**, you get blazing-fast, scalable vector search for all your code.
27+
Code Context needs a vector database. You can [sign up](https://cloud.zilliz.com/signup) on Zilliz Cloud to get a free Serverless cluster.
3128

32-
**Code Context provides the essential connection between AI code generation and understanding a codebase.**
29+
After creating your cluster, open your Zilliz Cloud console and copy both the **public endpoint** and your **API key**.
30+
These will be used as `your-zilliz-cloud-public-endpoint` and `your-zilliz-cloud-api-key` in the configuration examples.
3331

34-
---
32+
![Zilliz Cloud Dashboard](assets/zilliz_cloud_dashboard.jpeg)
3533

36-
## 🚀 Quick Start: MCP Integration
34+
Keep both values handy for the configuration steps below.
3735

38-
Model Context Protocol (MCP) allows you to integrate Code Context with your favorite AI coding assistants.
36+
If you need help creating your free vector database or finding these values, see the [Zilliz Cloud documentation](https://docs.zilliz.com/docs/create-cluster) for detailed instructions.
3937

40-
### Prerequisites
38+
</details>
39+
40+
<details>
41+
<summary><strong>Get OpenAI API Key for embedding model</strong></summary>
42+
43+
You need an OpenAI API key for the embedding model. You can get one by signing up at [OpenAI](https://platform.openai.com/api-keys).
4144

42-
- Node.js >= 20.0.0
43-
- pnpm >= 10.0.0
44-
- (Optional) Milvus database
45-
- (Optional) API key for OpenAI, VoyageAI, or other embedding providers.
45+
Your API key will look like this: it always starts with `sk-`.
46+
Copy your key and use it in the configuration examples below as `your-openai-api-key`.
47+
48+
</details>
49+
50+
### Configure MCP for your AI Assistant
4651

47-
### Environment Variables (Optional)
52+
#### Claude Code
4853

49-
If you want to use cloud embedding/vector DBs:
54+
Use the command line interface to add the Code Context MCP server:
5055

5156
```bash
52-
OPENAI_API_KEY=your-openai-api-key
53-
MILVUS_ADDRESS=your-milvus-endpoint
54-
MILVUS_TOKEN=your-milvus-token
57+
# Add the Code Context MCP server
58+
claude mcp add code-context -e OPENAI_API_KEY=your-openai-api-key -e MILVUS_ADDRESS=your-zilliz-cloud-public-endpoint -e MILVUS_TOKEN=your-zilliz-cloud-api-key -- npx @zilliz/code-context-mcp@latest
5559
```
5660

57-
### Configure MCP for your AI Assistant
61+
See the [Claude Code MCP documentation](https://docs.anthropic.com/en/docs/claude-code/mcp) for more details about MCP server management.
5862

5963
#### Gemini CLI
6064

@@ -71,27 +75,16 @@ Gemini CLI requires manual configuration through a JSON file:
7175
"args": ["@zilliz/code-context-mcp@latest"],
7276
"env": {
7377
"OPENAI_API_KEY": "your-openai-api-key",
74-
"MILVUS_ADDRESS": "localhost:19530"
78+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
79+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
7580
}
7681
}
7782
}
7883
}
7984
```
8085
3. Save the file and restart Gemini CLI to apply the changes.
8186

82-
#### Claude Code
83-
84-
Use the command line interface to add the Code Context MCP server:
85-
86-
```bash
87-
# Add the Code Context MCP server
88-
claude mcp add code-context -e OPENAI_API_KEY=your-openai-api-key -e MILVUS_ADDRESS=localhost:19530 -- npx @zilliz/code-context-mcp@latest
89-
```
90-
91-
See the [Claude Code MCP documentation](https://docs.anthropic.com/en/docs/claude-code/mcp) for more details about MCP server management.
92-
93-
<details>
94-
<summary><strong>Other MCP Client Configurations (Cursor, Windsurf, etc.)</strong></summary>
87+
### Other MCP Client Configurations (Cursor, Windsurf, etc.)
9588

9689
<details>
9790
<summary><strong>Cursor</strong></summary>
@@ -110,8 +103,8 @@ Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file i
110103
"args": ["-y", "@zilliz/code-context-mcp@latest"],
111104
"env": {
112105
"OPENAI_API_KEY": "your-openai-api-key",
113-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
114-
"MILVUS_ADDRESS": "localhost:19530"
106+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
107+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
115108
}
116109
}
117110
}
@@ -133,8 +126,8 @@ Add to your Claude Desktop configuration:
133126
"args": ["@zilliz/code-context-mcp@latest"],
134127
"env": {
135128
"OPENAI_API_KEY": "your-openai-api-key",
136-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
137-
"MILVUS_ADDRESS": "localhost:19530"
129+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
130+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
138131
}
139132
}
140133
}
@@ -156,8 +149,8 @@ Windsurf supports MCP configuration through a JSON file. Add the following confi
156149
"args": ["-y", "@zilliz/code-context-mcp@latest"],
157150
"env": {
158151
"OPENAI_API_KEY": "your-openai-api-key",
159-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
160-
"MILVUS_ADDRESS": "localhost:19530"
152+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
153+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
161154
}
162155
}
163156
}
@@ -179,8 +172,8 @@ The Code Context MCP server can be used with VS Code through MCP-compatible exte
179172
"args": ["-y", "@zilliz/code-context-mcp@latest"],
180173
"env": {
181174
"OPENAI_API_KEY": "your-openai-api-key",
182-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
183-
"MILVUS_ADDRESS": "localhost:19530"
175+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
176+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
184177
}
185178
}
186179
}
@@ -202,8 +195,8 @@ Cherry Studio allows for visual MCP server configuration through its settings in
202195
- **Arguments**: `["@zilliz/code-context-mcp@latest"]`
203196
- **Environment Variables**:
204197
- `OPENAI_API_KEY`: `your-openai-api-key`
205-
- `OPENAI_BASE_URL`: `https://your-custom-endpoint.com/v1` (optional)
206-
- `MILVUS_ADDRESS`: `localhost:19530`
198+
- `MILVUS_ADDRESS`: `your-zilliz-cloud-public-endpoint`
199+
- `MILVUS_TOKEN`: `your-zilliz-cloud-api-key`
207200
3. Save the configuration to activate the server.
208201

209202
</details>
@@ -227,8 +220,8 @@ Cline uses a JSON configuration file to manage MCP servers. To integrate the pro
227220
"args": ["@zilliz/code-context-mcp@latest"],
228221
"env": {
229222
"OPENAI_API_KEY": "your-openai-api-key",
230-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
231-
"MILVUS_ADDRESS": "localhost:19530"
223+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
224+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
232225
}
233226
}
234227
}
@@ -282,8 +275,8 @@ To configure Code Context MCP in Augment Code, you can use either the graphical
282275
"args": ["-y", "@zilliz/code-context-mcp@latest"],
283276
"env": {
284277
"OPENAI_API_KEY": "your-openai-api-key",
285-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
286-
"MILVUS_ADDRESS": "localhost:19530"
278+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
279+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
287280
}
288281
}
289282
]
@@ -309,8 +302,8 @@ Roo Code utilizes a JSON configuration file for MCP servers:
309302
"args": ["@zilliz/code-context-mcp@latest"],
310303
"env": {
311304
"OPENAI_API_KEY": "your-openai-api-key",
312-
"OPENAI_BASE_URL": "https://your-custom-endpoint.com/v1",
313-
"MILVUS_ADDRESS": "localhost:19530"
305+
"MILVUS_ADDRESS": "your-zilliz-cloud-public-endpoint",
306+
"MILVUS_TOKEN": "your-zilliz-cloud-api-key"
314307
}
315308
}
316309
}
@@ -340,15 +333,13 @@ npx @zilliz/code-context-mcp@latest
340333
## ✨ Features
341334

342335
- 🔍 **Semantic Code Search**: Ask questions like *"find functions that handle user authentication"* and get relevant, context-rich code instantly.
343-
- **Context-Aware Discovery**: Understand how different parts of your codebase relate, even across millions of lines.
344-
- **AI-Assisted Programming**: Generate, refactor, or extend code using natural language prompts.
345-
- **Local & Cloud Indexing**: Index your codebase locally or leverage Zilliz Cloud for scalable, privacy-respecting search.
336+
- 🧠 **Context-Aware Discovery**: Understand how different parts of your codebase relate, even across millions of lines.
337+
- 🤖 **AI-Assisted Programming**: Generate, refactor, or extend code using natural language prompts.
346338
-**Incremental File Synchronization**: Efficiently re-index only changed files using Merkle trees.
347-
- **Smart Chunking**: AST-based code splitting for context-preserving search and generation.
348-
- **Productivity**: Reduce time spent searching and writing boilerplate code—focus on what matters.
349-
- **Pluggable Embedding Providers**: Support for OpenAI, VoyageAI, Ollama, and more.
350-
- **Vector Storage**: Integrates with Zilliz Cloud for scalable vector search, no matter how large your codebase is.
351-
- **Customizable**: Configure file extensions, ignore patterns, and embedding models.
339+
- 🧩 **Smart Chunking**: AST-based code splitting for context-preserving search and generation.
340+
- 🔌 **Pluggable Embedding Providers**: Support for OpenAI, VoyageAI, Ollama, and more.
341+
- 🗄️ **Vector Storage**: Integrates with Zilliz Cloud for scalable vector search, no matter how large your codebase is.
342+
- 🛠️ **Customizable**: Configure file extensions, ignore patterns, and embedding models.
352343

353344
---
354345

@@ -391,8 +382,8 @@ const embedding = new OpenAIEmbedding({
391382

392383
// Initialize vector database
393384
const vectorDatabase = new MilvusVectorDatabase({
394-
address: process.env.MILVUS_ADDRESS || 'localhost:19530',
395-
token: process.env.MILVUS_TOKEN || ''
385+
address: process.env.MILVUS_ADDRESS || 'your-zilliz-cloud-public-endpoint',
386+
token: process.env.MILVUS_TOKEN || 'your-zilliz-cloud-api-key'
396387
});
397388

398389
// Create indexer instance

assets/zilliz_cloud_dashboard.jpeg

435 KB
Loading

0 commit comments

Comments
 (0)