qualys-mcp 2.1.6__tar.gz → 2.1.8__tar.gz
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.
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/PKG-INFO +1 -1
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/pyproject.toml +1 -1
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/qualys_mcp.py +13 -5
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/.gitignore +0 -0
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/LICENSE +0 -0
- {qualys_mcp-2.1.6 → qualys_mcp-2.1.8}/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qualys-mcp
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.8
|
|
4
4
|
Summary: MCP server for Qualys security APIs - natural language interaction with vulnerability, asset, and cloud security data
|
|
5
5
|
Project-URL: Homepage, https://github.com/nelssec/qualys-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/nelssec/qualys-mcp
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qualys-mcp"
|
|
7
|
-
version = "2.1.
|
|
7
|
+
version = "2.1.8"
|
|
8
8
|
description = "MCP server for Qualys security APIs - natural language interaction with vulnerability, asset, and cloud security data"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -27,18 +27,22 @@ BASIC_AUTH = base64.b64encode(f"{USERNAME}:{PASSWORD}".encode()).decode()
|
|
|
27
27
|
BEARER_TOKEN = None
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
AUTH_ERROR = None
|
|
31
|
+
|
|
30
32
|
def get_bearer_token():
|
|
31
|
-
global BEARER_TOKEN
|
|
33
|
+
global BEARER_TOKEN, AUTH_ERROR
|
|
32
34
|
if BEARER_TOKEN:
|
|
33
35
|
return BEARER_TOKEN
|
|
34
36
|
try:
|
|
35
|
-
|
|
36
|
-
req
|
|
37
|
+
auth_data = urlencode({'username': USERNAME, 'password': PASSWORD, 'token': 'true'}).encode()
|
|
38
|
+
req = Request(f"{GATEWAY_URL}/auth", data=auth_data, method='POST')
|
|
37
39
|
req.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
|
38
|
-
with urlopen(req,
|
|
40
|
+
with urlopen(req, timeout=30) as resp:
|
|
39
41
|
BEARER_TOKEN = resp.read().decode().strip()
|
|
42
|
+
AUTH_ERROR = None
|
|
40
43
|
return BEARER_TOKEN
|
|
41
|
-
except:
|
|
44
|
+
except Exception as e:
|
|
45
|
+
AUTH_ERROR = str(e)
|
|
42
46
|
return None
|
|
43
47
|
|
|
44
48
|
|
|
@@ -816,9 +820,13 @@ def debug_api(endpoint: str = "eol") -> dict:
|
|
|
816
820
|
result = {'endpoint': endpoint, 'gateway_url': GATEWAY_URL, 'base_url': BASE_URL}
|
|
817
821
|
|
|
818
822
|
if endpoint == 'auth':
|
|
823
|
+
result['username_set'] = bool(USERNAME)
|
|
824
|
+
result['password_set'] = bool(PASSWORD)
|
|
825
|
+
result['auth_url'] = f"{GATEWAY_URL}/auth"
|
|
819
826
|
token = get_bearer_token()
|
|
820
827
|
result['token_obtained'] = bool(token)
|
|
821
828
|
result['token_preview'] = token[:20] + '...' if token else None
|
|
829
|
+
result['auth_error'] = AUTH_ERROR
|
|
822
830
|
return result
|
|
823
831
|
|
|
824
832
|
if endpoint == 'assets':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|