MarkLogic MCP Server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Enables document querying using MarkLogic's CTS query capabilities with pagination support for filtering collections and content

  • Provides TypeScript interfaces and client libraries for interacting with MarkLogic document operations programmatically

MCP MarkLogic 服务器

这是 MarkLogic 的模型上下文协议 (MCP) 服务器实现,允许您通过 MCP 工具与 MarkLogic 数据库进行交互。

  1. 服务器提供以下操作:

创建文档

  • 使用可选集合在 MarkLogic 中创建文档
  • 通过 URI 读取文档
  • 根据 URI 删除文档
  • 使用查询字符串和可选的集合过滤器搜索文档

安装

pip install mcp-marklogic

配置

服务器需要以下环境变量:

MARKLOGIC_HOST=localhost MARKLOGIC_PORT=8000 MARKLOGIC_USERNAME=admin MARKLOGIC_PASSWORD=admin

用法

安装并配置完成后,您可以启动服务器:

mcp-marklogic

可用工具

  1. create-document
    • 在 MarkLogic 中创建新文档
    • 参数:
      • uri :文档 URI(必需)
      • content :JSON 格式的文档内容(必需)
      • collections :要添加文档的集合列表(可选)
  2. read-document
    • 从 MarkLogic 阅读文档
    • 参数:
      • uri :文档 URI(必需)
  3. delete-document
    • 从 MarkLogic 中删除文档
    • 参数:
      • uri :文档 URI(必需)
  4. search-documents
    • 在 MarkLogic 中搜索文档
    • 参数:
      • query :搜索查询字符串(必需)
      • collections :要搜索的集合列表(可选)

发展

设置

  1. 克隆存储库
  2. 创建虚拟环境并激活它
  3. 安装依赖项:
    pip install -e .

运行测试

pytest tests/

MarkLogic 设置

  1. 确保已安装并运行 MarkLogic Server
  2. 如果尚未存在,请在端口 8000 上创建 REST API 实例
  3. 创建具有适当权限的用户:
    • 进入管理界面(通常是http://localhost:8001
    • 使用以下命令创建角色python-docs-role
      • 角色: rest-extension-userrest-readerrest-writer
      • 权限: xdbc:evalxdbc:invokexdmp:eval-in
    • 使用以下命令创建用户python-user
      • 密码: pyth0n
      • 角色: python-docs-role

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

MarkLogic 的模型上下文协议服务器,可通过客户端界面实现 CRUD 操作和文档查询功能。

  1. Create Document
    1. Installation
      1. Configuration
        1. Usage
          1. Available Tools
        2. Development
          1. Setup
          2. Running Tests
          3. MarkLogic Setup
        3. License
          ID: mezrylp34m