MCP Directory

GreptimeDB MCP Server

Query and analyze GreptimeDB observability data (metrics, logs, traces) via SQL, TQL, and RANGE queries.

Unverified
stdio (local)
No auth
Python

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
pip install greptimedb-mcp-server

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "greptimedb-mcp-server": {
      "command": "greptimedb-mcp-server",
      "args": [
        "--host",
        "localhost",
        "--database",
        "public"
      ]
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Python with pip (install via `pip install greptimedb-mcp-server`)
  • A running GreptimeDB instance reachable via its MySQL protocol port (default 4002)
  • Optionally a read-only GreptimeDB user (recommended) and HTTP API port 4000 for pipeline/dashboard management
  • mcp>=1.8.0 required only for HTTP server mode (SSE / streamable-HTTP)

About GreptimeDB MCP Server

GreptimeDB MCP Server is the official MCP integration for GreptimeDB, an open-source observability database unifying metrics, logs, and traces. It exposes tools to run SQL, TQL (PromQL-compatible), and RANGE/ALIGN queries; inspect table profiles; explain query plans; check database health; and manage ingestion pipelines and Perses dashboards. A security gate enforces read-only access by default, masks sensitive columns, and audit-logs every tool call. Resources expose table data via greptime://<table>/data URIs, and built-in Jinja prompts assist with pipeline creation, metrics/PromQL/trace analysis, schema design, and query performance tuning. It connects over GreptimeDB's MySQL protocol port (4002) by default and can run over stdio, SSE, or streamable-HTTP.

Tools & capabilities (13)

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; verbose=true with analyze=true for per-partition scan metrics and index-pruning counters).

health_check

Check database connection status and server version.

list_pipelines

List all pipelines or get details of a specific pipeline.

create_pipeline

Create a new pipeline with YAML configuration.

dryrun_pipeline

Test a pipeline with sample data without writing to the database.

delete_pipeline

Delete a specific version of a pipeline.

list_dashboards

List all Perses dashboard definitions.

create_dashboard

Create or update a Perses dashboard definition.

delete_dashboard

Delete a dashboard definition.

What this server can do

GreptimeDB MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Let an AI assistant query metrics, logs, and traces in GreptimeDB using natural language translated to SQL or PromQL-compatible TQL
  • Run time-window aggregations over time-series data with RANGE/ALIGN queries
  • Inspect table schemas and explain query execution plans to debug and tune observability queries
  • Create, dry-run, and manage ingestion pipelines and Perses dashboards from an AI workflow
  • Provide safe, read-only analytical access to a production observability database with data masking and audit logging

Security notes

Read-only by default. All queries pass through a security gate that blocks DROP, DELETE, TRUNCATE, UPDATE, INSERT, ALTER, CREATE, GRANT, REVOKE, EXEC, LOAD, COPY and encoded bypass attempts (hex, UNHEX, CHAR). Enabling GREPTIMEDB_ALLOW_WRITE=true (or --allow-write true) bypasses the gate for execute_sql and lets the AI run destructive DDL/DML — never enable against production data. Sensitive columns (password, secret, token, api_key, credential, credit_card, cvv, bank_account, ssn, id_card, passport) are automatically masked. A read-only GreptimeDB user is recommended; all tool invocations are audit-logged.

GreptimeDB MCP Server FAQ

Is the server read-only?

Yes, by default. A security gate blocks all destructive/DDL/DML statements. You can enable write mode with GREPTIMEDB_ALLOW_WRITE=true or --allow-write true, but this bypasses the gate for execute_sql and is intended only for local development or testing — never against production data.

How does it connect to GreptimeDB?

Over GreptimeDB's MySQL protocol port (default 4002). Configure host, port, user, password, database, and timezone via CLI flags or GREPTIMEDB_* environment variables. Pipeline and dashboard management additionally use the HTTP API port (default 4000).

Which transports are supported?

stdio by default. For containerized or Kubernetes deployments it also supports SSE and streamable-HTTP (set --transport, requires mcp>=1.8.0). DNS rebinding protection is disabled by default and can be enabled with --allowed-hosts.

How is sensitive data protected?

Columns whose names match patterns like password, secret, token, api_key, credential, credit_card, cvv, bank_account, ssn, id_card, and passport are automatically masked (******). You can add custom patterns with --mask-patterns. All tool invocations are also audit-logged.

Alternatives to GreptimeDB MCP Server

Compare all alternatives →

Google's official MCP server with prebuilt BigQuery tools, querying datasets via Application Default Credentials.

Verified
stdio (local)
OAuth
Go
10 tools
Updated 23 days agoRepo

Create, manage, and query your InstantDB apps, schemas, permissions, and data from your AI editor.

Unverified
HTTP (remote)
OAuth
TypeScript
7 tools
Updated 1 day agoRepo

Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, and SQLite.

Unverified
stdio (local)
No auth
TypeScript
3 tools
Updated 1 day agoRepo