mcp-hydrolix 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_hydrolix/__init__.py +13 -0
- mcp_hydrolix/main.py +9 -0
- mcp_hydrolix/mcp_env.py +131 -0
- mcp_hydrolix/mcp_server.py +232 -0
- mcp_hydrolix-0.1.0.dist-info/METADATA +106 -0
- mcp_hydrolix-0.1.0.dist-info/RECORD +9 -0
- mcp_hydrolix-0.1.0.dist-info/WHEEL +4 -0
- mcp_hydrolix-0.1.0.dist-info/entry_points.txt +2 -0
- mcp_hydrolix-0.1.0.dist-info/licenses/LICENSE +201 -0
mcp_hydrolix/__init__.py
ADDED
mcp_hydrolix/main.py
ADDED
mcp_hydrolix/mcp_env.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Environment configuration for the MCP Hydrolix server.
|
|
2
|
+
|
|
3
|
+
This module handles all environment variable configuration with sensible defaults
|
|
4
|
+
and type conversion.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
import os
|
|
9
|
+
from typing import Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class HydrolixConfig:
|
|
14
|
+
"""Configuration for Hydrolix connection settings.
|
|
15
|
+
|
|
16
|
+
This class handles all environment variable configuration with sensible defaults
|
|
17
|
+
and type conversion. It provides typed methods for accessing each configuration value.
|
|
18
|
+
|
|
19
|
+
Required environment variables:
|
|
20
|
+
HYDROLIX_HOST: The hostname of the Hydrolix server
|
|
21
|
+
HYDROLIX_USER: The username for authentication
|
|
22
|
+
HYDROLIX_PASSWORD: The password for authentication
|
|
23
|
+
|
|
24
|
+
Optional environment variables (with defaults):
|
|
25
|
+
HYDROLIX_PORT: The port number (default: 8088)
|
|
26
|
+
HYDROLIX_VERIFY: Verify SSL certificates (default: true)
|
|
27
|
+
HYDROLIX_CONNECT_TIMEOUT: Connection timeout in seconds (default: 30)
|
|
28
|
+
HYDROLIX_SEND_RECEIVE_TIMEOUT: Send/receive timeout in seconds (default: 300)
|
|
29
|
+
HYDROLIX_DATABASE: Default database to use (default: None)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self):
|
|
33
|
+
"""Initialize the configuration from environment variables."""
|
|
34
|
+
self._validate_required_vars()
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def host(self) -> str:
|
|
38
|
+
"""Get the Hydrolix host."""
|
|
39
|
+
return os.environ["HYDROLIX_HOST"]
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def port(self) -> int:
|
|
43
|
+
"""Get the Hydrolix port.
|
|
44
|
+
|
|
45
|
+
Defaults to 8088.
|
|
46
|
+
Can be overridden by HYDROLIX_PORT environment variable.
|
|
47
|
+
"""
|
|
48
|
+
if "HYDROLIX_PORT" in os.environ:
|
|
49
|
+
return int(os.environ["HYDROLIX_PORT"])
|
|
50
|
+
return 8088
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def username(self) -> str:
|
|
54
|
+
"""Get the Hydrolix username."""
|
|
55
|
+
return os.environ["HYDROLIX_USER"]
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def password(self) -> str:
|
|
59
|
+
"""Get the Hydrolix password."""
|
|
60
|
+
return os.environ["HYDROLIX_PASSWORD"]
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def database(self) -> Optional[str]:
|
|
64
|
+
"""Get the default database name if set."""
|
|
65
|
+
return os.getenv("HYDROLIX_DATABASE")
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def verify(self) -> bool:
|
|
69
|
+
"""Get whether SSL certificate verification is enabled.
|
|
70
|
+
|
|
71
|
+
Default: True
|
|
72
|
+
"""
|
|
73
|
+
return os.getenv("HYDROLIX_VERIFY", "true").lower() == "true"
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def connect_timeout(self) -> int:
|
|
77
|
+
"""Get the connection timeout in seconds.
|
|
78
|
+
|
|
79
|
+
Default: 30
|
|
80
|
+
"""
|
|
81
|
+
return int(os.getenv("HYDROLIX_CONNECT_TIMEOUT", "30"))
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def send_receive_timeout(self) -> int:
|
|
85
|
+
"""Get the send/receive timeout in seconds.
|
|
86
|
+
|
|
87
|
+
Default: 300 (Hydrolix default)
|
|
88
|
+
"""
|
|
89
|
+
return int(os.getenv("HYDROLIX_SEND_RECEIVE_TIMEOUT", "300"))
|
|
90
|
+
|
|
91
|
+
def get_client_config(self) -> dict:
|
|
92
|
+
"""Get the configuration dictionary for clickhouse_connect client.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
dict: Configuration ready to be passed to clickhouse_connect.get_client()
|
|
96
|
+
"""
|
|
97
|
+
config = {
|
|
98
|
+
"host": self.host,
|
|
99
|
+
"port": self.port,
|
|
100
|
+
"username": self.username,
|
|
101
|
+
"password": self.password,
|
|
102
|
+
"secure": True,
|
|
103
|
+
"verify": self.verify,
|
|
104
|
+
"connect_timeout": self.connect_timeout,
|
|
105
|
+
"send_receive_timeout": self.send_receive_timeout,
|
|
106
|
+
"client_name": "mcp_hydrolix",
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
# Add optional database if set
|
|
110
|
+
if self.database:
|
|
111
|
+
config["database"] = self.database
|
|
112
|
+
|
|
113
|
+
return config
|
|
114
|
+
|
|
115
|
+
def _validate_required_vars(self) -> None:
|
|
116
|
+
"""Validate that all required environment variables are set.
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
ValueError: If any required environment variable is missing.
|
|
120
|
+
"""
|
|
121
|
+
missing_vars = []
|
|
122
|
+
for var in ["HYDROLIX_HOST", "HYDROLIX_USER", "HYDROLIX_PASSWORD"]:
|
|
123
|
+
if var not in os.environ:
|
|
124
|
+
missing_vars.append(var)
|
|
125
|
+
|
|
126
|
+
if missing_vars:
|
|
127
|
+
raise ValueError(f"Missing required environment variables: {', '.join(missing_vars)}")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# Global instance for easy access
|
|
131
|
+
config = HydrolixConfig()
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Sequence
|
|
3
|
+
import concurrent.futures
|
|
4
|
+
import atexit
|
|
5
|
+
|
|
6
|
+
import clickhouse_connect
|
|
7
|
+
from clickhouse_connect.driver.binding import quote_identifier, format_query_value
|
|
8
|
+
from dotenv import load_dotenv
|
|
9
|
+
from mcp.server.fastmcp import FastMCP
|
|
10
|
+
|
|
11
|
+
from mcp_hydrolix.mcp_env import config
|
|
12
|
+
|
|
13
|
+
MCP_SERVER_NAME = "mcp-hydrolix"
|
|
14
|
+
|
|
15
|
+
# Configure logging
|
|
16
|
+
logging.basicConfig(
|
|
17
|
+
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
18
|
+
)
|
|
19
|
+
logger = logging.getLogger(MCP_SERVER_NAME)
|
|
20
|
+
|
|
21
|
+
QUERY_EXECUTOR = concurrent.futures.ThreadPoolExecutor(max_workers=10)
|
|
22
|
+
atexit.register(lambda: QUERY_EXECUTOR.shutdown(wait=True))
|
|
23
|
+
SELECT_QUERY_TIMEOUT_SECS = 30
|
|
24
|
+
|
|
25
|
+
load_dotenv()
|
|
26
|
+
|
|
27
|
+
deps = [
|
|
28
|
+
"clickhouse-connect",
|
|
29
|
+
"python-dotenv",
|
|
30
|
+
"uvicorn",
|
|
31
|
+
"pip-system-certs",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
mcp = FastMCP(MCP_SERVER_NAME, dependencies=deps)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@mcp.tool()
|
|
38
|
+
def list_databases():
|
|
39
|
+
"""List available Hydrolix databases"""
|
|
40
|
+
logger.info("Listing all databases")
|
|
41
|
+
client = create_hydrolix_client()
|
|
42
|
+
result = client.command("SHOW DATABASES")
|
|
43
|
+
logger.info(f"Found {len(result) if isinstance(result, list) else 1} databases")
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@mcp.tool()
|
|
48
|
+
def list_tables(database: str, like: str = None):
|
|
49
|
+
"""List available Hydrolix tables in a database"""
|
|
50
|
+
logger.info(f"Listing tables in database '{database}'")
|
|
51
|
+
client = create_hydrolix_client()
|
|
52
|
+
query = f"SHOW TABLES FROM {quote_identifier(database)}"
|
|
53
|
+
if like:
|
|
54
|
+
query += f" LIKE {format_query_value(like)}"
|
|
55
|
+
result = client.command(query)
|
|
56
|
+
|
|
57
|
+
# Get all table comments in one query
|
|
58
|
+
table_comments_query = (
|
|
59
|
+
f"SELECT name, comment FROM system.tables WHERE database = {format_query_value(database)}"
|
|
60
|
+
)
|
|
61
|
+
table_comments_result = client.query(table_comments_query)
|
|
62
|
+
table_comments = {row[0]: row[1] for row in table_comments_result.result_rows}
|
|
63
|
+
|
|
64
|
+
# Get all column comments in one query
|
|
65
|
+
column_comments_query = f"SELECT table, name, comment FROM system.columns WHERE database = {format_query_value(database)}"
|
|
66
|
+
column_comments_result = client.query(column_comments_query)
|
|
67
|
+
column_comments = {}
|
|
68
|
+
for row in column_comments_result.result_rows:
|
|
69
|
+
table, col_name, comment = row
|
|
70
|
+
if table not in column_comments:
|
|
71
|
+
column_comments[table] = {}
|
|
72
|
+
column_comments[table][col_name] = comment
|
|
73
|
+
|
|
74
|
+
def get_table_info(table):
|
|
75
|
+
logger.info(f"Getting schema info for table {database}.{table}")
|
|
76
|
+
schema_query = f"DESCRIBE TABLE {quote_identifier(database)}.{quote_identifier(table)}"
|
|
77
|
+
schema_result = client.query(schema_query)
|
|
78
|
+
|
|
79
|
+
columns = []
|
|
80
|
+
column_names = schema_result.column_names
|
|
81
|
+
for row in schema_result.result_rows:
|
|
82
|
+
column_dict = {}
|
|
83
|
+
for i, col_name in enumerate(column_names):
|
|
84
|
+
column_dict[col_name] = row[i]
|
|
85
|
+
# Add comment from our pre-fetched comments
|
|
86
|
+
if table in column_comments and column_dict["name"] in column_comments[table]:
|
|
87
|
+
column_dict["comment"] = column_comments[table][column_dict["name"]]
|
|
88
|
+
else:
|
|
89
|
+
column_dict["comment"] = None
|
|
90
|
+
columns.append(column_dict)
|
|
91
|
+
|
|
92
|
+
create_table_query = f"SHOW CREATE TABLE {database}.`{table}`"
|
|
93
|
+
create_table_result = client.command(create_table_query)
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
"database": database,
|
|
97
|
+
"name": table,
|
|
98
|
+
"comment": table_comments.get(table),
|
|
99
|
+
"columns": columns,
|
|
100
|
+
"create_table_query": create_table_result,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
tables = []
|
|
104
|
+
if isinstance(result, str):
|
|
105
|
+
# Single table result
|
|
106
|
+
for table in (t.strip() for t in result.split()):
|
|
107
|
+
if table:
|
|
108
|
+
tables.append(get_table_info(table))
|
|
109
|
+
elif isinstance(result, Sequence):
|
|
110
|
+
# Multiple table results
|
|
111
|
+
for table in result:
|
|
112
|
+
tables.append(get_table_info(table))
|
|
113
|
+
|
|
114
|
+
logger.info(f"Found {len(tables)} tables")
|
|
115
|
+
return tables
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def execute_query(query: str):
|
|
119
|
+
client = create_hydrolix_client()
|
|
120
|
+
try:
|
|
121
|
+
res = client.query(
|
|
122
|
+
query,
|
|
123
|
+
settings={
|
|
124
|
+
"readonly": 1,
|
|
125
|
+
"hdx_query_max_execution_time": SELECT_QUERY_TIMEOUT_SECS,
|
|
126
|
+
"hdx_query_max_attempts": 1,
|
|
127
|
+
"hdx_query_max_result_rows": 100_000,
|
|
128
|
+
"hdx_query_max_memory_usage": 2 * 1024 * 1024 * 1024, # 2GiB
|
|
129
|
+
"hdx_query_admin_comment": f"User: {MCP_SERVER_NAME}",
|
|
130
|
+
},
|
|
131
|
+
)
|
|
132
|
+
column_names = res.column_names
|
|
133
|
+
rows = []
|
|
134
|
+
for row in res.result_rows:
|
|
135
|
+
row_dict = {}
|
|
136
|
+
for i, col_name in enumerate(column_names):
|
|
137
|
+
row_dict[col_name] = row[i]
|
|
138
|
+
rows.append(row_dict)
|
|
139
|
+
logger.info(f"Query returned {len(rows)} rows")
|
|
140
|
+
return rows
|
|
141
|
+
except Exception as err:
|
|
142
|
+
logger.error(f"Error executing query: {err}")
|
|
143
|
+
# Return a structured dictionary rather than a string to ensure proper serialization
|
|
144
|
+
# by the MCP protocol. String responses for errors can cause BrokenResourceError.
|
|
145
|
+
return {"error": str(err)}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@mcp.tool()
|
|
149
|
+
def run_select_query(query: str):
|
|
150
|
+
"""Run a SELECT query in a Hydrolix time-series database using the Clickhouse SQL dialect.
|
|
151
|
+
Queries run using this tool will timeout after 30 seconds.
|
|
152
|
+
|
|
153
|
+
The primary key on tables queried this way is always a timestamp. Queries should include either
|
|
154
|
+
a LIMIT clause or a filter based on the primary key as a performance guard to ensure they return
|
|
155
|
+
in a reasonable amount of time. Queries should select specific fields and avoid the use of
|
|
156
|
+
SELECT * to avoid performance issues. The performance guard used for the query should be clearly
|
|
157
|
+
communicated with the user, and the user should be informed that the query may take a long time
|
|
158
|
+
to run if the performance guard is not used. When choosing a performance guard, the user's
|
|
159
|
+
preference should be requested and used if available. When using aggregations, the performance
|
|
160
|
+
guard should take form of a primary key filter, or else the LIMIT should be applied in a
|
|
161
|
+
subquery before applying the aggregations.
|
|
162
|
+
|
|
163
|
+
When matching columns based on substrings, prefix or suffix matches should be used instead of
|
|
164
|
+
full-text search whenever possible. When searching for substrings, the syntax `column LIKE
|
|
165
|
+
'%suffix'` or `column LIKE 'prefix%'` should be used.
|
|
166
|
+
|
|
167
|
+
Example query. Purpose: get logs from the `application.logs` table. Primary key: `timestamp`.
|
|
168
|
+
Performance guard: 10 minute recency filter.
|
|
169
|
+
|
|
170
|
+
`SELECT message, timestamp FROM application.logs WHERE timestamp > now() - INTERVAL 10 MINUTES`
|
|
171
|
+
|
|
172
|
+
Example query. Purpose: get the median humidity from the `weather.measurements` table. Primary
|
|
173
|
+
key: `date`. Performance guard: 1000 row limit, applied before aggregation.
|
|
174
|
+
|
|
175
|
+
`SELECT median(humidity) FROM (SELECT humidity FROM weather.measurements LIMIT 1000)`
|
|
176
|
+
|
|
177
|
+
Example query. Purpose: get the lowest temperature from the `weather.measurements` table over
|
|
178
|
+
the last 10 years. Primary key: `date`. Performance guard: date range filter.
|
|
179
|
+
|
|
180
|
+
`SELECT min(temperature) FROM weather.measurements WHERE date > now() - INTERVAL 10 YEARS`
|
|
181
|
+
|
|
182
|
+
Example query. Purpose: get the app name with the most log messages from the `application.logs`
|
|
183
|
+
table in the window between new year and valentine's day of 2024. Primary key: `timestamp`.
|
|
184
|
+
Performance guard: date range filter.
|
|
185
|
+
`SELECT app, count(*) FROM application.logs WHERE timestamp > '2024-01-01' AND timestamp < '2024-02-14' GROUP BY app ORDER BY count(*) DESC LIMIT 1`
|
|
186
|
+
"""
|
|
187
|
+
logger.info(f"Executing SELECT query: {query}")
|
|
188
|
+
try:
|
|
189
|
+
future = QUERY_EXECUTOR.submit(execute_query, query)
|
|
190
|
+
try:
|
|
191
|
+
result = future.result(timeout=SELECT_QUERY_TIMEOUT_SECS)
|
|
192
|
+
# Check if we received an error structure from execute_query
|
|
193
|
+
if isinstance(result, dict) and "error" in result:
|
|
194
|
+
logger.warning(f"Query failed: {result['error']}")
|
|
195
|
+
# MCP requires structured responses; string error messages can cause
|
|
196
|
+
# serialization issues leading to BrokenResourceError
|
|
197
|
+
return {"status": "error", "message": f"Query failed: {result['error']}"}
|
|
198
|
+
return result
|
|
199
|
+
except concurrent.futures.TimeoutError:
|
|
200
|
+
logger.warning(f"Query timed out after {SELECT_QUERY_TIMEOUT_SECS} seconds: {query}")
|
|
201
|
+
future.cancel()
|
|
202
|
+
# Return a properly structured response for timeout errors
|
|
203
|
+
return {
|
|
204
|
+
"status": "error",
|
|
205
|
+
"message": f"Query timed out after {SELECT_QUERY_TIMEOUT_SECS} seconds",
|
|
206
|
+
}
|
|
207
|
+
except Exception as e:
|
|
208
|
+
logger.error(f"Unexpected error in run_select_query: {str(e)}")
|
|
209
|
+
# Catch all other exceptions and return them in a structured format
|
|
210
|
+
# to prevent MCP serialization failures
|
|
211
|
+
return {"status": "error", "message": f"Unexpected error: {str(e)}"}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def create_hydrolix_client():
|
|
215
|
+
client_config = config.get_client_config()
|
|
216
|
+
logger.info(
|
|
217
|
+
f"Creating Hydrolix client connection to {client_config['host']}:{client_config['port']} "
|
|
218
|
+
f"as {client_config['username']} "
|
|
219
|
+
f"(secure={client_config['secure']}, verify={client_config['verify']}, "
|
|
220
|
+
f"connect_timeout={client_config['connect_timeout']}s, "
|
|
221
|
+
f"send_receive_timeout={client_config['send_receive_timeout']}s)"
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
try:
|
|
225
|
+
client = clickhouse_connect.get_client(**client_config)
|
|
226
|
+
# Test the connection
|
|
227
|
+
version = client.server_version
|
|
228
|
+
logger.info(f"Successfully connected to Hydrolix server version {version}")
|
|
229
|
+
return client
|
|
230
|
+
except Exception as e:
|
|
231
|
+
logger.error(f"Failed to connect to Hydrolix: {str(e)}")
|
|
232
|
+
raise
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-hydrolix
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: An MCP server for Hydrolix.
|
|
5
|
+
Project-URL: Home, https://github.com/hydrolix/mcp-hydrolix
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Requires-Dist: clickhouse-connect>=0.8.0
|
|
10
|
+
Requires-Dist: mcp[cli]>=1.3.0
|
|
11
|
+
Requires-Dist: pip-system-certs>=4.0
|
|
12
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
13
|
+
Requires-Dist: uvicorn>=0.34.0
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
16
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# Hydrolix MCP Server
|
|
20
|
+
[](https://pypi.org/project/mcp-hydrolix)
|
|
21
|
+
|
|
22
|
+
An MCP server for Hydrolix.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
### Tools
|
|
27
|
+
|
|
28
|
+
* `run_select_query`
|
|
29
|
+
- Execute SQL queries on your Hydrolix cluster.
|
|
30
|
+
- Input: `sql` (string): The SQL query to execute.
|
|
31
|
+
- All Hydrolix queries are run with `readonly = 1` to ensure they are safe.
|
|
32
|
+
|
|
33
|
+
* `list_databases`
|
|
34
|
+
- List all databases on your Hydrolix cluster.
|
|
35
|
+
|
|
36
|
+
* `list_tables`
|
|
37
|
+
- List all tables in a database.
|
|
38
|
+
- Input: `database` (string): The name of the database.
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
1. Open the Claude Desktop configuration file located at:
|
|
43
|
+
- On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
44
|
+
- On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
45
|
+
|
|
46
|
+
2. Add the following:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"mcp-hydrolix": {
|
|
52
|
+
"command": "uv",
|
|
53
|
+
"args": [
|
|
54
|
+
"run",
|
|
55
|
+
"--with",
|
|
56
|
+
"mcp-hydrolix",
|
|
57
|
+
"--python",
|
|
58
|
+
"3.13",
|
|
59
|
+
"mcp-hydrolix"
|
|
60
|
+
],
|
|
61
|
+
"env": {
|
|
62
|
+
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
63
|
+
"HYDROLIX_PORT": "<hydrolix-port>",
|
|
64
|
+
"HYDROLIX_USER": "<hydrolix-user>",
|
|
65
|
+
"HYDROLIX_PASSWORD": "<hydrolix-password>",
|
|
66
|
+
"HYDROLIX_SECURE": "true",
|
|
67
|
+
"HYDROLIX_VERIFY": "true",
|
|
68
|
+
"HYDROLIX_CONNECT_TIMEOUT": "30",
|
|
69
|
+
"HYDROLIX_SEND_RECEIVE_TIMEOUT": "30"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Update the environment variables to point to your own Hydrolix service.
|
|
77
|
+
|
|
78
|
+
3. Locate the command entry for `uv` and replace it with the absolute path to the `uv` executable. This ensures that the correct version of `uv` is used when starting the server. On a mac, you can find this path using `which uv`.
|
|
79
|
+
|
|
80
|
+
4. Restart Claude Desktop to apply the changes.
|
|
81
|
+
|
|
82
|
+
### Environment Variables
|
|
83
|
+
|
|
84
|
+
The following environment variables are used to configure the Hydrolix connection:
|
|
85
|
+
|
|
86
|
+
#### Required Variables
|
|
87
|
+
* `HYDROLIX_HOST`: The hostname of your Hydrolix server
|
|
88
|
+
* `HYDROLIX_USER`: The username for authentication
|
|
89
|
+
* `HYDROLIX_PASSWORD`: The password for authentication
|
|
90
|
+
|
|
91
|
+
#### Optional Variables
|
|
92
|
+
* `HYDROLIX_PORT`: The port number of your Hydrolix server
|
|
93
|
+
- Default: `8088`
|
|
94
|
+
- Usually doesn't need to be set unless using a non-standard port
|
|
95
|
+
* `HYDROLIX_VERIFY`: Enable/disable SSL certificate verification
|
|
96
|
+
- Default: `"true"`
|
|
97
|
+
- Set to `"false"` to disable certificate verification (not recommended for production)
|
|
98
|
+
* `HYDROLIX_CONNECT_TIMEOUT`: Connection timeout in seconds
|
|
99
|
+
- Default: `"30"`
|
|
100
|
+
- Increase this value if you experience connection timeouts
|
|
101
|
+
* `HYDROLIX_SEND_RECEIVE_TIMEOUT`: Send/receive timeout in seconds
|
|
102
|
+
- Default: `"300"`
|
|
103
|
+
- Increase this value for long-running queries
|
|
104
|
+
* `HYDROLIX_DATABASE`: Default database to use
|
|
105
|
+
- Default: None (uses server default)
|
|
106
|
+
- Set this to automatically connect to a specific database
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
mcp_hydrolix/__init__.py,sha256=DnAQkvoFf_QhrDNFLOmn-nHlldPUgtdN33k3xJWthgc,225
|
|
2
|
+
mcp_hydrolix/main.py,sha256=WTZcvpIas2mIjNd_em7KWlXI_6IXZAdtdlQ7czmX1cs,96
|
|
3
|
+
mcp_hydrolix/mcp_env.py,sha256=PIMxbhImiSGs4PaqrvEFXjA7wkr2AwEMkjCnKPyMEZg,4091
|
|
4
|
+
mcp_hydrolix/mcp_server.py,sha256=EFkFy0658H0Fspo0e7oHiQNsWzBcP7tAcU0fo11iHz8,9813
|
|
5
|
+
mcp_hydrolix-0.1.0.dist-info/METADATA,sha256=KZRd6hGV42Hcx_DIM6TGbbzkEaSLP2ovHtHpuyO-0aY,3368
|
|
6
|
+
mcp_hydrolix-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
mcp_hydrolix-0.1.0.dist-info/entry_points.txt,sha256=vHa7F2rOCVu8lpsqR8BYbE1w8ugJSOYwX95w802Y5qE,56
|
|
8
|
+
mcp_hydrolix-0.1.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
9
|
+
mcp_hydrolix-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|