GreptimeDB MCP 服务器

GreptimeDB MCP 服务器

为 GreptimeDB 提供安全数据库访问的模型上下文协议(MCP)服务器实现。

快速入门

安装

使用以下命令安装:

pip install greptimedb-mcp-server

配置

设置环境变量或通过命令行参数配置:

GREPTIMEDB_HOST=localhost
GREPTIMEDB_PORT=4002
GREPTIMEDB_USER=root
GREPTIMEDB_PASSWORD=
GREPTIMEDB_DATABASE=public

使用

将服务器集成到 Claude Desktop 中,修改配置文件 claude_desktop_config.json

{
  "mcpServers": {
    "greptimedb": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/greptimedb-mcp-server",
        "run",
        "-m",
        "greptimedb_mcp_server.server"
      ],
      "env": {
        "GREPTIMEDB_HOST": "localhost",
        "GREPTIMEDB_PORT": "4002",
        "GREPTIMEDB_USER": "root",
        "GREPTIMEDB_PASSWORD": "",
        "GREPTIMEDB_DATABASE": "public"
      }
    }
  }
}

开发

克隆仓库并安装依赖:

git clone https://github.com/GreptimeTeam/greptimedb-mcp-server.git
cd greptimedb-mcp-server
python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
pytest