mcp-clickvisual
Provides tools for interacting with ClickHouse instances through ClickVisual: listing instances, databases, and log tables; resolving table IDs; searching logs with SQL WHERE clauses; and retrieving log histogram data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-clickvisualsearch logs for 'error' in the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-clickvisual
A Model Context Protocol (MCP) server for ClickVisual — a lightweight log analytics platform built on ClickHouse.
It lets any MCP-capable AI client (Claude Desktop, Cursor, Hermes Agent, ModelScope MCP Hub, ...) search logs, browse instances/databases/tables, and inspect log histograms directly from a chat.
中文说明见下方 中文文档。
Tools
Tool | Description |
| Verify the ClickVisual login state |
| List all ClickHouse instances |
| List databases under an instance |
| List log tables under a database |
| Resolve a numeric |
| Search logs with a SQL WHERE clause, e.g. |
| Get log histogram data (count distribution over time) |
Related MCP server: clickhouse
Configuration
All settings come from environment variables — no credentials are stored in the code:
Variable | Required | Description |
| ✅ | ClickVisual web address, e.g. |
| ✅ | Login username |
| ✅ | Login password (plain text; hashed with MD5 automatically before being sent) |
The server talks to ClickVisual's HTTP API with cookie-based session auth and re-authenticates automatically when the session expires.
Install
Requires Python 3.10+.
# from source
pip install git+https://github.com/wsws1888/mcp-clickvisual.git
# or from a local checkout
pip install .Run
# both of these start the stdio MCP server
mcp-clickvisual
python -m mcp_clickvisualClient configuration
Claude Desktop / Cursor / generic MCP JSON
{
"mcpServers": {
"clickvisual": {
"command": "python",
"args": ["-m", "mcp_clickvisual"],
"env": {
"CV_BASE_URL": "http://your-clickvisual-host:19001",
"CV_USERNAME": "your-username",
"CV_PASSWORD": "your-password"
}
}
}
}If installed with uv, uvx --from mcp-clickvisual mcp-clickvisual
also works as the command.
Hermes Agent (config.yaml)
mcp_servers:
clickvisual:
command: python
args: ["-m", "mcp_clickvisual"]
env:
CV_BASE_URL: http://your-clickvisual-host:19001
CV_USERNAME: your-username
CV_PASSWORD: your-password
timeout: 60
enabled: trueUsage notes
search_logs/get_log_chartsneed a numerictable_id. Find it withlist_instances→list_databases→list_tables, orresolve_table_id(instance_id, database, table).st/etaccept unix seconds, ISO 8601 (2026-09-11T00:00:00) orYYYY-MM-DD HH:MM:SS.queryis a SQL WHERE clause:logtext LIKE '%error%',host = 'app13', combined withAND/OR.Set
is_query_count: 1to get total hit counts (slower queries).
Troubleshooting
Login failed — check the three env vars and that the ClickVisual host is reachable from your machine (VPN / intranet may be required).
Query error — make sure
queryis a valid SQL WHERE clause and the column names exist in the table.No data — check the time range and that the table actually has logs.
License
MIT
中文文档
ClickVisual(基于 ClickHouse 的轻量级日志平台)的 MCP (Model Context Protocol) 服务器,让支持 MCP 的 AI 客户端(Claude Desktop、Cursor、Hermes、 魔搭 ModelScope 等)可以直接在对话中搜索日志、浏览实例/数据库/表、查看日志直方图。
工具列表
工具 | 说明 |
| 验证 ClickVisual 登录状态 |
| 列出所有 ClickHouse 实例 |
| 列出指定实例下的数据库 |
| 列出指定数据库下的日志表 |
| 根据实例 ID、数据库名、表名解析数字 |
| 搜索日志(SQL WHERE 语法,如 |
| 获取日志直方图(按时间分布) |
配置
所有配置通过环境变量传入,代码中不存储任何凭据:
环境变量 | 必填 | 说明 |
| ✅ | ClickVisual 访问地址,如 |
| ✅ | 登录用户名 |
| ✅ | 登录密码(明文,发送前自动 MD5 加密) |
服务端使用 Cookie 会话认证,session 过期会自动重新登录。
安装与运行
需要 Python 3.10+:
pip install git+https://github.com/wsws1888/mcp-clickvisual.git
mcp-clickvisual # stdio 模式启动客户端配置
Claude Desktop / Cursor / 通用 MCP JSON
{
"mcpServers": {
"clickvisual": {
"command": "python",
"args": ["-m", "mcp_clickvisual"],
"env": {
"CV_BASE_URL": "http://你的ClickVisual地址:19001",
"CV_USERNAME": "用户名",
"CV_PASSWORD": "密码"
}
}
}
}Hermes Agent (config.yaml)
mcp_servers:
clickvisual:
command: python
args: ["-m", "mcp_clickvisual"]
env:
CV_BASE_URL: http://你的ClickVisual地址:19001
CV_USERNAME: 用户名
CV_PASSWORD: 密码
timeout: 60
enabled: true使用说明
search_logs/get_log_charts需要数字table_id:先用list_instances→list_databases→list_tables逐级查询,或用resolve_table_id按名称解析。时间参数
st/et支持 Unix 时间戳、ISO 8601、YYYY-MM-DD HH:MM:SS三种格式。query是 SQL WHERE 子句:logtext LIKE '%error%'、host = 'app13', 可用AND/OR组合。is_query_count: 1会额外统计命中总数(较慢,默认关闭)。
常见问题
登录失败:检查三个环境变量,确认本机能访问 ClickVisual 地址(内网环境可能需要 VPN)。
查询报错:确认
query是合法的 SQL WHERE 条件、字段名正确。没有数据:检查时间范围是否正确、表里是否有日志。
License
MIT
Available Tools
7 toolscheck_authB
Verify the ClickVisual login state.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations and no output schema, so the description carries the full burden, yet it only restates the purpose. It does not say whether a failed check raises an error, returns a boolean/status object, or requires credentials, nor whether it is a read-only probe. Significant behavioral gaps remain.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with zero filler or redundancy. It is appropriately terse, though the terseness borders on under-specification rather than efficiency.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter probe with no output schema, the description should at least indicate what a successful versus failed verification yields (status value, error, or boolean). It omits return semantics entirely, leaving a meaningful gap despite the tool's low complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is nothing for the description to clarify; the baseline of 4 applies. No parameter-related claims are made or needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb (Verify) and resource (ClickVisual login state), making the tool's job immediately clear. The sibling tools are all log/table/database operations, so no differentiation is needed in-text, though it also doesn't explicitly distinguish itself from them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to call this tool, e.g. as a precondition before other ClickVisual operations, nor any exclusions. Usage must be inferred entirely from the name and single-sentence description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_log_chartsB
Get log histogram data (log count distribution over time).
| Name | Required | Description | Default |
|---|---|---|---|
| et | Yes | End time (same formats as st) | |
| st | Yes | Start time (unix seconds, ISO 8601, or 'YYYY-MM-DD HH:MM:SS') | |
| query | No | Optional SQL WHERE condition | |
| table_id | Yes | Numeric table ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It reveals only that the result is an aggregated histogram rather than raw logs; it says nothing about bucket granularity, whether results are truncated, pagination, or auth requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single compact sentence with the resource front-loaded and the useful clarification in parentheses. No filler text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations and no output schema, the description should disclose more about the returned histogram and its constraints. It at least characterizes the return as a time-series count distribution, which is the minimum needed to call it correctly, but leaves the response shape and limits unspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so table_id, st, et, and query are already documented in the schema. The description's phrase 'over time' hints that st/et drive the histogram but adds no format or semantics beyond what the schema already states. Baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb ('Get') and resource ('log histogram data') and clarifies the output with a parenthetical: 'log count distribution over time'. This is clearly distinct from a generic search, though it never names the sibling search_logs or otherwise differentiates itself from it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no statement of when to use this tool versus alternatives such as search_logs, nor any prerequisites (e.g., that table_id should come from resolve_table_id). The agent must infer usage entirely from the name and schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_databasesC
List databases under an instance.
| Name | Required | Description | Default |
|---|---|---|---|
| instance_id | Yes | Instance ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. 'List' implies a non-mutating read, which is a small positive, but there is no disclosure of pagination, permissions needed, or result shape for what could be a long enumeration.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single short sentence with no wasted words and the scope constraint front-loaded. It is efficient, though arguably under-specified rather than optimized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple single-parameter read tool with no output schema, this is minimally viable. It omits any indication of return contents or pagination, which an agent would want when enumerating an unknown number of databases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is a single parameter with 100% schema description coverage, so the schema already documents instance_id. The description adds nothing beyond restating the scoping relation, matching the baseline of 3 when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb+resource ('List databases') scoped to 'under an instance', which tells the agent this operates on a single instance's databases. However, it offers no differentiation from sibling list tools such as list_tables or list_instances, leaving the agent to infer the distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit when-to-use or when-not-to-use guidance, and no alternatives are named. The phrase 'under an instance' gives only implied context that the tool requires an existing instance, nothing more.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_instancesB
List all ClickVisual (ClickHouse) log instances.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It only says 'List all' and omits whether the operation is read-only (implied), whether authentication is required, whether results are paginated, or how many instances are returned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence with no wasted words. It states the operation and resource immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter discovery tool with no output schema, the description gives the essential operation but lacks any detail on what an 'instance' represents or how results are structured. It is adequate but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The empty schema requires no parameter documentation, and the description does not contradict it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('List') and resource ('ClickVisual (ClickHouse) log instances'), so the core operation is clear. However, it does not differentiate this tool from siblings like list_databases or list_tables, and the term 'instances' remains somewhat vague.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance on when to use this tool versus alternatives such as list_databases, list_tables, or search_logs. The description gives no context, prerequisites, or exclusions, leaving usage entirely inferred.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tablesC
List log tables under a database.
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full behavioral burden. It does not state whether the operation is read-only, whether it returns all tables or paginated results, or anything about permissions or scope limits beyond 'under a database'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single efficient sentence with no waste, front-loading the verb and resource. It is appropriately sized for a simple list tool but lacks any additional structure that would aid selection.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter read-only list tool with full schema coverage, the description is minimally complete. However, with no annotations and no output schema, it could disclose return behavior or scope assumptions; it remains adequate but not thorough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the single parameter database_id is documented in the schema as 'Database ID'. The description adds only the relational scope ('under a database') but no format or syntax details beyond the schema, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (List) and resource (log tables) scoped to a database, so purpose is clear. However, it does not differentiate itself from siblings like list_databases, list_instances, or search_logs, so it falls short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives such as search_logs or list_databases, nor any prerequisites. The one-sentence description offers implied usage only as a list operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_table_idB
Resolve a numeric tableId from instance ID, database name and table name.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name | |
| database | Yes | Database name | |
| instance_id | Yes | Instance ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden and does not meet it. It never says whether this is a read-only lookup, what happens if the table or database does not exist, whether the result is cached, or whether any permissions are required for the target instance.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that front-loads the result being resolved and then lists the inputs. There is no filler, no redundancy with the title, and nothing that could be trimmed without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple three-parameter lookup with no annotations and no output schema, the description covers the essential mapping from names to ID but omits failure behavior, permission requirements, and any hint about how the resolved ID is consumed. It is adequate but leaves clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all three parameters are already documented in the schema, and the description merely restates them as instance ID, database name and table name. Baseline 3 applies because the schema does the heavy lifting and the description adds no format, casing, or ID-namespace nuance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (resolve), the exact output (a numeric tableId), and the three inputs that produce it, so the operation is unambiguous. It does not, however, differentiate itself from the sibling list_tables, which an agent could plausibly confuse with an ID-resolution step.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: the phrasing suggests you call this when you hold instance/database/table names but need the numeric ID required elsewhere. There is no explicit when-to-use, no statement of prerequisites (e.g. that the table must already exist), and no named alternative among the siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_logsB
Search ClickVisual logs. Requires a numeric table_id and a time range. The query parameter uses SQL WHERE clause syntax, e.g. logtext LIKE '%error%'.
| Name | Required | Description | Default |
|---|---|---|---|
| et | Yes | End time (same formats as st) | |
| st | Yes | Start time (unix seconds, ISO 8601, or 'YYYY-MM-DD HH:MM:SS') | |
| page | No | Page number | |
| query | No | SQL WHERE condition, e.g. logtext LIKE '%error%' or host = 'app13' | |
| table_id | Yes | Numeric table ID | |
| page_size | No | Page size | |
| is_query_count | No | 1=also count total hits (slower), 0=skip counting (faster) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden, yet it discloses almost nothing beyond inputs: no return shape, ordering, pagination behavior, or cost characteristics (the slow/fast tradeoff of is_query_count lives only in the schema). The SQL-syntax hint is the only added behavior-adjacent context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight, front-loaded sentences with no filler; the core purpose and prerequisites come first. It could still fold in one more useful clause without bloat, but sizing is appropriate.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 7-parameter tool with no annotations and no output schema, the description covers required inputs and query syntax but omits return format, pagination defaults, and the resolve_table_id workflow. Adequate but with clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all seven parameters are already documented in the schema, including the query example and the is_query_count semantics. The description restates the query syntax and required fields without adding meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Search ClickVisual logs') and names the required inputs. It is clearly more of a query tool than the sibling metadata/list tools, but it never explicitly distinguishes itself from alternatives like get_log_charts or list_tables.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives prerequisites ('Requires a numeric table_id and a time range') but no when-to-use vs when-not guidance and no pointer to the sibling resolve_table_id for obtaining a table_id. Usage is implied rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
check_auth - First observed
get_log_charts - First observed
list_databases - First observed
list_instances - First observed
list_tables - First observed
resolve_table_id - First observed
search_logs
TDQS
Scored across 7 tools
Each tool maps to a distinct action/resource: discovery hierarchy (instances/databases/tables), table ID resolution, log querying, histogram aggregation, and auth check. search_logs and get_log_charts both use table_id but clearly differ by returning raw logs versus count distribution.
All names follow a consistent verb_noun snake_case pattern (list_*, search_logs, resolve_table_id, get_log_charts, check_auth). There are no mixed conventions or vague verbs.
Seven tools is well-scoped for a read-only log exploration server. The discovery, search, histogram, and auth pieces all serve the same purpose without bloat.
The set covers the core workflow end-to-end: authenticate, discover instances/databases/tables, resolve the required numeric table_id, then search raw logs or view histograms. The only notable gap is schema/field discovery, which agents may need to construct meaningful search_logs queries.
Maintenance
Related MCP Connectors
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Governed access to production AI-agent traces in an existing ClickHouse store.
1Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables interaction with ClickHouse databases via MCP, providing tools to list databases and tables and execute safe SELECT, SHOW, and DESCRIBE queries.34 npmMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to query and manage ClickHouse databases, supporting SELECT queries, DDL/DML statements, and metadata listing.55 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables executing SQL queries, listing databases, and listing tables on a ClickHouse cluster through natural language.Apache 2.0
- AlicenseAqualityCmaintenanceA read-only MCP server for ClickHouse that enables AI agents to discover schema, sample data, and run read-only SQL queries to investigate observability data like logs, metrics, and traces.66 npmMIT