MCP Server for ArangoDB

by ravenwits

Integrations

  • Provides database interaction capabilities with ArangoDB, implementing core operations like executing AQL queries, inserting/updating/removing documents, creating and listing collections, and backing up data to JSON files.

ArangoDB 的 MCP 服务器

ArangoDB 的模型上下文协议服务器

这是一个基于 TypeScript 的 MCP 服务器,通过 ArangoDB 提供数据库交互功能。它实现了核心数据库操作,并允许通过 MCP 工具与 ArangoDB 无缝集成。您可以将其与 Claude 应用程序一起使用,也可以与 Cline 等兼容 mcp 的 VSCode 扩展一起使用!

特征

工具

  • arango_query - 执行 AQL 查询
    • 将 AQL 查询字符串作为必需参数
    • 可选地接受参数化查询的绑定变量
    • 以 JSON 格式返回查询结果
  • arango_insert - 将文档插入集合
    • 将集合名称和文档对象作为必需参数
    • 如果未提供,则自动生成文档密钥
    • 返回创建的文档元数据
  • arango_update - 更新现有文档
    • 将集合名称、文档键和更新对象作为必需参数
    • 返回更新后的文档元数据
  • arango_remove - 从集合中删除文档
    • 将集合名称和文档键作为必需参数
    • 返回已删除的文档元数据
  • arango_backup - 将所有集合备份到 JSON 文件
    • 将输出目录路径作为必需参数
    • 使用当前数据为每个集合创建 JSON 文件
    • 对于数据备份和迁移有用
  • arango_list_collections - 列出数据库中的所有集合
    • 返回集合信息数组,包括名称、ID 和类型
  • arango_create_collection - 在数据库中创建一个新的集合
    • 将集合名称作为必需参数
    • 可选地指定集合类型(文档或边缘集合)
    • 为写入操作配置 waitForSync 行为
    • 返回集合信息,包括名称、类型和状态

安装

通过 NPM 安装

要通过 NPM 全局安装arango-server ,请运行以下命令:

npm install -g arango-server

通过 NPX 运行

要直接运行arango-server而不进行安装,请使用以下命令:

npx arango-server

配置 VSCode 代理

要将arango-server与 VSCode Copilot 代理一起使用,您必须至少安装 VSCode 1.99.0并按照以下步骤操作:

  1. 创建或编辑 MCP 配置文件
    • 工作区特定配置:在您的工作区中创建或编辑.vscode/mcp.json文件。
    • 用户特定配置:可选地,在设置(mcp) VS Code用户设置中指定服务器,以在所有工作区中启用 MCP 服务器。提示:您可以参考VSCode 的 MCP 配置文档 来了解有关如何设置配置文件的更多详细信息。
  2. 添加以下配置
    { "servers": { "arango-mcp": { "type": "stdio", "command": "npx", "args": ["arango-server"], "env": { "ARANGO_URL": "http://localhost:8529", "ARANGO_DB": "v20", "ARANGO_USERNAME": "app", "ARANGO_PASSWORD": "75Sab@MYa3Dj8Fc" } } } }
  3. 启动 MCP 服务器
    • 在 VSCode 中打开命令面板(在 Mac 上Ctrl+Shift+PCmd+Shift+P )。
    • 运行命令MCP: Start Server并从列表中选择arango-mcp
  4. 验证服务器
    • 在 VSCode 中打开聊天视图并切换到代理模式。
    • 使用Tools按钮验证arango-server工具是否可用。

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 ArangoDB:

npx -y @smithery/cli install @ravenwits/mcp-server-arangodb --client claude
与 Claude Desktop 一起使用

前往: Settings > Developer > Edit Config

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
与 Cline VSCode 扩展一起使用

前往: Cline Extension > MCP Servers > Edit Configuration

  • MacOS: ~/Library/Application Support/Code/User/globalStorage/cline.cline/config.json
  • Windows: %APPDATA%/Code/User/globalStorage/cline.cline/config.json

将以下配置添加到mcpServers部分:

{ "mcpServers": { "arango": { "command": "node", "args": ["/path/to/arango-server/build/index.js"], "env": { "ARANGO_URL": "your_database_url", "ARANGO_DB": "your_database_name", "ARANGO_USERNAME": "your_username", "ARANGO_PASSWORD": "your_password" } } } }

