@rishibhushan/jenkins-mcp-server 1.1.17 → 1.1.18

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rishibhushan/jenkins-mcp-server",
3
3
  "type": "module",
4
- "version": "1.1.17",
4
+ "version": "1.1.18",
5
5
  "description": "AI-enabled Jenkins automation via Model Context Protocol (MCP)",
6
6
  "main": "bin/jenkins-mcp.js",
7
7
  "bin": {
@@ -11,6 +11,7 @@ import sys
11
11
 
12
12
  from .config import get_settings, get_default_settings
13
13
  from .verbose import set_verbose, vprint
14
+ from .version import __version__
14
15
  from . import server
15
16
 
16
17
 
@@ -83,7 +84,7 @@ Configuration Priority:
83
84
  parser.add_argument(
84
85
  '--version',
85
86
  action='version',
86
- version='jenkins-mcp-server 1.1.16'
87
+ version=f'jenkins-mcp-server {__version__}'
87
88
  )
88
89
 
89
90
  parser.add_argument(
@@ -154,5 +155,4 @@ Configuration Priority:
154
155
 
155
156
 
156
157
  # Package metadata
157
- __version__ = "1.1.16"
158
- __all__ = ['main', 'server']
158
+ __all__ = ['main', 'server', '__version__']
@@ -27,6 +27,7 @@ from .config import JenkinsSettings, get_default_settings
27
27
  from .jenkins_client import get_jenkins_client
28
28
  from .metrics import get_metrics_collector, record_tool_execution
29
29
  from .verbose import vprint, _VERBOSE
30
+ from .version import __version__
30
31
 
31
32
  # Configure logging
32
33
  logger = logging.getLogger(__name__)
@@ -1916,7 +1917,7 @@ async def main():
1916
1917
  sys.exit(1)
1917
1918
 
1918
1919
  vprint(f"=== About to log startup message ===")
1919
- logger.info(f"Starting Jenkins MCP Server v1.1.16")
1920
+ logger.info(f"Starting Jenkins MCP Server v{__version__}")
1920
1921
  logger.info(f"Connected to: {settings.url}")
1921
1922
  vprint(f"=== Startup messages logged ===")
1922
1923
 
@@ -1934,7 +1935,7 @@ async def main():
1934
1935
  print(f"Press Ctrl+C to stop the server")
1935
1936
  print(f"----------------------------------------")
1936
1937
  if _VERBOSE:
1937
- vprint(f"Jenkins MCP Server v1.1.16")
1938
+ vprint(f"Jenkins MCP Server v{__version__}")
1938
1939
  vprint(f"Connected to: {settings.url}")
1939
1940
 
1940
1941
  await server.run(
@@ -1942,7 +1943,7 @@ async def main():
1942
1943
  write_stream,
1943
1944
  InitializationOptions(
1944
1945
  server_name="jenkins-mcp-server",
1945
- server_version="1.1.16",
1946
+ server_version=__version__,
1946
1947
  capabilities=server.get_capabilities(
1947
1948
  notification_options=NotificationOptions(),
1948
1949
  experimental_capabilities={},
@@ -0,0 +1,33 @@
1
+ """Version management - reads from package.json"""
2
+ import json
3
+ import os
4
+ from pathlib import Path
5
+
6
+
7
+ def get_version() -> str:
8
+ """
9
+ Read version from package.json.
10
+ Falls back to a default if package.json is not found.
11
+ """
12
+ try:
13
+ # Get the project root (3 levels up from this file)
14
+ # src/jenkins_mcp_server/version.py -> project root
15
+ current_file = Path(__file__)
16
+ project_root = current_file.parent.parent.parent
17
+ package_json_path = project_root / "package.json"
18
+
19
+ if package_json_path.exists():
20
+ with open(package_json_path, 'r') as f:
21
+ package_data = json.load(f)
22
+ return package_data.get('version', '0.0.0')
23
+ else:
24
+ # Fallback if package.json not found
25
+ return '0.0.0'
26
+
27
+ except Exception:
28
+ # If anything goes wrong, return a safe default
29
+ return '0.0.0'
30
+
31
+
32
+ # Module-level constant
33
+ __version__ = get_version()