
GreptimeDB 的模型上下文协议服务器
概览
一个用于GreptimeDB的模型上下文协议(MCP)服务器——一个开源可观察性数据库,在一个引擎中处理度量衡,日志和痕迹. 允许AI助手使用SQL,TQL(PromQL-兼容),和RANGE查询进行查询和分析GreptimeDB,具有只读执行和数据掩码等内置安全功能. 对于克洛德桌面,请将此添加到您的配置中(~/Library/应用程序支持/Claude/claude desktop config.json on macOS) : research table 语义学和描述中的语义学元数据 读取信息 schema.table semantics. 一个表出现在那里 当它携带一个greptime。 语义学.* 选项或内在公约产生实体声明;没有其他表格。 服务器每个进程读取视图的列列表一次,只选择它所暴露的列. 实体 声明需要 GreptimeDB 1. 3; 在更早的版本中, 它被报告为缺失一栏而非空声明集 .
概述(AI 翻译)
一个用于GreptimeDB的模型上下文协议(MCP)服务器——一个开源可观察性数据库,在一个引擎中处理度量衡,日志和痕迹.
允许AI助手使用SQL,TQL(PromQL-兼容),和RANGE查询进行查询和分析GreptimeDB,具有只读执行和数据掩码等内置安全功能.
□ 快开始
对于克洛德桌面,请将此添加到您在macOS上的配置中([[T0]):
□ 特性
QQ 工具
- 工具 * * 描述 * *
|-|-|-.
QQ[ [T1]] 使用格式执行 SQL 查询( csv/json/ markdown) 并限制选项 QQ
QQ
execute_tql执行 TQL(PromQL相容)查询 时间序列分析 QQ QQ[ [T3]] 使用 RANGE/ ALIGN 语法执行时间窗口汇总查询 QQ
QQ query_semantic_graph 查询语义图: [[T7] (包含的内容), [[T8] (节点), [[T9] (对接) 通过所需的时间窗口 QQ
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
greptimedb-mcp-server
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
# 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"]
}
}
}
Features
Tools
| 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 |
search_table_semantics |
Find tables by observability concept, ranked by matched terms; searches table names, semantic options, and entity declarations. schema selects the database to search |
query_semantic_graph |
Query the semantic graph: summary (what it contains), entities (nodes), relationships (edges) over a required time window |
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 index-pruning counters) |
health_check |
Check database connection status and server version |
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.
安装
npx @modelcontextprotocol/inspector uv --directory . run -m greptimedb_mcp_server.server配置
{
"mcpServers": {
"greptimedb": {
"command": "greptimedb-mcp-server",
"args": ["--host", "localhost", "--database", "public"]
}
}
}