UNICLOUDDB-MCP
- other
About
What is UNICLOUDDB-MCP?
UNICLOUDDB-MCP is a tool that enables AI assistants to perform CRUD operations on uniCloud databases via the Model Context Protocol (MCP). It runs locally using Node.js (18+) and integrates with cloud functions deployed on uniCloud.
How to use UNICLOUDDB-MCP?
Install the package (npm install uniclouddb-mcp), then configure your MCP client with the command npx -y uniclouddb-mcp and set the DB_SERVICE_URL environment variable to your uniCloud cloud function’s HTTP URL. For local development, copy the mcp_service folder to your uniCloud cloud functions directory, upload the function, and enable URL‑based access. Optionally set REQUEST_TIMEOUT and provide a JSON configuration in your MCP client settings.
Key features of UNICLOUDDB-MCP
- Standardized MCP protocol integration for AI assistants
- Full JQL‑format database operations (query, add, update, remove)
- Simple, easy‑to‑use API
- Compatible with mainstream AI model tool calling
- Supports local execution and source code modification
- Built‑in test tool to verify database connectivity
Use cases of UNICLOUDDB-MCP
- Query documents from a uniCloud collection via natural language requests
- Insert new records or bulk‑add data to a database
- Update existing documents with JQL conditions
- Delete documents based on specified criteria
FAQ from UNICLOUDDB-MCP
What runtime and dependencies are required?
Node.js version 18.0.0 or higher, and a deployed uniCloud cloud function that can process JQL requests.
How do I configure the database connection?
Set the DB_SERVICE_URL environment variable to your uniCloud function’s URL, e.g., https://your‑function‑id.next.bspapp.com/mcp. Optionally adjust REQUEST_TIMEOUT (default 30000 ms).
Which AI models or MCP clients support UNICLOUDDB-MCP?
The package is designed to work with any MCP‑compatible client and adapts to mainstream AI models that support tool calls via the MCP protocol.
Is the tool free and open source?
Yes, it is released under the MIT license. No usage fees are mentioned.
Are there any security considerations?
In production, configure access control and authentication to protect your database endpoint. Avoid exposing the database URL in public environments and keep dependencies updated.
Details
- Author
- abuhtig
- Category
- other
- Repository
- abuhtig/uniclouddb-mcp
UniCloudDB-MCP
基于 MCP 协议的 uniCloud 数据库操作工具,支持通过 AI 助手进行数据库 CRUD 操作。
功能特点
- 支持标准化的 MCP 协议工具集成
- 提供完整的 JQL 格式数据库操作接口
- 支持查询、添加、更新和删除等常用操作
- 简单易用的 API 设计
- 适配主流的 AI 模型工具调用
- 支持本地运行,修改源码
直接配置MCP使用
{
"uniclouddb-mcp": {
"command": "npx",
"args": ["-y", "uniclouddb-mcp"],
"env": {
"DB_SERVICE_URL": "https://你的uniCloud云函数URL.next.bspapp.com/mcp"
}
}
}
本地运行使用方法
安装
npm install uniclouddb-mcp
环境变量配置
你可以通过环境变量配置数据库服务参数:
# config 文件
DB_SERVICE_URL=https://你的uniCloud云函数URL/mcp
REQUEST_TIMEOUT=30000
复制 mcp_service 文件夹到 自己项目的uniCloud/cloudfunctions 目录下并上传云函数
打开uniCloud web 控制台,找到mcp_service云函数,设置云函数URL化
设置通过HTTP或HTTPS访问本云函数的URL。域名在云函数列表界面绑定,此处仅设置path。 参考文档: https://uniapp.dcloud.io/uniCloud/http
设置mcp service
{
"uniclouddb": {
"name": "uniclouddb",
"key": "uniclouddb",
"command": "node",
"args":[
"D:\\uniCloudDB-mcp\\index.js"
],
"disabled": false,
"env": {}
}
}
MCP 工具说明
本库提供以下 MCP 工具,可供 AI 助手直接调用:
1. query - 查询数据
参数:
- collection: 集合名称
- where: 查询条件(JQL 格式)
- field(可选): 返回字段
- limit(可选): 返回数量限制
- skip(可选): 跳过记录数
- orderBy(可选): 排序条件
2. add - 添加数据
参数:
- collection: 集合名称
- data: 要添加的数据(object/array)
3. update - 更新数据
参数:
- collection: 集合名称
- where: 更新条件(JQL 格式)
- data: 要更新的数据(object)
4. remove - 删除数据
参数:
- collection: 集合名称
- where: 删除条件(JQL 格式)
数据库连接测试
使用内置测试工具验证数据库连接和基本功能:
npm test
系统要求
- Node.js >= 18.0.0
- 已部署的 uniCloud 云函数
uniCloud 云函数集成
本工具需要搭配 uniCloud 云函数使用,请确保已部署对应的处理函数。
云函数接收标准 JQL 格式请求,处理数据库操作并返回结果。
安全提示
- 生产环境中建议配置访问控制和身份验证
- 避免在公开环境中暴露数据库 URL
- 定期更新依赖包以修复潜在安全问题
许可证
MIT