Skip to content

Commit e821c46

Browse files
committed
resolve conflict
1 parent c5fc806 commit e821c46

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

mcp_clickhouse/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
run_select_query,
66
create_chdb_client,
77
run_chdb_select_query,
8-
chdb_initial_prompt,
98
list_clickhouse_servers,
109
create_chdb_client,
1110
run_chdb_select_query,
@@ -20,7 +19,6 @@
2019
"create_clickhouse_client",
2120
"create_chdb_client",
2221
"run_chdb_select_query",
23-
"chdb_initial_prompt",
2422
"list_clickhouse_servers",
2523
"get_config",
2624
"get_all_configs",

mcp_clickhouse/mcp_server.py

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,55 @@
1818
from starlette.responses import PlainTextResponse
1919

2020
from mcp_clickhouse.mcp_env import get_config, get_all_configs, get_mcp_server_config, get_chdb_config
21-
from mcp_clickhouse.chdb_prompt import CHDB_PROMPT
21+
22+
# chDB prompt content
23+
CHDB_PROMPT = """
24+
chDB is an in-process SQL OLAP Engine powered by ClickHouse.
25+
26+
Features:
27+
- Fast columnar data processing
28+
- Standard SQL support
29+
- No need for a separate server
30+
- Supports various data formats (CSV, JSON, Parquet, etc.)
31+
- Can work with local files and remote data sources
32+
33+
Common usage patterns:
34+
35+
1. Basic query:
36+
SELECT * FROM table LIMIT 10
37+
38+
2. Working with CSV data:
39+
SELECT * FROM file('data.csv', 'CSV', 'col1 String, col2 Int32')
40+
41+
3. Aggregations:
42+
SELECT count(), avg(column_name) FROM table
43+
44+
4. Data analysis:
45+
SELECT
46+
column1,
47+
count() as count,
48+
sum(column2) as total
49+
FROM table
50+
GROUP BY column1
51+
ORDER BY count DESC
52+
53+
5. Time series analysis:
54+
SELECT
55+
toDate(timestamp) as date,
56+
count() as events
57+
FROM table
58+
GROUP BY date
59+
ORDER BY date
60+
61+
Tips:
62+
- Use LIMIT for large datasets to avoid overwhelming output
63+
- Leverage ClickHouse's built-in functions for data processing
64+
- chDB supports most ClickHouse SQL features
65+
- Data types are automatically inferred when possible
66+
- Use proper column types for better performance
67+
68+
For more complex queries, refer to ClickHouse documentation as chDB is compatible with ClickHouse SQL syntax.
69+
"""
2270

2371

2472
@dataclass

0 commit comments

Comments
 (0)