mcp-hydrolix 0.1.3__py3-none-any.whl → 0.1.5__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/auth/__init__.py +29 -0
- mcp_hydrolix/auth/credentials.py +63 -0
- mcp_hydrolix/auth/mcp_providers.py +137 -0
- mcp_hydrolix/log/__init__.py +6 -0
- mcp_hydrolix/log/log.py +60 -0
- mcp_hydrolix/log/log.yaml +40 -0
- mcp_hydrolix/log/utils.py +56 -0
- mcp_hydrolix/main.py +69 -1
- mcp_hydrolix/mcp_env.py +203 -22
- mcp_hydrolix/mcp_server.py +256 -164
- mcp_hydrolix/utils.py +70 -0
- mcp_hydrolix-0.1.5.dist-info/METADATA +314 -0
- mcp_hydrolix-0.1.5.dist-info/RECORD +17 -0
- {mcp_hydrolix-0.1.3.dist-info → mcp_hydrolix-0.1.5.dist-info}/WHEEL +1 -1
- {mcp_hydrolix-0.1.3.dist-info → mcp_hydrolix-0.1.5.dist-info}/licenses/LICENSE +1 -1
- mcp_hydrolix-0.1.3.dist-info/METADATA +0 -146
- mcp_hydrolix-0.1.3.dist-info/RECORD +0 -9
- {mcp_hydrolix-0.1.3.dist-info → mcp_hydrolix-0.1.5.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-hydrolix
|
|
3
|
+
Version: 0.1.5
|
|
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.10.0
|
|
10
|
+
Requires-Dist: fastmcp>=2.13.3
|
|
11
|
+
Requires-Dist: gunicorn>=23.0.0
|
|
12
|
+
Requires-Dist: pip-system-certs>=4.0
|
|
13
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
14
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: fastapi>=0.124.0; extra == 'dev'
|
|
17
|
+
Requires-Dist: mcp-clickhouse>=0.1.12; extra == 'dev'
|
|
18
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-repeat; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-xdist; extra == 'dev'
|
|
23
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Hydrolix MCP Server
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/mcp-hydrolix)
|
|
29
|
+
|
|
30
|
+
An MCP server for Hydrolix.
|
|
31
|
+
|
|
32
|
+
## Tools
|
|
33
|
+
|
|
34
|
+
* `run_select_query`
|
|
35
|
+
* Execute SQL queries on your Hydrolix cluster.
|
|
36
|
+
* Input: `sql` (string): The SQL query to execute.
|
|
37
|
+
* All Hydrolix queries are run with `readonly = 1` to ensure they are safe.
|
|
38
|
+
|
|
39
|
+
* `list_databases`
|
|
40
|
+
* List all databases on your Hydrolix cluster.
|
|
41
|
+
|
|
42
|
+
* `list_tables`
|
|
43
|
+
* List all tables in a database.
|
|
44
|
+
* Input: `database` (string): The name of the database.
|
|
45
|
+
|
|
46
|
+
## Effective Usage
|
|
47
|
+
|
|
48
|
+
Due to the wide variety in LLM architectures, not all models will proactively use the tools above, and few will use them effectively without guidance, even with the carefully-constructed tool descriptions provided to the model. To get the best results out of your model while using the Hydrolix MCP server, we recommend the following:
|
|
49
|
+
|
|
50
|
+
* Refer to your Hydrolix database by name and request tool usage in your prompts (e.g., "Using MCP tools to access my Hydrolix database, please ...")
|
|
51
|
+
- This encourages the model to use the MCP tools available and minimizes hallucinations.
|
|
52
|
+
* Include time ranges in your prompts (e.g., "Between December 5 2023 and January 18 2024, ...") and specifically request that the output be ordered by timestamp.
|
|
53
|
+
- This prompts the model to write more efficient queries that take advantage of [primary key optimizations](https://hydrolix.io/blog/optimizing-latest-n-row-queries/)
|
|
54
|
+
|
|
55
|
+
### Health Check Endpoint
|
|
56
|
+
|
|
57
|
+
When running with HTTP or SSE transport, a health check endpoint is available at `/health`. This endpoint:
|
|
58
|
+
- Returns `200 OK` with the Hydrolix query-head's Clickhouse version if the server is healthy and can connect to Hydrolix
|
|
59
|
+
- Returns `503 Service Unavailable` if the server cannot connect to the Hydrolix query-head
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
```bash
|
|
63
|
+
curl http://localhost:8000/health
|
|
64
|
+
# Response: OK - Connected to Hydrolix compatible with ClickHouse 24.3.1
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
The Hydrolix MCP server is configured using a standard MCP server entry. Consult your client's documentation for specific instructions on where to find or declare MCP servers. An example setup using Claude Desktop is documented below.
|
|
70
|
+
|
|
71
|
+
The recommended way to launch the Hydrolix MCP server is via the [`uv` project manager](https://github.com/astral-sh/uv), which will manage installing all other dependencies in an isolated environment.
|
|
72
|
+
|
|
73
|
+
### Authentication
|
|
74
|
+
|
|
75
|
+
The server supports multiple authentication methods with the following precedence (highest to lowest):
|
|
76
|
+
|
|
77
|
+
1. **Per-request Bearer token**: Service account token provided via `Authorization: Bearer <token>` header
|
|
78
|
+
2. **Per-request GET parameter**: Service account token provided via `?token=<token>` query parameter
|
|
79
|
+
3. **Environment-based credentials**: Credentials configured via environment variables
|
|
80
|
+
- Service account token (`HYDROLIX_TOKEN`), or
|
|
81
|
+
- Username and password (`HYDROLIX_USER` and `HYDROLIX_PASSWORD`)
|
|
82
|
+
|
|
83
|
+
When multiple authentication methods are configured, the server will use the first available method in the precedence order above. Per-request authentication is only available when using HTTP or SSE transport modes.
|
|
84
|
+
|
|
85
|
+
MCP Server definition using username and password (JSON):
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"command": "uv",
|
|
90
|
+
"args": [
|
|
91
|
+
"run",
|
|
92
|
+
"--with",
|
|
93
|
+
"mcp-hydrolix",
|
|
94
|
+
"--python",
|
|
95
|
+
"3.13",
|
|
96
|
+
"mcp-hydrolix"
|
|
97
|
+
],
|
|
98
|
+
"env": {
|
|
99
|
+
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
100
|
+
"HYDROLIX_USER": "<hydrolix-user>",
|
|
101
|
+
"HYDROLIX_PASSWORD": "<hydrolix-password>"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
MCP Server definition using service account token (JSON):
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"command": "uv",
|
|
111
|
+
"args": [
|
|
112
|
+
"run",
|
|
113
|
+
"--with",
|
|
114
|
+
"mcp-hydrolix",
|
|
115
|
+
"--python",
|
|
116
|
+
"3.13",
|
|
117
|
+
"mcp-hydrolix"
|
|
118
|
+
],
|
|
119
|
+
"env": {
|
|
120
|
+
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
121
|
+
"HYDROLIX_TOKEN": "<hydrolix-service-account-token>"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
MCP Server definition using username and password (YAML):
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
command: uv
|
|
130
|
+
args:
|
|
131
|
+
- run
|
|
132
|
+
- --with
|
|
133
|
+
- mcp-hydrolix
|
|
134
|
+
- --python
|
|
135
|
+
- "3.13"
|
|
136
|
+
- mcp-hydrolix
|
|
137
|
+
env:
|
|
138
|
+
HYDROLIX_HOST: <hydrolix-host>
|
|
139
|
+
HYDROLIX_USER: <hydrolix-user>
|
|
140
|
+
HYDROLIX_PASSWORD: <hydrolix-password>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
MCP Server definition using service account token (YAML):
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
command: uv
|
|
147
|
+
args:
|
|
148
|
+
- run
|
|
149
|
+
- --with
|
|
150
|
+
- mcp-hydrolix
|
|
151
|
+
- --python
|
|
152
|
+
- "3.13"
|
|
153
|
+
- mcp-hydrolix
|
|
154
|
+
env:
|
|
155
|
+
HYDROLIX_HOST: <hydrolix-host>
|
|
156
|
+
HYDROLIX_TOKEN: <hydrolix-service-account-token>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Configuration Example (Claude Desktop)
|
|
160
|
+
|
|
161
|
+
1. Open the Claude Desktop configuration file located at:
|
|
162
|
+
- On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
163
|
+
- On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
164
|
+
|
|
165
|
+
2. Add a `mcp-hydrolix` server entry to the `mcpServers` config block to use username and password:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"mcp-hydrolix": {
|
|
171
|
+
"command": "uv",
|
|
172
|
+
"args": [
|
|
173
|
+
"run",
|
|
174
|
+
"--with",
|
|
175
|
+
"mcp-hydrolix",
|
|
176
|
+
"--python",
|
|
177
|
+
"3.13",
|
|
178
|
+
"mcp-hydrolix"
|
|
179
|
+
],
|
|
180
|
+
"env": {
|
|
181
|
+
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
182
|
+
"HYDROLIX_USER": "<hydrolix-user>",
|
|
183
|
+
"HYDROLIX_PASSWORD": "<hydrolix-password>"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
To leverage service account use the following config block:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"mcpServers": {
|
|
195
|
+
"mcp-hydrolix": {
|
|
196
|
+
"command": "uv",
|
|
197
|
+
"args": [
|
|
198
|
+
"run",
|
|
199
|
+
"--with",
|
|
200
|
+
"mcp-hydrolix",
|
|
201
|
+
"--python",
|
|
202
|
+
"3.13",
|
|
203
|
+
"mcp-hydrolix"
|
|
204
|
+
],
|
|
205
|
+
"env": {
|
|
206
|
+
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
207
|
+
"HYDROLIX_TOKEN": "<hydrolix-service-account-token>"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
3. Update the environment variable definitions to point to your Hydrolix cluster.
|
|
215
|
+
|
|
216
|
+
4. (Recommended) 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. You can find this path using `which uv` or `where.exe uv`.
|
|
217
|
+
|
|
218
|
+
5. Restart Claude Desktop to apply the changes. If you are using Windows, ensure Claude is stopped completely by closing the client using the system tray icon.
|
|
219
|
+
|
|
220
|
+
### Configuration Example (Claude Code)
|
|
221
|
+
|
|
222
|
+
To configure the Hydrolix MCP server for Claude Code, run the following command:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
claude mcp add --transport stdio hydrolix \
|
|
226
|
+
--env HYDROLIX_USER=<hydrolix-user> \
|
|
227
|
+
--env HYDROLIX_PASSWORD=<hydrolix-password> \
|
|
228
|
+
--env HYDROLIX_HOST=<hydrolix-host> \
|
|
229
|
+
--env HYDROLIX_MCP_SERVER_TRANSPORT=stdio \
|
|
230
|
+
-- uv run --with mcp-hydrolix --python 3.13 mcp-hydrolix
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Environment Variables
|
|
234
|
+
|
|
235
|
+
The following variables are used to configure the Hydrolix connection. These variables may be provided via the MCP config block (as shown above), a `.env` file, or traditional environment variables.
|
|
236
|
+
|
|
237
|
+
#### Required Variables
|
|
238
|
+
* `HYDROLIX_HOST`: The hostname of your Hydrolix server
|
|
239
|
+
|
|
240
|
+
#### Authentication Variables
|
|
241
|
+
At least one authentication method must be configured when using the stdio transport:
|
|
242
|
+
|
|
243
|
+
* `HYDROLIX_TOKEN`: Service account token for environment-based authentication
|
|
244
|
+
* `HYDROLIX_USER` and `HYDROLIX_PASSWORD`: Username and password for environment-based authentication (both must be provided together)
|
|
245
|
+
|
|
246
|
+
In summary:
|
|
247
|
+
- For stdio, you MUST use HYDROLIX_TOKEN or HYDROLIX_USER+HYDROLIX_PASS (environmental credentials)
|
|
248
|
+
- For http/sse, you MAY use HYDROLIX_TOKEN or HYDROLIX_USER+HYDROLIX_PASS (environmental credentials), but you may instead use per-request credentials.
|
|
249
|
+
|
|
250
|
+
If no credentials are provided via the environment or the request, the request will fail.
|
|
251
|
+
|
|
252
|
+
#### Optional Variables
|
|
253
|
+
* `HYDROLIX_PORT`: The port number of your Hydrolix server
|
|
254
|
+
* Default: `8088`
|
|
255
|
+
* Usually doesn't need to be set unless using a non-standard port
|
|
256
|
+
* `HYDROLIX_VERIFY`: Enable/disable SSL certificate verification
|
|
257
|
+
* Default: `"true"`
|
|
258
|
+
* Set to `"false"` to disable certificate verification (not recommended for production)
|
|
259
|
+
* `HYDROLIX_DATABASE`: Default database to use
|
|
260
|
+
*Default: None (uses server default)
|
|
261
|
+
* Set this to automatically connect to a specific database
|
|
262
|
+
* `HYDROLIX_MCP_SERVER_TRANSPORT`: Sets the transport method for the MCP server.
|
|
263
|
+
* Default: `"stdio"`
|
|
264
|
+
* Valid options: `"stdio"`, `"http"`, `"sse"`. This is useful for local development with tools like MCP Inspector.
|
|
265
|
+
* `HYDROLIX_MCP_BIND_HOST`: Host to bind the MCP server to when using HTTP or SSE transport
|
|
266
|
+
* Default: `"127.0.0.1"`
|
|
267
|
+
* Set to `"0.0.0.0"` to bind to all network interfaces (useful for Docker or remote access)
|
|
268
|
+
* Only used when transport is `"http"` or `"sse"`
|
|
269
|
+
* `HYDROLIX_MCP_BIND_PORT`: Port to bind the MCP server to when using HTTP or SSE transport
|
|
270
|
+
* Default: `"8000"`
|
|
271
|
+
* Only used when transport is `"http"` or `"sse"`
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
For MCP Inspector or remote access with HTTP transport:
|
|
275
|
+
|
|
276
|
+
```env
|
|
277
|
+
HYDROLIX_HOST=localhost
|
|
278
|
+
HYDROLIX_USER=default
|
|
279
|
+
HYDROLIX_PASSWORD=myPassword
|
|
280
|
+
HYDROLIX_MCP_SERVER_TRANSPORT=http
|
|
281
|
+
HYDROLIX_MCP_BIND_HOST=0.0.0.0 # Bind to all interfaces
|
|
282
|
+
HYDROLIX_MCP_BIND_PORT=4200 # Custom port (default: 8000)
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
When using HTTP transport, the server will run on the configured port (default 8000). For example, with the above configuration:
|
|
286
|
+
- MCP endpoint: `http://localhost:4200/mcp`
|
|
287
|
+
- Health check: `http://localhost:4200/health`
|
|
288
|
+
|
|
289
|
+
#### Using Per-Request Authentication with HTTP Transport
|
|
290
|
+
|
|
291
|
+
When using HTTP or SSE transport, you can omit environment-based credentials and instead provide authentication per-request. This is useful for multi-user scenarios or with clients that don't support running MCP servers locally.
|
|
292
|
+
|
|
293
|
+
Example `mcpServers` configuration connecting to a remote HTTP server with per-request authentication:
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"mcpServers": {
|
|
298
|
+
"mcp-hydrolix-remote": {
|
|
299
|
+
"url": "http://my-hydrolix-mcp.example.com:8000/mcp?token=<service-account-token>"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Example minimal `.env` configuration for running your own HTTP server without environment credentials:
|
|
306
|
+
|
|
307
|
+
```env
|
|
308
|
+
HYDROLIX_HOST=my-cluster.hydrolix.net
|
|
309
|
+
HYDROLIX_MCP_SERVER_TRANSPORT=http
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Though not part of the MCP specification, many MCP clients allow adding headers to MCP-issued requests. When this is possible, we recommend configuring the MCP client to pass a service account token via the `Authorization: Bearer <sa-token-here>` header instead of as a query parameter for greater security.
|
|
313
|
+
|
|
314
|
+
Note: The bind host and port settings are only used when transport is set to "http" or "sse".
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
mcp_hydrolix/__init__.py,sha256=DnAQkvoFf_QhrDNFLOmn-nHlldPUgtdN33k3xJWthgc,225
|
|
2
|
+
mcp_hydrolix/main.py,sha256=Q58yz9ykx0bilptGALXW_Lli0pR7wDNOPib34l1z8Sg,2760
|
|
3
|
+
mcp_hydrolix/mcp_env.py,sha256=CM8LG1ce1-LyM_CUm3Fg8hCoVi3ef5Lv-kLUVji7Jj0,11521
|
|
4
|
+
mcp_hydrolix/mcp_server.py,sha256=CyOozGeu0MYX3m2UdaFAECyXA7Zk2fM_5pwh6mxI-Ng,12475
|
|
5
|
+
mcp_hydrolix/utils.py,sha256=fMGCsRa2DqlS2PMfIpD5VaHTbaxUkW7mvgArgVViXbs,2433
|
|
6
|
+
mcp_hydrolix/auth/__init__.py,sha256=uWF8v7ooLEcgBctxgyf4E4gtM_-PQM3xYTljA-Pbgnk,622
|
|
7
|
+
mcp_hydrolix/auth/credentials.py,sha256=IK8w6TjNxS1K0LCKBt3xXOOI-0ogWCVAkiJuOzEJuJY,1915
|
|
8
|
+
mcp_hydrolix/auth/mcp_providers.py,sha256=LSijw3RxC_BB9NnWXUSfWOSBjHwAk-vK41zYVM4CbFU,5177
|
|
9
|
+
mcp_hydrolix/log/__init__.py,sha256=n7S4B06C1B6ZrOyz_15BbQ72D3lmmVNfOcc2qYiKans,103
|
|
10
|
+
mcp_hydrolix/log/log.py,sha256=6KX0oSz-BbCWUoPxbJED4sZBmbgCHa3KDrc5nYtdks4,1838
|
|
11
|
+
mcp_hydrolix/log/log.yaml,sha256=ldw66lGkQjqyJ92gJqOtdP63T_3MSD_ndKU1p8Xegvs,978
|
|
12
|
+
mcp_hydrolix/log/utils.py,sha256=iwiFB331RzlWndhL8fbzPUmNlWS0e4qCV8n6W2Hpi5s,2088
|
|
13
|
+
mcp_hydrolix-0.1.5.dist-info/METADATA,sha256=UVLw_p_jxkng-iKuDe-UffCWIcP7ci2OIAJ1UWlQ-VE,11074
|
|
14
|
+
mcp_hydrolix-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
15
|
+
mcp_hydrolix-0.1.5.dist-info/entry_points.txt,sha256=vHa7F2rOCVu8lpsqR8BYbE1w8ugJSOYwX95w802Y5qE,56
|
|
16
|
+
mcp_hydrolix-0.1.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
mcp_hydrolix-0.1.5.dist-info/RECORD,,
|
|
@@ -198,4 +198,4 @@
|
|
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
201
|
+
limitations under the License.
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: mcp-hydrolix
|
|
3
|
-
Version: 0.1.3
|
|
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.16
|
|
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
|
-
## Tools
|
|
25
|
-
|
|
26
|
-
* `run_select_query`
|
|
27
|
-
- Execute SQL queries on your Hydrolix cluster.
|
|
28
|
-
- Input: `sql` (string): The SQL query to execute.
|
|
29
|
-
- All Hydrolix queries are run with `readonly = 1` to ensure they are safe.
|
|
30
|
-
|
|
31
|
-
* `list_databases`
|
|
32
|
-
- List all databases on your Hydrolix cluster.
|
|
33
|
-
|
|
34
|
-
* `list_tables`
|
|
35
|
-
- List all tables in a database.
|
|
36
|
-
- Input: `database` (string): The name of the database.
|
|
37
|
-
|
|
38
|
-
## Effective Usage
|
|
39
|
-
|
|
40
|
-
Due to the wide variety in LLM architectures, not all models will proactively use the tools above, and few will use them effectively without guidance, even with the carefully-constructed tool descriptions provided to the model. To get the best results out of your model while using the Hydrolix MCP server, we recommend the following:
|
|
41
|
-
|
|
42
|
-
* Refer to your Hydrolix database by name and request tool usage in your prompts (e.g., "Using MCP tools to access my Hydrolix database, please ...")
|
|
43
|
-
- This encourages the model to use the MCP tools available and minimizes hallucinations.
|
|
44
|
-
* Include time ranges in your prompts (e.g., "Between December 5 2023 and January 18 2024, ...") and specifically request that the output be ordered by timestamp.
|
|
45
|
-
- This prompts the model to write more efficient queries that take advantage of [primary key optimizations](https://hydrolix.io/blog/optimizing-latest-n-row-queries/)
|
|
46
|
-
|
|
47
|
-
## Configuration
|
|
48
|
-
|
|
49
|
-
The Hydrolix MCP server is configured using a standard MCP server entry. Consult your client's documentation for specific instructions on where to find or declare MCP servers. An example setup using Claude Desktop is documented below.
|
|
50
|
-
|
|
51
|
-
The recommended way to launch the Hydrolix MCP server is via the [`uv` project manager](https://github.com/astral-sh/uv), which will manage installing all other dependencies in an isolated environment.
|
|
52
|
-
|
|
53
|
-
MCP Server definition (JSON):
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"command": "uv",
|
|
58
|
-
"args": [
|
|
59
|
-
"run",
|
|
60
|
-
"--with",
|
|
61
|
-
"mcp-hydrolix",
|
|
62
|
-
"--python",
|
|
63
|
-
"3.13",
|
|
64
|
-
"mcp-hydrolix"
|
|
65
|
-
],
|
|
66
|
-
"env": {
|
|
67
|
-
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
68
|
-
"HYDROLIX_USER": "<hydrolix-user>",
|
|
69
|
-
"HYDROLIX_PASSWORD": "<hydrolix-password>"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
MCP Server definition (YAML):
|
|
75
|
-
|
|
76
|
-
```yaml
|
|
77
|
-
command: uv
|
|
78
|
-
args:
|
|
79
|
-
- run
|
|
80
|
-
- --with
|
|
81
|
-
- mcp-hydrolix
|
|
82
|
-
- --python
|
|
83
|
-
- "3.13"
|
|
84
|
-
- mcp-hydrolix
|
|
85
|
-
env:
|
|
86
|
-
HYDROLIX_HOST: <hydrolix-host>
|
|
87
|
-
HYDROLIX_USER: <hydrolix-user>
|
|
88
|
-
HYDROLIX_PASSWORD: <hydrolix-password>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Configuration Example (Claude Desktop)
|
|
92
|
-
|
|
93
|
-
1. Open the Claude Desktop configuration file located at:
|
|
94
|
-
- On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
95
|
-
- On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
96
|
-
|
|
97
|
-
2. Add a `mcp-hydrolix` server entry to the `mcpServers` config block:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"mcpServers": {
|
|
102
|
-
"mcp-hydrolix": {
|
|
103
|
-
"command": "uv",
|
|
104
|
-
"args": [
|
|
105
|
-
"run",
|
|
106
|
-
"--with",
|
|
107
|
-
"mcp-hydrolix",
|
|
108
|
-
"--python",
|
|
109
|
-
"3.13",
|
|
110
|
-
"mcp-hydrolix"
|
|
111
|
-
],
|
|
112
|
-
"env": {
|
|
113
|
-
"HYDROLIX_HOST": "<hydrolix-host>",
|
|
114
|
-
"HYDROLIX_USER": "<hydrolix-user>",
|
|
115
|
-
"HYDROLIX_PASSWORD": "<hydrolix-password>"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
3. Update the environment variable definitions to point to your Hydrolix cluster.
|
|
123
|
-
|
|
124
|
-
4. (Recommended) 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. You can find this path using `which uv` or `where.exe uv`.
|
|
125
|
-
|
|
126
|
-
5. Restart Claude Desktop to apply the changes. If you are using Windows, ensure Claude is stopped completely by closing the client using the system tray icon.
|
|
127
|
-
|
|
128
|
-
### Environment Variables
|
|
129
|
-
|
|
130
|
-
The following variables are used to configure the Hydrolix connection. These variables may be provided via the MCP config block (as shown above), a `.env` file, or traditional environment variables.
|
|
131
|
-
|
|
132
|
-
#### Required Variables
|
|
133
|
-
* `HYDROLIX_HOST`: The hostname of your Hydrolix server
|
|
134
|
-
* `HYDROLIX_USER`: The username for authentication
|
|
135
|
-
* `HYDROLIX_PASSWORD`: The password for authentication
|
|
136
|
-
|
|
137
|
-
#### Optional Variables
|
|
138
|
-
* `HYDROLIX_PORT`: The port number of your Hydrolix server
|
|
139
|
-
- Default: `8088`
|
|
140
|
-
- Usually doesn't need to be set unless using a non-standard port
|
|
141
|
-
* `HYDROLIX_VERIFY`: Enable/disable SSL certificate verification
|
|
142
|
-
- Default: `"true"`
|
|
143
|
-
- Set to `"false"` to disable certificate verification (not recommended for production)
|
|
144
|
-
* `HYDROLIX_DATABASE`: Default database to use
|
|
145
|
-
- Default: None (uses server default)
|
|
146
|
-
- Set this to automatically connect to a specific database
|
|
@@ -1,9 +0,0 @@
|
|
|
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=HPOPRdPm-YAxU3ygdZPoNT8Oc4CE-VWXF6mmton5mnU,4454
|
|
4
|
-
mcp_hydrolix/mcp_server.py,sha256=xzEILclKF88KE8OZljiaAHwPcfiyt5DE_amPnqVyMFQ,10017
|
|
5
|
-
mcp_hydrolix-0.1.3.dist-info/METADATA,sha256=EEc9-0SGJc6AGmSQHvrbki6unzxV7c1m2IoLJhMWBuo,5152
|
|
6
|
-
mcp_hydrolix-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
mcp_hydrolix-0.1.3.dist-info/entry_points.txt,sha256=vHa7F2rOCVu8lpsqR8BYbE1w8ugJSOYwX95w802Y5qE,56
|
|
8
|
-
mcp_hydrolix-0.1.3.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
9
|
-
mcp_hydrolix-0.1.3.dist-info/RECORD,,
|
|
File without changes
|