The Baidu Vector Database MCP Server allows interaction with Baidu Cloud Vector Database (VDB) via the Model Context Protocol (MCP), providing comprehensive vector database management capabilities:
- Database Operations: List, create, and switch databases
- Table Operations: List tables, describe table details, get statistics
- Data Operations: Select or delete table rows using filter expressions
- Index Operations: Create, rebuild, drop, and describe vector indexes
- Search Operations: Perform vector similarity searches and full-text searches with scalar attribute filtering
- Integration: Works with MCP-compatible applications like Claude Desktop and Cursor
Provides access to Baidu Cloud Vector Database, offering tools for database management, table operations, vector indexing, and similarity search capabilities.
Supports configuration via .env files for storing connection details and API keys for the Baidu Vector Database service.
Provides specific configuration paths and instructions for macOS users of Claude Desktop.
Requires Python 3.10+ as the runtime environment for the MCP server implementation.
百度向量数据库MCP Server
本代码仓库包含一个 MCP 服务器,它提供对百度云向量数据库功能的访问。
前提条件
在使用百度云向量数据库MCP Server之前,请确保你具备以下条件:
- Python 3.10 或更高版本
- 已安装uv用于运行MCP Server
使用方式
使用百度云向量数据库MCP Server的推荐方式是通过uv
运行,而无需进行安装。
克隆代码仓库,执行以下命令:
随后,你可以直接通过uv
运行,其中endpoint
和api-key
根据实际需要修改:
或者,在src/mochow_mcp_server/
目录中修改.env
文件来设置环境变量,再使用以下命令运行服务器:
支持的应用程序
百度云向量数据库MCP Server可以与各种支持模型上下文协议的大语言模型应用程序配合使用:
- Claude Desktop:Anthropic 公司为 Claude 开发的桌面应用程序
- Cursor:支持 MCP 的人工智能代码编辑器
- 自定义 MCP 客户端:任何实现 MCP 客户端规范的应用程序
在Claude Desktop中的使用方式
从https://claude.ai下载 Claude Desktop。
打开 Claude Desktop 的配置文件,在 macOS 系统中,路径为~/Library/Application Support/Claude/claude_desktop_config.json
。
添加以下配置:
重启 Claude Desktop。
在 Cursor 中的使用方法
Cursor 也支持 MCP工具。你可以通过两种方式将百度MCP Server添加到Cursor中:
依次打开Cursor设置
>功能
>MCP
,点击+添加新的MCP服务器
按钮,在mcp.json
中添加以下配置:
重启 Cursor 或重新加载窗口。
可用工具
百度云向量数据库MCP Server提供以下工具:
Database操作
list_databases
: 列出数据库中所有的Databasecreate_database
: 创建一个新的Database- 参数:
database_name
: 待创建的Database名称
- 参数:
use_database
: 切换到一个已存在的Database- 参数:
database_name
: 待切换的Database名称
- 参数:
Table操作
list_tables
: 列出数据库中所有的Tabledescribe_table
: 获取指定Table的详细信息- 参数:
table_name
: Table名称
- 参数:
stats_table
: 获取指定Table的统计信息- 参数:
table_name
: Table名称
- 参数:
数据操作
delete_table_rows
: 使用过滤表达式删除数据- 参数:
table_name
: Table名称filter_expr
: 过滤表达式
- 参数:
select_table_rows
: 使用过滤表达式查询数据- 参数:
table_name
: Table名称filter_expr
: 过滤表达式limit
: 查询结果的最大条数output_fields
: 查询结果中要返回的字段名
- 参数:
索引操作
create_vector_index
: 在指定向量字段上创建向量索引- 参数:
table_name
: Table名称index_name
: 向量索引名称field_name
: 向量字段名称index_type
: 向量索引类型metric_type
: 向量索引的距离度量params
: 向量索引的创建参数
- 参数:
rebuild_vector_index
: 重新构建指定向量索引- 参数:
table_name
: Table名称index_name
: 向量索引名称
- 参数:
drop_vector_index
: 删除指定向量索引- 参数:
table_name
: Table名称index_name
: 向量索引名称
- 参数:
describe_index
: 获取指定索引的详情信息- 参数:
table_name
: Table名称index_name
: 向量索引名称
- 参数:
检索操作
vector_search
: 执行带标量过滤的向量相似性检索- 参数:
table_name
: Table名称vector
: 向量vector_field
: 向量字段名称limit
: 相似性检索结果中返回最接近目标向量的记录数量filter_expr
: 过滤表达式output_fields
: 查询结果中要返回的字段名
- 参数:
fulltext_search
: 执行全文检索- 参数:
table_name
: Table名称index_name
: 向量索引名称search_text
: 全文检索的检索表达式limit
: 全文检索返回相关性最高的条目数filter_expr
: 过滤表达式output_fields
: 查询结果中要返回的字段名
- 参数:
环境变量
MOCHOW_ENDPOINT
: 百度云向量数据库连接实例URIMOCHOW_API_KEY
: 百度云向量数据库实例API密钥
使用样例
使用Claude Desktop
Example 1: 列出数据库中所有的Database
Claude将使用百度云向量数据库MCP Server提供的list_databases来获取数据库列表.
Example 2: 查看指定表的schema信息
Claude将使用百度云向量数据库MCP Server提供的describe_table来获取表的详情信息.
You must be authenticated.
Tools
A server that provides access to Baidu Cloud Vector Database functionality through the Model Context Protocol, enabling LLM applications to perform vector searches and database operations via natural language.
Related Resources
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server providing vector database capabilities through Chroma, enabling semantic document search, metadata filtering, and document management with persistent storage.Last updated -17PythonMIT License
- -securityAlicense-qualityAn integration server implementing the Model Context Protocol that enables LLM applications to interact with Milvus vector database functionality, allowing vector search, collection management, and data operations through natural language.Last updated -122PythonApache 2.0
- -securityAlicense-qualityA Model Context Protocol server that enables Claude and other LLMs to perform database operations and invoke Edge Functions within Supabase through natural language.Last updated -TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables semantic search capabilities by providing tools to manage Qdrant vector database collections, process and embed documents using various embedding services, and perform semantic searches across vector embeddings.Last updated -89TypeScriptMIT License