@rishibhushan/jenkins-mcp-server 1.1.4 → 1.1.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@rishibhushan/jenkins-mcp-server",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "AI-enabled Jenkins automation via Model Context Protocol (MCP)",
5
5
  "main": "bin/jenkins-mcp.js",
6
6
  "bin": {
@@ -119,47 +119,17 @@ def validate_config_xml(config_xml: any) -> str:
119
119
  async def handle_list_resources() -> list[types.Resource]:
120
120
  """
121
121
  List available Jenkins resources.
122
- Each job is exposed as a resource with jenkins:// URI scheme.
123
122
 
124
- Enhanced with timeout to prevent MCP initialization delays.
123
+ Returns a static resource - use tools for actual job discovery.
125
124
  """
126
- try:
127
- # Wrap in async timeout to prevent blocking MCP initialization
128
- async with asyncio.timeout(3): # 3 second timeout
129
- client = get_jenkins_client(get_settings())
130
- # Run blocking get_jobs() in thread pool
131
- jobs = await asyncio.to_thread(client.get_jobs)
132
-
133
- return [
134
- types.Resource(
135
- uri=AnyUrl(f"jenkins://job/{job['name']}"),
136
- name=f"Job: {job['name']}",
137
- description=f"Jenkins job: {job['name']} (status: {job.get('color', 'unknown')})",
138
- mimeType="application/json",
139
- )
140
- for job in jobs
141
- ]
142
- except asyncio.TimeoutError:
143
- # Jenkins server not reachable (probably not on VPN/corporate network)
144
- logger.warning("Jenkins server not reachable within 3 seconds - likely not on corporate network")
145
- return [
146
- types.Resource(
147
- uri=AnyUrl("jenkins://offline"),
148
- name="Jenkins Server Offline",
149
- description="Jenkins server not reachable. Connect to VPN/corporate network and restart. Tools will still work when connected.",
150
- mimeType="text/plain",
151
- )
152
- ]
153
- except Exception as e:
154
- logger.error(f"Failed to list resources: {e}")
155
- return [
156
- types.Resource(
157
- uri=AnyUrl("jenkins://error"),
158
- name="Error connecting to Jenkins",
159
- description=f"Error: {str(e)}. Check your configuration and network connection.",
160
- mimeType="text/plain",
161
- )
162
- ]
125
+ return [
126
+ types.Resource(
127
+ uri=AnyUrl("jenkins://jobs"),
128
+ name="Jenkins Jobs",
129
+ description="Use 'list-jobs' tool to see available jobs. This server provides 26 Jenkins automation tools.",
130
+ mimeType="text/plain",
131
+ )
132
+ ]
163
133
 
164
134
 
165
135
  @server.read_resource()
@@ -488,6 +458,7 @@ async def _tool_trigger_multiple_builds(client, args):
488
458
  @server.list_tools()
489
459
  async def handle_list_tools() -> list[types.Tool]:
490
460
  """List available tools for interacting with Jenkins"""
461
+ print("=== list_tools CALLED ===", file=sys.stderr, flush=True)
491
462
  tools = [
492
463
  # Build Operations
493
464
  types.Tool(
@@ -1930,17 +1901,28 @@ async def _tool_trigger_multiple_builds_with_progress(client, args):
1930
1901
  async def main():
1931
1902
  """Run the Jenkins MCP server"""
1932
1903
  try:
1904
+ # Add explicit stderr debug
1905
+ print("=== main() entered ===", file=sys.stderr, flush=True)
1906
+
1933
1907
  # Verify settings are configured
1934
1908
  settings = get_settings()
1909
+ print(f"=== Settings verified: {settings.is_configured} ===", file=sys.stderr, flush=True)
1910
+
1935
1911
  if not settings.is_configured:
1936
1912
  logger.error("Jenkins settings not configured!")
1937
1913
  sys.exit(1)
1938
1914
 
1915
+ print(f"=== About to log startup message ===", file=sys.stderr, flush=True)
1939
1916
  logger.info(f"Starting Jenkins MCP Server v1.0.0")
1940
1917
  logger.info(f"Connected to: {settings.url}")
1918
+ print(f"=== Startup messages logged ===", file=sys.stderr, flush=True)
1941
1919
 
1942
1920
  # Run the server using stdin/stdout streams
1921
+ print("=== About to create stdio_server ===", file=sys.stderr, flush=True)
1943
1922
  async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
1923
+ print("=== stdio_server created ===", file=sys.stderr, flush=True)
1924
+ print("=== About to call server.run() ===", file=sys.stderr, flush=True)
1925
+
1944
1926
  await server.run(
1945
1927
  read_stream,
1946
1928
  write_stream,
@@ -1953,6 +1935,7 @@ async def main():
1953
1935
  ),
1954
1936
  ),
1955
1937
  )
1938
+ print("=== server.run() completed ===", file=sys.stderr, flush=True)
1956
1939
  except KeyboardInterrupt:
1957
1940
  logger.info("Server stopped by user")
1958
1941
  except Exception as e: