@rishibhushan/jenkins-mcp-server 1.0.1 → 1.0.2
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.
package/package.json
CHANGED
|
@@ -67,25 +67,27 @@ class JenkinsClient:
|
|
|
67
67
|
self._test_connection()
|
|
68
68
|
|
|
69
69
|
def _test_connection(self) -> None:
|
|
70
|
-
"""Test connection to Jenkins server"""
|
|
70
|
+
"""Test connection to Jenkins server (with quick timeout for MCP)"""
|
|
71
71
|
try:
|
|
72
|
+
# Quick connection test with short timeout for MCP compatibility
|
|
72
73
|
response = requests.get(
|
|
73
74
|
f"{self.base_url}/api/json",
|
|
74
75
|
auth=self.auth,
|
|
75
76
|
verify=False,
|
|
76
|
-
timeout=
|
|
77
|
+
timeout=3 # Short timeout for responsiveness
|
|
77
78
|
)
|
|
78
79
|
response.raise_for_status()
|
|
79
80
|
|
|
80
81
|
data = response.json()
|
|
81
82
|
logger.info(f"Connected to Jenkins: {self.base_url}")
|
|
82
|
-
logger.
|
|
83
|
-
logger.debug(f"Found {len(data.get('jobs', []))} jobs")
|
|
83
|
+
logger.debug(f"Jenkins version: {data.get('_class', 'unknown')}")
|
|
84
84
|
|
|
85
|
+
except requests.Timeout:
|
|
86
|
+
logger.warning(f"Connection to Jenkins timed out (server may be slow)")
|
|
87
|
+
# Don't fail - let actual operations fail if there's a real problem
|
|
85
88
|
except requests.RequestException as e:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
) from e
|
|
89
|
+
logger.warning(f"Could not verify Jenkins connection: {e}")
|
|
90
|
+
# Don't fail - let actual operations fail if there's a real problem
|
|
89
91
|
|
|
90
92
|
@property
|
|
91
93
|
def server(self) -> jenkins.Jenkins:
|