UniCloudDB-MCP

UniCloudDB-MCP

A database operation tool for uniCloud based on MCP protocol that allows AI assistants to perform database CRUD operations through standardized interfaces.

Category
Visit Server

README

UniCloudDB-MCP

NPM version Node.js Version License

基于 MCP 协议的 uniCloud 数据库操作工具,支持通过 AI 助手进行数据库 CRUD 操作。

功能特点

  • 支持标准化的 MCP 协议工具集成
  • 提供完整的 JQL 格式数据库操作接口
  • 支持查询、添加、更新和删除等常用操作
  • 简单易用的 API 设计
  • 适配主流的 AI 模型工具调用

安装

npm install uniclouddb-mcp

基本配置

环境变量配置

你可以通过环境变量配置数据库服务参数:

# .env 文件
DB_SERVICE_URL=https://你的uniCloud云函数URL/mcp
REQUEST_TIMEOUT=30000

使用方法

1. 启动 MCP 服务

# 直接启动服务
npm start

# 开发模式(自动重载)
npm run dev

2. 作为 JS 模块使用

// 导入并启动 MCP 服务
import { main } from 'uniclouddb-mcp';
main();

// 直接使用数据库操作函数
import { 
  queryDatabase, 
  addToDatabase, 
  updateDatabase, 
  removeFromDatabase 
} from 'uniclouddb-mcp/database.js';

// 查询示例
const result = await queryDatabase(
  'collection_name',  // 集合名称
  { status: 'active' },  // 查询条件
  {
    field: { name: 1, age: 1 },  // 返回字段
    limit: 10,  // 返回数量限制
    skip: 0,  // 跳过记录数
    orderBy: { field: 'createdAt', order: 'desc' }  // 排序
  }
);

// 添加示例
await addToDatabase(
  'collection_name',  // 集合名称
  { name: '测试', age: 25 }  // 添加的数据
);

// 更新示例
await updateDatabase(
  'collection_name',  // 集合名称
  { _id: 'document_id' },  // 更新条件
  { age: 26 }  // 更新数据
);

// 删除示例
await removeFromDatabase(
  'collection_name',  // 集合名称
  { _id: 'document_id' }  // 删除条件
);

MCP 工具说明

本库提供以下 MCP 工具,可供 AI 助手直接调用:

1. mcp_uniclouddb_query - 查询数据

参数:

  • collection: 集合名称
  • where: 查询条件(JQL 格式)
  • field(可选): 返回字段
  • limit(可选): 返回数量限制
  • skip(可选): 跳过记录数
  • orderBy(可选): 排序条件

2. mcp_uniclouddb_add - 添加数据

参数:

  • collection: 集合名称
  • data: 要添加的数据(JQL 格式)

3. mcp_uniclouddb_update - 更新数据

参数:

  • collection: 集合名称
  • where: 更新条件(JQL 格式)
  • data: 要更新的数据(JQL 格式)

4. mcp_uniclouddb_remove - 删除数据

参数:

  • collection: 集合名称
  • where: 删除条件(JQL 格式)

数据库连接测试

使用内置测试工具验证数据库连接和基本功能:

npm test

系统要求

  • Node.js >= 18.0.0
  • 已部署的 uniCloud 云函数

uniCloud 云函数集成

本工具需要搭配 uniCloud 云函数使用,请确保已部署对应的处理函数。 云函数接收标准 JQL 格式请求,处理数据库操作并返回结果。

安全提示

  • 生产环境中建议配置访问控制和身份验证
  • 避免在公开环境中暴露数据库 URL
  • 定期更新依赖包以修复潜在安全问题

许可证

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured