@rishibhushan/jenkins-mcp-server 1.1.5 → 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.5",
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(