Server data from the Official MCP Registry
Query and analyze GreptimeDB metrics, logs and traces via SQL, TQL and RANGE queries.
Query and analyze GreptimeDB metrics, logs and traces via SQL, TQL and RANGE queries.
Valid MCP server (1 strong, 4 medium validity signals). 1 code issue detected. 8 known CVEs in dependencies (0 critical, 3 high severity) Imported from the Official MCP Registry. 2 finding(s) downgraded by scanner intelligence.
4 files analyzed · 10 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: GREPTIMEDB_HOST
Environment variable: GREPTIMEDB_PORT
Environment variable: GREPTIMEDB_USER
Environment variable: GREPTIMEDB_PASSWORD
Environment variable: GREPTIMEDB_DATABASE
Environment variable: GREPTIMEDB_TIMEZONE
Environment variable: GREPTIMEDB_POOL_SIZE
Environment variable: GREPTIMEDB_HTTP_PORT
Environment variable: GREPTIMEDB_HTTP_PROTOCOL
Environment variable: GREPTIMEDB_MASK_ENABLED
Environment variable: GREPTIMEDB_MASK_PATTERNS
Environment variable: GREPTIMEDB_AUDIT_ENABLED
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-greptimeteam-greptimedb-mcp-server": {
"env": {
"GREPTIMEDB_HOST": "your-greptimedb-host-here",
"GREPTIMEDB_PORT": "your-greptimedb-port-here",
"GREPTIMEDB_USER": "your-greptimedb-user-here",
"GREPTIMEDB_DATABASE": "your-greptimedb-database-here",
"GREPTIMEDB_PASSWORD": "your-greptimedb-password-here",
"GREPTIMEDB_TIMEZONE": "your-greptimedb-timezone-here",
"GREPTIMEDB_HTTP_PORT": "your-greptimedb-http-port-here",
"GREPTIMEDB_POOL_SIZE": "your-greptimedb-pool-size-here",
"GREPTIMEDB_MASK_ENABLED": "your-greptimedb-mask-enabled-here",
"GREPTIMEDB_AUDIT_ENABLED": "your-greptimedb-audit-enabled-here",
"GREPTIMEDB_HTTP_PROTOCOL": "your-greptimedb-http-protocol-here",
"GREPTIMEDB_MASK_PATTERNS": "your-greptimedb-mask-patterns-here"
},
"args": [
"greptimedb-mcp-server"
],
"command": "uvx"
}
}
}From the project's GitHub README.
A Model Context Protocol (MCP) server for GreptimeDB — an open-source observability database that handles metrics, logs, and traces in one engine.
Enables AI assistants to query and analyze GreptimeDB using SQL, TQL (PromQL-compatible), and RANGE queries, with built-in security features like read-only enforcement and data masking.
# Install
pip install greptimedb-mcp-server
# Run (connects to localhost:4002 by default)
greptimedb-mcp-server --host localhost --database public
For Claude Desktop, add this to your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"greptimedb": {
"command": "greptimedb-mcp-server",
"args": ["--host", "localhost", "--database", "public"]
}
}
}
| Tool | Description |
|---|---|
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 | Get table schema including column names, types, and constraints |
explain_query | Analyze SQL or TQL query execution plans |
health_check | Check database connection status and server version |
| Tool | Description |
|---|---|
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 database |
delete_pipeline | Delete a specific version of a pipeline |
| Tool | Description |
|---|---|
list_dashboards | List all Perses dashboard definitions |
create_dashboard | Create or update a Perses dashboard definition |
delete_dashboard | Delete a dashboard definition |
greptime://<table>/data URIspipeline_creator, log_pipeline, metrics_analysis, promql_analysis, iot_monitoring, trace_analysis, table_operationFor LLM integration and prompt usage, see docs/llm-instructions.md.
GREPTIMEDB_HOST=localhost # Database host
GREPTIMEDB_PORT=4002 # MySQL protocol port (default: 4002)
GREPTIMEDB_USER=root # Database user
GREPTIMEDB_PASSWORD= # Database password
GREPTIMEDB_DATABASE=public # Database name
GREPTIMEDB_TIMEZONE=UTC # Session timezone
# Optional
GREPTIMEDB_HTTP_PORT=4000 # HTTP API port for pipeline/dashboard management
GREPTIMEDB_HTTP_PROTOCOL=http # HTTP protocol (http/https)
GREPTIMEDB_POOL_SIZE=5 # Connection pool size
GREPTIMEDB_MASK_ENABLED=true # Enable sensitive data masking
GREPTIMEDB_MASK_PATTERNS= # Additional patterns (comma-separated)
GREPTIMEDB_AUDIT_ENABLED=true # Enable audit logging
# Transport (for HTTP server mode)
GREPTIMEDB_TRANSPORT=stdio # stdio, sse, or streamable-http
GREPTIMEDB_LISTEN_HOST=0.0.0.0 # HTTP server bind host
GREPTIMEDB_LISTEN_PORT=8080 # HTTP server bind port
GREPTIMEDB_ALLOWED_HOSTS= # DNS rebinding protection (comma-separated)
GREPTIMEDB_ALLOWED_ORIGINS= # CORS allowed origins (comma-separated)
greptimedb-mcp-server \
--host localhost \
--port 4002 \
--database public \
--user root \
--password "" \
--timezone UTC \
--pool-size 5 \
--mask-enabled true \
--transport stdio
For containerized or Kubernetes deployments. Requires mcp>=1.8.0:
# Streamable HTTP (recommended for production)
greptimedb-mcp-server --transport streamable-http --listen-port 8080
# SSE mode (legacy)
greptimedb-mcp-server --transport sse --listen-port 3000
By default, DNS rebinding protection is disabled for compatibility with proxies, gateways, and Kubernetes services. To enable it, use --allowed-hosts:
# Enable DNS rebinding protection with allowed hosts
greptimedb-mcp-server --transport streamable-http \
--allowed-hosts "localhost:*,127.0.0.1:*,my-service.namespace:*"
# With custom allowed origins for CORS
greptimedb-mcp-server --transport streamable-http \
--allowed-hosts "my-service.namespace:*" \
--allowed-origins "http://localhost:*,https://my-app.example.com"
# Or via environment variables
GREPTIMEDB_ALLOWED_HOSTS="localhost:*,my-service.namespace:*" \
GREPTIMEDB_ALLOWED_ORIGINS="http://localhost:*" \
greptimedb-mcp-server --transport streamable-http
If you encounter 421 Invalid Host Header errors, either disable protection (default) or add your host to the allowed list.
Create a read-only user in GreptimeDB using static user provider:
mcp_readonly:readonly=your_secure_password
All queries go through a security gate that:
Sensitive columns are automatically masked (******) based on column name patterns:
password, secret, token, api_key, credentialcredit_card, cvv, bank_accountssn, id_card, passportConfigure with --mask-patterns phone,email to add custom patterns.
All tool invocations are logged:
2025-12-10 10:30:45 - greptimedb_mcp_server.audit - INFO - [AUDIT] execute_sql | query="SELECT * FROM cpu LIMIT 10" | success=True | duration_ms=45.2
Disable with --audit-enabled false.
# Clone and setup
git clone https://github.com/GreptimeTeam/greptimedb-mcp-server.git
cd greptimedb-mcp-server
uv venv && source .venv/bin/activate
uv sync
# Run tests
pytest
# Format & lint
uv run black .
uv run flake8 src
# Debug with MCP Inspector
npx @modelcontextprotocol/inspector uv --directory . run -m greptimedb_mcp_server.server
MIT License - see LICENSE.md.
Inspired by:
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.