Mcp 服务器用于 Arangodb
这是一个基于 TypeScript 的 MCP 服务器,通过 ArangoDB 提供数据库交互功能。它实现了核心数据库操作,并允许通过 MCP 工具与 ArangoDB 无缝集成。您可以将其与 Claude 应用程序一起使用,也可以与像 Cline 这样的 VSCode 扩展一起使用。
概览
什么是 MCP Server ArangoDB?
MCP Server ArangoDB 是一个基于 TypeScript 的服务器,旨在通过 ArangoDB 促进数据库交互。它作为中间件实现基本的数据库操作,使各种 MCP 工具能够无缝集成。这个服务器对于希望通过强大的数据库功能增强其应用程序的开发人员特别有用。
MCP Server ArangoDB 的特点
- TypeScript 支持:使用 TypeScript 构建,确保类型安全和更好的开发体验。
- 数据库操作:实现创建、读取、更新和删除(CRUD)等核心操作,以高效管理数据。
- 与 ArangoDB 集成:允许与 ArangoDB 轻松集成,ArangoDB 是一个支持文档、图形和键/值数据模型的多模型数据库。
- 与 MCP 工具兼容:与 MCP 工具无缝协作,增强应用程序(如 Claude 和 Visual Studio Code (VSCode) 扩展)的功能。
- 开源:该项目公开可用,鼓励社区贡献和合作。
如何使用 MCP Server ArangoDB
-
安装:从 GitHub 克隆仓库,并使用 npm 或 yarn 安装必要的依赖项。
git clone https://github.com/ravenwits/mcp-server-arangodb.git cd mcp-server-arangodb npm install
-
配置:在配置文件中设置你的 ArangoDB 连接详细信息。确保你的数据库正在运行并可访问。
-
运行服务器:使用以下命令启动服务器:
npm start
-
API 使用:利用提供的 API 端点执行数据库操作。请参考文档以获取详细的 API 规范和示例。
-
集成:将 MCP 服务器与您的应用程序集成,利用其能力有效管理数据。
常见问题解答
什么是 ArangoDB?
ArangoDB 是一个多模型数据库,支持多种数据模型,包括文档、图形和键/值。它旨在灵活性和可扩展性,适合广泛的应用程序。
我可以为 MCP Server ArangoDB 项目做贡献吗?
可以!MCP Server ArangoDB 是一个开源项目,欢迎贡献。您可以分叉仓库,进行更改,并提交拉取请求以供审查。
MCP Server ArangoDB 有文档吗?
有,仓库中提供了全面的文档。它包括设置说明、API 参考和示例,帮助您入门。
我如何报告问题或请求功能?
您可以通过在 GitHub 仓库中打开问题来报告问题或请求功能。请确保提供详细信息,以帮助维护者理解您的请求。
MCP Server ArangoDB 使用什么许可证?
MCP Server ArangoDB 采用 MIT 许可证,允许自由使用、修改和分发。
详情
MCP Server for ArangoDB
A Model Context Protocol server for ArangoDB
This is a TypeScript-based MCP server that provides database interaction capabilities through ArangoDB. It implements core database operations and allows seamless integration with ArangoDB through MCP tools. You can use it wih Claude app and also extension for VSCode that works with mcp like Cline!
Features
Tools
-
arango_query
- Execute AQL queries- Takes an AQL query string as required parameter
- Optionally accepts bind variables for parameterized queries
- Returns query results as JSON
-
arango_insert
- Insert documents into collections- Takes collection name and document object as required parameters
- Automatically generates document key if not provided
- Returns the created document metadata
-
arango_update
- Update existing documents- Takes collection name, document key, and update object as required parameters
- Returns the updated document metadata
-
arango_remove
- Remove documents from collections- Takes collection name and document key as required parameters
- Returns the removed document metadata
-
arango_backup
- Backup all collections to JSON files- Takes output directory path as required parameter
- Creates JSON files for each collection with current data
- Useful for data backup and migration purposes
-
arango_list_collections
- List all collections in the database- Returns array of collection information including names, IDs, and types
-
arango_create_collection
- Create a new collection in the database- Takes collection name as required parameter
- Optionally specify collection type (document or edge collection)
- Configure waitForSync behavior for write operations
- Returns collection information including name, type, and status
Installation
Installing via NPM
To install arango-server
globally via NPM, run the following command:
npm install -g arango-server
Running via NPX
To run arango-server
directly without installation, use the following command:
npx arango-server
Configuring for VSCode Agent
To use arango-server
with the VSCode Copilot agent, you must have at least VSCode 1.99.0 installed and follow these steps:
-
Create or edit the MCP configuration file:
-
Workspace-specific configuration: Create or edit the
.vscode/mcp.json
file in your workspace. -
User-specific configuration: Optionally, specify the server in the setting(mcp) VS Code user settings to enable the MCP server across all workspaces.
Tip: You can refer here to the MCP configuration documentation of VSCode for more details on how to set up the configuration file.
-
-
Add the following configuration:
{ "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" } } } }
-
Start the MCP server:
- Open the Command Palette in VSCode (
Ctrl+Shift+P
orCmd+Shift+P
on Mac). - Run the command
MCP: Start Server
and selectarango-mcp
from the list.
- Open the Command Palette in VSCode (
-
Verify the server:
- Open the Chat view in VSCode and switch to Agent mode.
- Use the
Tools
button to verify that thearango-server
tools are available.
Installing via Smithery
To install ArangoDB for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ravenwits/mcp-server-arangodb --client claude
To use with Claude Desktop
Go to: Settings > Developer > Edit Config
or
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
To use with Cline VSCode Extension
Go to: Cline Extension > MCP Servers > Edit Configuration
or
- MacOS:
~/Library/Application Support/Code/User/globalStorage/cline.cline/config.json
- Windows:
%APPDATA%/Code/User/globalStorage/cline.cline/config.json
Add the following configuration to the mcpServers
section:
{
"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"
}
}
}
}
Environment Variables
The server requires the following environment variables:
ARANGO_URL
- ArangoDB server URL (note: 8529 is the default port for ArangoDB for local development)ARANGO_DB
- Database nameARANGO_USERNAME
- Database userARANGO_PASSWORD
- Database password
Usage
You can pretty much provide any meaningful prompt and Claude will try to execute the appropriate function.
Some example propmts:
- "List all collections in the database"
- "Query all users"
- "Insert a new document with name 'John Doe' and email "john@example.com' to the 'users' collection"
- "Update the document with key '123456' or name 'Jane Doe' to change the age to 48"
- "Create a new collection named 'products'"
Usage with Claude App
Uasge with Cline VSCode extension
Query all users:
{
"query": "FOR user IN users RETURN user"
}
Insert a new document:
{
"collection": "users",
"document": {
"name": "John Doe",
"email": "john@example.com"
}
}
Update a document:
{
"collection": "users",
"key": "123456",
"update": {
"name": "Jane Doe"
}
}
Remove a document:
{
"collection": "users",
"key": "123456"
}
List all collections:
{
} // No parameters required
Backup database collections:
{
"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)
}
Create a new collection:
{
"name": "products",
"type": "document", // "document" or "edge" (optional, defaults to "document")
"waitForSync": false // Optional, defaults to false
}
Note: The server is database-structure agnostic and can work with any collection names or structures as long as they follow ArangoDB's document and edge collection models.
Disclaimer
For Development Use Only
This tool is designed for local development environments only. While technically it could connect to a production database, this would create significant security risks and is explicitly discouraged. We use it exclusively with our development databases to maintain separation of concerns and protect production data.
Development
-
Clone the repository
-
Install dependencies:
npm run build
-
For development with auto-rebuild:
npm run watch
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. recommended debugging can be done by using MCP Inspector for development:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Server配置
{
"mcpServers": {
"mcp-server-arangodb": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--ravenwits--mcp-server-arangodb--mcp-server-arangodb",
"npm run start"
],
"env": {
"ARANGO_URL": "arango-url",
"ARANGO_DB": "arango-db",
"ARANGO_USERNAME": "arango-username",
"ARANGO_PASSWORD": "arango-password"
}
}
}
}