这是一个提供文件语义搜索能力的模型上下文协议(MCP)服务器。该服务器会对指定目录进行监控,并生成文件内容的向量嵌入,以此实现对文档的语义搜索。
您需要在 MCP 设置文件中添加如下内容:
{
"mcpServers": {
"files-vectorstore": {
"command": "npx",
"args": [
"-y",
"@lishenxydlgzs/simple-files-vectorstore"
],
"env": {
"WATCH_DIRECTORIES": "/path/to/your/directories"
},
"disabled": false,
"autoApprove": []
}
}
}
MCP 设置文件的具体位置如下:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json~/Library/Application Support/Claude/claude_desktop_config.json服务器需要通过环境变量进行配置,以下是详细说明:
您必须使用其中一种方法指定要监控的目录:
WATCH_DIRECTORIES:以逗号分隔的目录列表WATCH_CONFIG_FILE:包含 watchList 数组的 JSON 配置文件路径WATCH_DIRECTORIES 的示例{
"mcpServers": {
"files-vectorstore": {
"command": "npx",
"args": [
"-y",
"@lishenxydlgzs/simple-files-vectorstore"
],
"env": {
"WATCH_DIRECTORIES": "/path/to/dir1,/path/to/dir2"
},
"disabled": false,
"autoApprove": []
}
}
}
WATCH_CONFIG_FILE 的示例{
"mcpServers": {
"files-vectorstore": {
"command": "npx",
"args": [
"-y",
"@lishenxydlgzs/simple-files-vectorstore"
],
"env": {
"WATCH_CONFIG_FILE": "/path/to/watch-config.json"
},
"disabled": false,
"autoApprove": []
}
}
}
watch 配置文件应具有以下结构:
{
"watchList": [
"/path/to/dir1",
"/path/to/dir2",
"/path/to/specific/file.txt"
]
}
CHUNK_SIZE:文本块的大小(默认:1000)CHUNK_OVERLAP:块之间的重叠量(默认:200)IGNORE_FILE:类似 .gitignore 样式的文件路径,用于排除文件/目录{
"mcpServers": {
"files-vectorstore": {
"command": "npx",
"args": [
"-y",
"@lishenxydlgzs/simple-files-vectorstore"
],
"env": {
"WATCH_DIRECTORIES": "/path/to/dir1,/path/to/dir2",
"CHUNK_SIZE": "2000",
"CHUNK_OVERLAP": "200",
"IGNORE_FILE": "/path/to/ignore-file.txt"
},
"disabled": false,
"autoApprove": []
}
}
}
searchquery:要搜索的查询字符串maxResults:最大返回结果数,默认为 5{
"results": [
{
"id": string,
"score": number,
"content": string
}
]
}
curl -X POST http://localhost:1234/mcp/v1/tools/search \
-H "Content-Type: application/json" \
-d '{"query":"查询字符串", "maxResults":5}'