mcp-hydrolix 0.1.5__py3-none-any.whl → 0.1.7__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 +2 -2
- mcp_hydrolix/auth/mcp_providers.py +1 -1
- mcp_hydrolix/log/__init__.py +1 -1
- mcp_hydrolix/log/log.yaml +4 -0
- mcp_hydrolix/log/utils.py +1 -1
- mcp_hydrolix/main.py +1 -0
- mcp_hydrolix/mcp_env.py +1 -1
- mcp_hydrolix/mcp_server.py +26 -11
- mcp_hydrolix/utils.py +4 -4
- {mcp_hydrolix-0.1.5.dist-info → mcp_hydrolix-0.1.7.dist-info}/METADATA +10 -9
- mcp_hydrolix-0.1.7.dist-info/RECORD +17 -0
- mcp_hydrolix-0.1.5.dist-info/RECORD +0 -17
- {mcp_hydrolix-0.1.5.dist-info → mcp_hydrolix-0.1.7.dist-info}/WHEEL +0 -0
- {mcp_hydrolix-0.1.5.dist-info → mcp_hydrolix-0.1.7.dist-info}/entry_points.txt +0 -0
- {mcp_hydrolix-0.1.5.dist-info → mcp_hydrolix-0.1.7.dist-info}/licenses/LICENSE +0 -0
mcp_hydrolix/auth/__init__.py
CHANGED
|
@@ -4,12 +4,12 @@ This package contains authentication-related types used to define hydrolix auth
|
|
|
4
4
|
in terms of FastMCP infrastructure
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from .credentials import (
|
|
7
|
+
from mcp_hydrolix.auth.credentials import (
|
|
8
8
|
HydrolixCredential,
|
|
9
9
|
ServiceAccountToken,
|
|
10
10
|
UsernamePassword,
|
|
11
11
|
)
|
|
12
|
-
from .mcp_providers import (
|
|
12
|
+
from mcp_hydrolix.auth.mcp_providers import (
|
|
13
13
|
TOKEN_PARAM,
|
|
14
14
|
AccessToken,
|
|
15
15
|
ChainedAuthBackend,
|
|
@@ -18,7 +18,7 @@ from starlette.middleware import Middleware
|
|
|
18
18
|
from starlette.middleware.authentication import AuthenticationMiddleware
|
|
19
19
|
from starlette.requests import HTTPConnection, Request
|
|
20
20
|
|
|
21
|
-
from .credentials import HydrolixCredential, ServiceAccountToken
|
|
21
|
+
from mcp_hydrolix.auth.credentials import HydrolixCredential, ServiceAccountToken
|
|
22
22
|
|
|
23
23
|
TOKEN_PARAM: Final[str] = "token"
|
|
24
24
|
|
mcp_hydrolix/log/__init__.py
CHANGED
mcp_hydrolix/log/log.yaml
CHANGED
mcp_hydrolix/log/utils.py
CHANGED
mcp_hydrolix/main.py
CHANGED
mcp_hydrolix/mcp_env.py
CHANGED
|
@@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|
|
9
9
|
from enum import Enum
|
|
10
10
|
from typing import Optional
|
|
11
11
|
|
|
12
|
-
from .auth.credentials import HydrolixCredential, ServiceAccountToken, UsernamePassword
|
|
12
|
+
from mcp_hydrolix.auth.credentials import HydrolixCredential, ServiceAccountToken, UsernamePassword
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class TransportType(str, Enum):
|
mcp_hydrolix/mcp_server.py
CHANGED
|
@@ -13,20 +13,21 @@ from dotenv import load_dotenv
|
|
|
13
13
|
from fastmcp import FastMCP
|
|
14
14
|
from fastmcp.exceptions import ToolError
|
|
15
15
|
from fastmcp.server.dependencies import get_access_token
|
|
16
|
+
from jwt import DecodeError
|
|
16
17
|
from pydantic import Field
|
|
17
18
|
from pydantic.dataclasses import dataclass
|
|
18
19
|
from starlette.requests import Request
|
|
19
20
|
from starlette.responses import PlainTextResponse
|
|
20
21
|
|
|
21
|
-
from .auth import (
|
|
22
|
+
from mcp_hydrolix.auth import (
|
|
22
23
|
AccessToken,
|
|
23
24
|
HydrolixCredential,
|
|
24
25
|
HydrolixCredentialChain,
|
|
25
26
|
ServiceAccountToken,
|
|
26
27
|
UsernamePassword,
|
|
27
28
|
)
|
|
28
|
-
from .mcp_env import HydrolixConfig, get_config
|
|
29
|
-
from .utils import with_serializer
|
|
29
|
+
from mcp_hydrolix.mcp_env import HydrolixConfig, get_config
|
|
30
|
+
from mcp_hydrolix.utils import with_serializer
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
@dataclass
|
|
@@ -76,19 +77,17 @@ HYDROLIX_CONFIG: Final[HydrolixConfig] = get_config()
|
|
|
76
77
|
|
|
77
78
|
mcp = FastMCP(
|
|
78
79
|
name=MCP_SERVER_NAME,
|
|
79
|
-
|
|
80
|
-
"clickhouse-connect",
|
|
81
|
-
"python-dotenv",
|
|
82
|
-
"pip-system-certs",
|
|
83
|
-
],
|
|
84
|
-
auth=HydrolixCredentialChain(f"https://{HYDROLIX_CONFIG.host}/config"),
|
|
80
|
+
auth=HydrolixCredentialChain(None),
|
|
85
81
|
)
|
|
86
82
|
|
|
87
83
|
|
|
88
84
|
def get_request_credential() -> Optional[HydrolixCredential]:
|
|
89
85
|
if (token := get_access_token()) is not None:
|
|
90
86
|
if isinstance(token, AccessToken):
|
|
91
|
-
|
|
87
|
+
try:
|
|
88
|
+
return token.as_credential()
|
|
89
|
+
except DecodeError:
|
|
90
|
+
raise ValueError("The provided access token is invalid.")
|
|
92
91
|
else:
|
|
93
92
|
raise ValueError(
|
|
94
93
|
"Found non-hydrolix access token on request -- this should be impossible!"
|
|
@@ -132,7 +131,23 @@ async def create_hydrolix_client(pool_mgr, request_credential: Optional[Hydrolix
|
|
|
132
131
|
# allow custom hydrolix settings in CH client
|
|
133
132
|
common.set_setting("invalid_setting_action", "send")
|
|
134
133
|
common.set_setting("autogenerate_session_id", False)
|
|
135
|
-
|
|
134
|
+
|
|
135
|
+
pool_kwargs = {
|
|
136
|
+
"maxsize": HYDROLIX_CONFIG.query_pool_size,
|
|
137
|
+
"num_pools": 1,
|
|
138
|
+
"verify": HYDROLIX_CONFIG.verify,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# When verify=True, use certifi CA bundle for SSL verification
|
|
142
|
+
# This ensures we trust modern CAs like Let's Encrypt
|
|
143
|
+
if HYDROLIX_CONFIG.verify:
|
|
144
|
+
pool_kwargs["ca_cert"] = "certifi"
|
|
145
|
+
else:
|
|
146
|
+
import urllib3
|
|
147
|
+
|
|
148
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
149
|
+
|
|
150
|
+
client_shared_pool = httputil.get_pool_manager(**pool_kwargs)
|
|
136
151
|
|
|
137
152
|
|
|
138
153
|
def term(*args, **kwargs):
|
mcp_hydrolix/utils.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import ipaddress
|
|
3
3
|
import json
|
|
4
|
-
from datetime import datetime, time
|
|
4
|
+
from datetime import datetime, time, date
|
|
5
5
|
from decimal import Decimal
|
|
6
6
|
from functools import wraps
|
|
7
7
|
|
|
@@ -16,9 +16,9 @@ class ExtendedEncoder(json.JSONEncoder):
|
|
|
16
16
|
if isinstance(obj, ipaddress.IPv4Address):
|
|
17
17
|
return str(obj)
|
|
18
18
|
if isinstance(obj, datetime):
|
|
19
|
-
return obj.
|
|
20
|
-
if isinstance(obj, time):
|
|
21
|
-
return obj.
|
|
19
|
+
return obj.timestamp()
|
|
20
|
+
if isinstance(obj, (date, time)):
|
|
21
|
+
return obj.isoformat()
|
|
22
22
|
if isinstance(obj, bytes):
|
|
23
23
|
return obj.decode()
|
|
24
24
|
if isinstance(obj, Decimal):
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-hydrolix
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: An MCP server for Hydrolix.
|
|
5
5
|
Project-URL: Home, https://github.com/hydrolix/mcp-hydrolix
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Python: >=3.13
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
9
|
+
Requires-Dist: certifi>=2026.1.4
|
|
10
|
+
Requires-Dist: clickhouse-connect<0.11,>=0.10
|
|
11
|
+
Requires-Dist: fastmcp<2.15,>=2.14
|
|
12
|
+
Requires-Dist: gunicorn<24.0,>=23.0
|
|
13
|
+
Requires-Dist: pip-system-certs<5.0,>=4.0
|
|
14
|
+
Requires-Dist: pyjwt<2.11,>=2.10
|
|
15
|
+
Requires-Dist: python-dotenv<1.2,>=1.1
|
|
15
16
|
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: fastapi>=0.124
|
|
17
|
-
Requires-Dist: mcp-clickhouse
|
|
17
|
+
Requires-Dist: fastapi>=0.124; extra == 'dev'
|
|
18
|
+
Requires-Dist: mcp-clickhouse==0.1.13; extra == 'dev'
|
|
18
19
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
19
20
|
Requires-Dist: pytest; extra == 'dev'
|
|
20
21
|
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
mcp_hydrolix/__init__.py,sha256=DnAQkvoFf_QhrDNFLOmn-nHlldPUgtdN33k3xJWthgc,225
|
|
2
|
+
mcp_hydrolix/main.py,sha256=mGO6dvc_yHQfw5SfIUFVbjZZBNMPdtzkA4HICs8JJ9g,2797
|
|
3
|
+
mcp_hydrolix/mcp_env.py,sha256=For5l-G67ihJJbW4d4qpZNZvhxsIfT0AXGQsg8-3BMk,11533
|
|
4
|
+
mcp_hydrolix/mcp_server.py,sha256=PbM3IoqXrQugBZU4jzoF1nRTht99_kCSgVEFYI0xE9w,12890
|
|
5
|
+
mcp_hydrolix/utils.py,sha256=G7t4lajZIsQOl_oOHUQyEqytsPJpN71WcLkv1cbxsJk,2391
|
|
6
|
+
mcp_hydrolix/auth/__init__.py,sha256=Ui9pLq3Z5tH8X56T_SqACRLEU9zl1gmcONWif-GV1Ko,656
|
|
7
|
+
mcp_hydrolix/auth/credentials.py,sha256=IK8w6TjNxS1K0LCKBt3xXOOI-0ogWCVAkiJuOzEJuJY,1915
|
|
8
|
+
mcp_hydrolix/auth/mcp_providers.py,sha256=4lexSj6tqCgPb5GGbuG5_wIocvSvQbqx8CHNl9D6OCA,5194
|
|
9
|
+
mcp_hydrolix/log/__init__.py,sha256=1K-ycdGrawELMLSBeiqE8bV3-SFJYOE0dD_U3PAP2QM,119
|
|
10
|
+
mcp_hydrolix/log/log.py,sha256=6KX0oSz-BbCWUoPxbJED4sZBmbgCHa3KDrc5nYtdks4,1838
|
|
11
|
+
mcp_hydrolix/log/log.yaml,sha256=uQEW_LYSur_C4h0wR_vaYOVKE0an9tXozFMpjeZS5V8,1052
|
|
12
|
+
mcp_hydrolix/log/utils.py,sha256=gOnlo25-sGZydGJmr6T94Pb805RZ9LcZlLCRaVEuUv4,2099
|
|
13
|
+
mcp_hydrolix-0.1.7.dist-info/METADATA,sha256=bew84FwBgpu1yWUakhBgz6IUPTfvY3cOu4w0ed7iNOA,11129
|
|
14
|
+
mcp_hydrolix-0.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
15
|
+
mcp_hydrolix-0.1.7.dist-info/entry_points.txt,sha256=vHa7F2rOCVu8lpsqR8BYbE1w8ugJSOYwX95w802Y5qE,56
|
|
16
|
+
mcp_hydrolix-0.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
mcp_hydrolix-0.1.7.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|