环境变量

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

  • ARANGO_URL - ArangoDB 服务器 URL(注意:8529 是 ArangoDB 用于本地开发的默认端口)
  • ARANGO_DB数据库名称
  • ARANGO_USERNAME - 数据库用户
  • ARANGO_PASSWORD - 数据库密码

用法

您几乎可以提供任何有意义的提示,Claude 就会尝试执行适当的功能。

一些示例提示:

  • “列出数据库中的所有集合”
  • “查询所有用户”
  • “插入一个名为‘John Doe’的新文档,并将电子邮件“ john@example.com ”发送到‘用户’集合”
  • “使用密钥‘123456’或名称‘Jane Doe’更新文档,将年龄更改为 48 岁”
  • “创建一个名为‘产品’的新集合”

与 Claude App 一起使用

使用 Cline VSCode 扩展

查询所有用户:

{ "query": "FOR user IN users RETURN user" }

插入新文档:

{ "collection": "users", "document": { "name": "John Doe", "email": "john@example.com" } }

更新文档:

{ "collection": "users", "key": "123456", "update": { "name": "Jane Doe" } }

删除文档:

{ "collection": "users", "key": "123456" }

列出所有收藏集:

{ } // No parameters required

备份数据库集合:

{ "outputDir": "./backup" // Specify an absolute output directory path for the backup files (optional) "collection": "users" // Specify a collection name to backup (optional) If no collection name is provided, all collections will be backed up "docLimit": 1000 // Specify the maximum number of documents to backup per collection (optional), if not provided, all documents will be backed up (not having a limit might cause timeout for large collections) }

创建新集合:

{ "name": "products", "type": "document", // "document" or "edge" (optional, defaults to "document") "waitForSync": false // Optional, defaults to false }

注意:该服务器与数据库结构无关,只要遵循 ArangoDB 的文档和边缘集合模型,就可以使用任何集合名称或结构。

免责声明

仅供开发使用

此工具仅适用于本地开发环境。虽然从技术上讲,它可以连接到生产数据库,但这会带来严重的安全风险,因此我们明确不建议这样做。我们仅将其用于开发数据库,以保持关注点分离并保护生产数据。

发展

  1. 克隆存储库
  2. 安装依赖项:
    npm run build
  3. 对于使用自动重建的开发:
    npm run watch

调试

由于 MCP 服务器通过 stdio 进行通信,因此调试可能具有挑战性。建议使用MCP Inspector进行开发调试:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

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

基于 TypeScript 的服务器使用模型上下文协议与 ArangoDB 交互,实现数据库操作并与 Claude 和 VSCode 扩展等工具集成,从而简化数据管理。

  1. Features
    1. Tools
  2. Installation
    1. Installing via NPM
    2. Running via NPX
    3. Configuring for VSCode Agent
    4. Installing via Smithery
    5. Environment Variables
  3. Usage
    1. Usage with Claude App
    2. Uasge with Cline VSCode extension
  4. Disclaimer
    1. For Development Use Only
  5. Development
    1. Debugging
  6. License

    Related MCP Servers

    • A
      security
      A
      license
      A
      quality
      A production-ready template for building Model Context Protocol servers in TypeScript, offering fast development with Bun, Biome linting, and automated version management.
      Last updated -
      1
      14
      JavaScript
      MIT License
    • A
      security
      F
      license
      A
      quality
      A TypeScript-based template for developing Model Context Protocol servers with features like dependency injection and service-based architecture, facilitating the creation and integration of custom data processing tools.
      Last updated -
      1
      2
      TypeScript
    • A
      security
      F
      license
      A
      quality
      Enables querying Supabase databases and generating TypeScript types through the Model Context Protocol interface, supporting features like schema selection, column filtering, and pagination.
      Last updated -
      2
      9
      JavaScript
      • Apple
      • Linux
    • -
      security
      A
      license
      -
      quality
      An implementation of the Model Context Protocol that enables interaction with ArangoDB databases, allowing users to perform queries, list databases and collections through natural language.
      Last updated -
      8
      3
      JavaScript
      MIT License

    View all related MCP servers

    ID: soeqalh2v9