
Greptimedb Mcp Server
io.github.GreptimeTeamPublished by GitHub account GreptimeTeamv0.6.0Updated Oct 24, 2026
Query GreptimeDB metrics, logs and traces with SQL, TQL and RANGE. Manage pipelines and dashboards.
Overview
A local MCP server that lets an AI assistant query and analyze GreptimeDB metrics, logs and traces, and manage pipelines and dashboards.
- What you can do
- Run SQL, TQL (PromQL-compatible) and RANGE time-window queries, with csv/json/markdown output and row limits, and inspect execution plans or connection health. Discover tables by observability concept, inspect table profiles and query the semantic graph of entities and relationships. Read table data through greptime:// resource URIs. List, create, dry-run and delete ingestion pipelines. List, create or update and delete Perses dashboards. Use built-in prompt templates for pipeline creation, metrics, PromQL and trace analysis, schema design and query tuning.
- When to use it
- Useful when you already run GreptimeDB and want an assistant to explore its metrics, logs and traces, write and explain queries, or manage pipelines and dashboards from a chat session. It is aimed at read-oriented analysis by default, with writes opt-in.
- Requirements
- Runs locally as a Python package installed with pip (greptimedb-mcp-server). Needs a reachable GreptimeDB instance and connection settings: GREPTIMEDB_HOST, GREPTIMEDB_PORT (MySQL protocol, default 4002), GREPTIMEDB_USER, GREPTIMEDB_PASSWORD, GREPTIMEDB_DATABASE, plus GREPTIMEDB_HTTP_PORT for pipeline and dashboard management. Some semantic tools require GreptimeDB 1.3. Network access to the database is required.
Installation
In SourceWeft
- Open Greptimedb Mcp Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
greptimedb-mcp-server
[PyPI - Version] [build workflow] [MCP Registry] [MIT License]
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.
Quick Start
For Claude Desktop, add this to your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Features
Tools
search_table_semantics and the semantic metadata in describe_table read information_schema.table_semantics. A table appears there when it carries a greptime.semantic.* option or a built-in convention derives an entity declaration for it; other tables are absent. The server reads the view's column list once per process and selects only the columns it exposes. entity_declarations requires GreptimeDB 1.3; on earlier versions it is reported as a missing column rather than as an empty declaration set.
Tool results are bounded by GREPTIMEDB_MAX_RESULT_BYTES (default 1048576, or 1 MiB). A query result over the budget returns fewer rows and reports it in truncated and truncation_reason; a result with no rows to shed is cut with a notice at the end. The budget is a backstop against a result too large to be consumed, so lower it if your MCP client rejects results before it is reached.
Cross-database queries
The server connects to one database, but reads are not restricted to it:
The connected account needs read permission on the target database. Use SHOW DATABASES to list them.
query_semantic_graph reads greptime_private.semantic_entities and greptime_private.semantic_relationships, which require GreptimeDB 1.3. At startup the server checks that both views exist, carry the columns it reads, and are readable by the connected account; when they are not, the tool is not offered and the reason is logged. Its time window is required and half-open, [start_time, end_time) over observed_at, and rows are aggregated across the 60-second observation buckets in that window.
Pipeline Management
Dashboard Management
Resources & Prompts
- Resources: Browse tables via
greptime://<table>/dataURIs - Prompts: Built-in Jinja templates for common tasks —
pipeline_creator,log_pipeline,metrics_analysis,promql_analysis,trace_analysis,table_operation,schema_design_advisor,observability_correlation,ingestion_troubleshooting,query_performance_tuning
For LLM integration and prompt usage, see docs/llm-instructions.md.
These tools cover querying and managing data in an existing GreptimeDB. For deployment, server configuration, write protocols, pipeline syntax, schema design, and performance diagnosis, point the assistant at the GreptimeDB skills index at https://docs.greptime.com/SKILL.md.
Configuration
Environment Variables
CLI Arguments
HTTP Server Mode
For containerized or Kubernetes deployments:
DNS Rebinding Protection
By default, DNS rebinding protection is disabled for compatibility with proxies, gateways, and Kubernetes services. To enable it, use --allowed-hosts:
If you encounter 421 Invalid Host Header errors, either disable protection (default) or add your host to the allowed list.
Security
Read-Only Database User (Recommended)
Create a read-only user in GreptimeDB using static user provider:
Application-Level Security Gate
All queries go through a security gate that:
- Blocks: DROP, DELETE, TRUNCATE, UPDATE, INSERT, ALTER, CREATE, GRANT, REVOKE, EXEC, LOAD, COPY
- Blocks: Encoded bypass attempts (hex, UNHEX, CHAR)
- Allows: SELECT, SHOW, DESCRIBE, TQL, EXPLAIN, UNION
Write Mode (Disabled by Default)
The server is read-only by default. Write mode enables every operation that changes stored state:
- destructive SQL (DDL/DML such as
CREATE,DROP,ALTER,INSERT,UPDATE,DELETE) throughexecute_sql create_pipeline,delete_pipeline,create_dashboard,delete_dashboard
When enabled, the security gate is bypassed for execute_sql, and the server
logs a warning on startup. With write mode off, those four tools return an error
without contacting the server; list_pipelines, list_dashboards and
dryrun_pipeline are read-only and stay available.
⚠️ Danger: This lets an AI assistant run destructive statements against your database. Never enable it against production data. Combine with a read-only database user if you only need read access.
Data Masking
Sensitive columns are automatically masked (******) based on column name patterns:
- Authentication:
password,secret,token,api_key,credential - Financial:
credit_card,cvv,bank_account - Personal:
ssn,id_card,passport
Configure with --mask-patterns phone,email to add custom patterns.
Audit Logging
All tool invocations are logged:
Disable with --audit-enabled false.
Development
License
MIT License - see LICENSE.md.
Acknowledgement
Inspired by:
Source: README.md at commit 5347e7e
Tools
0Version history
1- v0.6.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts