GreptimeDB MCP Server

Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.

Local serverstdioGo

What is the GreptimeDB MCP server?

GreptimeDB becomes available to MCP clients through the greptimedb mcp server. Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.

What GreptimeDB does

A Model Context Protocol (MCP) server for GreptimeDB — an open-source observability database that handles metrics, logs, and traces in one engine.

Tools it exposes

Once connected, the assistant can call these 7 tools directly:

  • execute_sql — Execute SQL queries with format (csv/json/markdown) and limit options
  • execute_tql — Execute TQL (PromQL-compatible) queries for time-series analysis
  • query_range — Execute time-window aggregation queries with RANGE/ALIGN syntax
  • describe_table — Inspect a table profile: schema, semantic metadata, latest sample rows, and query guidance
  • explain_query — Analyze SQL or TQL query execution plans (analyze=true for runtime stats; add verbose=true alongside analyze=true for per-partition scan metrics and
  • health_check — Check database connection status and server version
  • Tools — The Tools tool exposed by this server

Installing the greptimedb mcp server

The server is distributed via npm as @modelcontextprotocol/inspector, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

The server reads 2 environment variables: GREPTIMEDB_HOST, GREPTIMEDB_LISTEN_HOST. Keep credentials in your client's env block or a secrets manager rather than committing them.

Where it fits

Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. GreptimeDB sits in that group, and the shape of its toolset — execute_sql, execute_tql, query_range among others — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • With 7 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use GreptimeDB.
  • Written in Go.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the greptimedb mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
execute_sqlExecute SQL queries with format (csv/json/markdown) and limit options
execute_tqlExecute TQL (PromQL-compatible) queries for time-series analysis
query_rangeExecute time-window aggregation queries with RANGE/ALIGN syntax
describe_tableInspect a table profile: schema, semantic metadata, latest sample rows, and query guidance
explain_queryAnalyze SQL or TQL query execution plans (analyze=true for runtime stats; add verbose=true alongside analyze=true for per-partition scan metrics and index-pruning counters)
health_checkCheck database connection status and server version
ToolsThe Tools tool exposed by this server.

How to install the GreptimeDB MCP server

{
  "mcpServers": {
    "greptimedb": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/inspector"],
      "env": {
        "GREPTIMEDB_HOST": "your-value",
        "GREPTIMEDB_LISTEN_HOST": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
GREPTIMEDB_HOSTEndpoint or connection string the server talks to.Optional
GREPTIMEDB_LISTEN_HOSTEndpoint or connection string the server talks to.Optional

Example prompts to try

  • Use GreptimeDB to execute sql.
  • Use GreptimeDB to execute tql.
  • Use GreptimeDB to query range.

Frequently asked questions

It connects GreptimeDB to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (execute_sql, execute_tql, query_range, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with GreptimeDB directly.