MCP嵌入式存储服务器
MCP服务器,用于通过矢量嵌入存储和检索信息 人工智能嵌入API.
特性
- 使用自动生成的嵌入来存储内容
- 使用语义相似性搜索内容
- 通过工具和资源访问内容
- 使用预定义的提示进行常见操作
运作原理
此MCP服务器连接到AI Embeddings API,该API:
- 处理内容并将其分成几部分
- 为每个部分生成嵌入
- 将内容和嵌入都存储在数据库中
- 使用向量相似度启用语义搜索
搜索时,API会根据查询与存储嵌入的语义相似性来查找存储内容中最相关的部分。
安装
# Install with npm
npm install -g mcp-embedding-storage
# Or with pnpm
pnpm add -g mcp-embedding-storage
# Or with yarn
yarn global add mcp-embedding-storage使用Claude for Desktop
将以下配置添加到您的 claude_desktop_config.json 文件:
{
"mcpServers": {
"embedding-storage": {
"command": "mcp-embedding-storage"
}
}
}然后重新启动Claude for Desktop以连接到服务器。
可用工具
存储内容
使用自动生成的嵌入来存储内容。
参数:
content:要存储的内容path:内容的唯一标识符路径type(可选):内容类型(例如“markdown”)source(可选):内容来源parentPath(可选):父内容的路径(如果适用)
搜索内容
使用向量相似度搜索内容。
参数:
query:搜索查询maxMatches(可选):要返回的最大匹配数
可用资源
搜索://{查询}
用于搜索内容的资源模板。
示例用法: search://machine learning basics
可用提示
存储新内容
一个提示,用于帮助存储带有嵌入的新内容。
参数:
path:内容的唯一标识符路径content:要存储的内容
搜索知识
寻找知识的提示。
参数:
query:搜索查询
API集成
此MCP服务器与位于的AI Embeddings API集成https://ai-embeddings.vercel.app/具有以下端点:
- 生成嵌入 (
POST /api/generate-embeddings)
- 为内容生成嵌入并将其存储在数据库中 - 所需参数: content 和 path
- 矢量搜索 (
POST /api/vector-search)
- 基于语义相似度的内容搜索 - 必需参数: prompt
从源头构建
# Clone the repository
git clone https://github.com/yourusername/mcp-embedding-storage.git
cd mcp-embedding-storage
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Start the server
pnpm start许可证
麻省理工学院
