返回市场
MCP服务器

MCP服务器

作者:appwrite59 星标更新:2025-10-11

项目介绍

Appwrite MCP 服务器

mcp-name: io.github.appwrite/mcp-for-api

安装MCP服务器

概览

这是一个用于与Appwrite API交互的Model Context Protocol服务器。此服务器提供了管理数据库、用户、函数、团队等功能的工具,适用于您的Appwrite项目。

快速链接

配置

在启动MCP服务器之前,您必须设置一个Appwrite项目并创建一个具有必要作用域的API密钥。

在工作目录中创建一个.env文件,并添加以下内容:

APPWRITE_PROJECT_ID=your-project-id
APPWRITE_API_KEY=your-api-key
APPWRITE_ENDPOINT=https://<REGION>.cloud.appwrite.io/v1

然后,在终端中运行以下命令

Linux 和 MacOS

source .env

Windows

命令提示符

for /f "tokens=1,2 delims==" %A in (.env) do set %A=%B

PowerShell

Get-Content .\.env | ForEach-Object {
  if ($_ -match '^(.*?)=(.*)$') {
    [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2], "Process")
  }
}

安装

使用uv(推荐)

当使用uv时,不需要特定的安装步骤。我们将使用uvx直接运行mcp-server-appwrite

uvx mcp-server-appwrite [args]

使用pip

pip install mcp-server-appwrite

然后通过以下命令运行服务器

python -m mcp_server_appwrite [args]

命令行参数

无论是uv还是pip的设置过程都需要某些参数来启用各种Appwrite API的MCP工具。

当启用一个MCP工具时,该工具的定义会被传递给LLM,这会消耗模型可用上下文窗口中的令牌。因此,有效的上下文窗口会减少。

默认情况下,Appwrite MCP服务器仅启用Databases工具(我们最常用的API),以保持在这些限制内。可以通过使用下面的标志启用其他工具。

参数描述
--tables-db启用TablesDB API
--users启用Users API
--teams启用Teams API
--storage启用Storage API
--functions启用Functions API
--messaging启用Messaging API
--locale启用Locale API
-avatars启用Avatars API
--sites启用Sites API
--all启用所有Appwrite API
--databases启用Legacy Databases API

使用Claude Desktop

在Claude Desktop应用中,打开应用的设置页面(按CTRL + ,在Windows上或CMD + ,在MacOS上),然后转到开发者标签页。点击编辑配置按钮将带您进入claude_desktop_config.json文件,在其中添加以下内容:

{
  "mcpServers": {
    "appwrite": {
      "command": "uvx",
      "args": [
        "mcp-server-appwrite"
      ],
      "env": {
        "APPWRITE_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "APPWRITE_API_KEY": "<YOUR_API_KEY>",
        "APPWRITE_ENDPOINT": "https://<REGION>.cloud.appwrite.io/v1" // 可选
      }
    }
  }
}

注意:如果您看到uvx ENOENT错误,请确保您已经将uvx添加到了系统环境变量PATH中,或者在配置文件中使用uvx安装的完整路径。

成功配置后,您应该能够在Claude Desktop的可用服务器列表中看到该服务器。

Claude Desktop配置

使用Cursor

前往Cursor 设置 > MCP并点击添加新MCP服务器。选择类型为命令,并在命令字段中添加以下命令。

  • MacOS
env APPWRITE_API_KEY=your-api-key env APPWRITE_PROJECT_ID=your-project-id uvx mcp-server-appwrite
  • Windows
cmd /c SET APPWRITE_PROJECT_ID=your-project-id && SET APPWRITE_API_KEY=your-api-key && uvx mcp-server-appwrite

Cursor设置

使用Windsurf Editor

前往Windsurf 设置 > Cascade > Model Context Protocol (MCP) 服务器并点击查看原始配置。更新mcp_config.json文件,包括以下内容:

{
  "mcpServers": {
    "appwrite": {
      "command": "uvx",
      "args": [
        "mcp-server-appwrite"
      ],
      "env": {
        "APPWRITE_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "APPWRITE_API_KEY": "<YOUR_API_KEY>",
        "APPWRITE_ENDPOINT": "https://<REGION>.cloud.appwrite.io/v1" // 可选
      }
    }
  }
}

Windsurf设置

使用VS Code

配置

  1. 更新MCP配置文件:打开命令面板(Ctrl+Shift+PCmd+Shift+P)并运行MCP: 打开用户配置。它应该会在您的用户设置中打开mcp.json文件。

  2. 添加Appwrite MCP服务器配置:向mcp.json文件添加以下内容:

{
  "servers": {
    "appwrite": {
      "command": "uvx",
      "args": ["mcp-server-appwrite", "--users"],
      "env": {
        "APPWRITE_PROJECT_ID": "<YOUR_PROJECT_ID>",
        "APPWRITE_API_KEY": "<YOUR_API_KEY>",
        "APPWRITE_ENDPOINT": "https://<REGION>.cloud.appwrite.io/v1"
      }
    }
  }
}
  1. 启动MCP服务器:打开命令面板(Ctrl+Shift+PCmd+Shift+P)并运行MCP: 列出服务器。在下拉菜单中选择appwrite并点击启动服务器按钮。

  2. 在Copilot Chat中使用:打开Copilot Chat并切换到代理模式以访问Appwrite工具。

VS Code设置

本地开发

克隆仓库

git clone https://github.com/appwrite/mcp.git

安装uv

  • Linux 或 MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

准备虚拟环境

首先,创建一个虚拟环境。

uv venv

接下来,激活虚拟环境。

  • Linux 或 MacOS
source .venv/bin/activate
  • Windows
.venv\Scripts\activate

运行服务器

uv run -v --directory ./ mcp-server-appwrite

调试

您可以使用MCP检查器来调试服务器。

npx @modelcontextprotocol/inspector \
  uv \
  --directory . \
  run mcp-server-appwrite

确保在运行检查器之前正确配置了.env文件。然后可以在http://localhost:5173访问检查器。

许可证

此MCP服务器根据MIT许可证发布。这意味着您可以自由地使用、修改和分发软件,但需遵守MIT许可证的条款和条件。更多详情,请参见项目存储库中的LICENSE文件。