这是一个提供文件语义搜索功能的Model Context Protocol (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": []
}
}
}
监控配置文件应具有以下结构:
{
"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": "500",
"IGNORE_FILE": "/path/to/.gitignore"
},
"disabled": false,
"autoApprove": []
}
}
}
此服务器提供了以下MCP工具:
在索引文件上执行语义搜索。
参数:
query(必需):搜索查询字符串limit(可选):返回结果的最大数量(默认值:5,最大值:20)示例响应:
[
{
"content": "匹配的文本内容",
"source": "/path/to/file",
"fileType": "markdown",
"score": 0.85
}
]
获取关于索引文件的统计信息。
参数:无
示例响应:
{
"totalDocuments": 42,
"watchedDirectories": ["/path/to/docs"],
"processingFiles": []
}