Couchbase MCP Server for LLMs

by Aniket310101
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Supports configuration through environment variables in a .env file, enabling secure storage of Couchbase credentials.

  • Enables interaction with Couchbase databases, allowing querying buckets, performing CRUD operations on documents, managing scopes and collections, executing N1QL queries, and handling index operations.

  • Uses Git for version control and installation through the git clone command.

🗄️ 适用于法学硕士的 Couchbase MCP 服务器

模型上下文协议 (MCP) 服务器,使 LLM 能够直接与 Capella 集群上的 Couchbase 数据库交互。查询存储桶、执行 CRUD 操作、执行 N1QL 查询,并通过自然语言无缝管理数据。

🚀 快速入门

  1. 先决条件
    • Node.js 16 或更高版本
    • Capella 上正在运行的 Couchbase 实例
    • Claude桌面应用程序
  2. 安装Couchbase MCP Server 可以通过两种方式安装:

选项 1:使用 NPX(推荐)

最快的入门方式是使用 NPX:

npx -y @couchbasedatabase/couchbase-mcp

选项 2:手动安装

如果您希望手动克隆并运行项目:

# Clone the repository git clone https://github.com/Aniket310101/MCP-Server-Couchbase.git cd MCP-Server-Couchbase # Install dependencies npm install # Build the project npm run build
  1. Claude 桌面集成将此配置添加到您的 Claude Desktop 配置文件:Windows%APPDATA%/Claude/claude_desktop_config.json
    MacOS~/Library/Application Support/Claude/claude_desktop_config.json

选项 1:使用软件包安装

{ "mcpServers": { "couchbase": { "command": "npx", "args": ["-y", "@couchbasedatabase/couchbase-mcp"], "env": { "COUCHBASE_URL": "<COUCHBASE CONNECTION STRING>", "COUCHBASE_BUCKET": "<BUCKET NAME>", "COUCHBASE_USERNAME": "<COUCHBASE USERNAME>", "COUCHBASE_PASSWORD": "<COUCHBASE PASSWORD>" } } } }

选项 2:手动安装

{ "mcpServers": { "couchbase": { "command": "node", "args": ["path/to/MCP-Server-Couchbase/dist/index.js"], "env": { "COUCHBASE_URL": "<COUCHBASE CONNECTION STRING>", "COUCHBASE_BUCKET": "<BUCKET NAME>", "COUCHBASE_USERNAME": "<COUCHBASE USERNAME>", "COUCHBASE_PASSWORD": "<COUCHBASE PASSWORD>" } } } }
  1. 验证连接
    • 重启Claude桌面
    • Couchbase MCP 服务器工具现在应该可以在您的对话中使用

📝 可用工具

基本操作

  • query :执行 N1QL 查询
  • listBuckets :列出可用的 bucket

范围管理

  • createScope :在 bucket 中创建一个新范围
  • deleteScope :删除现有范围
  • listScopes :列出存储桶中的所有范围

收藏管理

  • createCollection :在范围内创建新集合
  • dropCollection :从范围中删除集合

文档操作

  • createDocument :创建新文档
  • getDocument :通过 ID 检索文档
  • updateDocument :更新现有文档
  • deleteDocument :通过 ID 删除文档
  • bulkCreateDocuments :一次创建多个文档

指数管理

  • createIndex :在指定字段上创建新索引
  • createPrimaryIndex :在集合上创建主索引
  • listIndexes :列出存储桶中的所有索引
  • dropIndex :删除现有索引

每个工具都支持可选的collectionscope参数,以针对特定的数据容器。

🔒 安全注意事项

  • 始终对敏感凭据使用环境变量
  • 考虑在生产环境中使用反向代理运行服务器
  • 根据需要实施适当的访问控制和身份验证

📚 示例

以下是使用 MCP 服务器与 Claude 进行交互的一些示例:

  1. 列出所有存储桶:
    Could you show me all available buckets in the database?
  2. 创建范围和集合:
    Create a new scope called "users" and a collection called "profiles" in it
  3. 查询文件:
    Find all users who signed up in the last 30 days
  4. 创建文档:
    Create a new user document with name "John Doe" and email "john@example.com"

🤝 贡献

欢迎贡献代码!欢迎提交 Pull 请求。

-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器,使大型语言模型能够通过自然语言直接与 Couchbase 数据库交互,支持查询存储桶、执行 CRUD 操作和执行 N1QL 查询等操作。

  1. 🚀 Quick Start
    1. Option 1: Using NPX (Recommended)
    2. Option 2: Manual Installation
    3. Option 1: With Package Installation
    4. Option 2: With Manual Installation
  2. 📝 Available Tools
    1. Basic Operations
    2. Scope Management
    3. Collection Management
    4. Document Operations
    5. Index Management
  3. 🔒 Security Considerations
    1. 📚 Examples
      1. 🤝 Contribution
        ID: 6dmabx5n90