Skip to content

/mcp-health activeConnections always reports 0 regardless of connected clients #192

Description

@OleksiiKuzmin

Jenkins and plugins versions report

Environment
Plugin version: 0.172.v9db_cb_43cdb_cc
Jenkins: 2.555.2-lts 
Client: Kiro IDE using Streamable HTTP (/mcp-server/mcp)
Also tested with SSE endpoint (/mcp-server/sse) — same result

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins master running as ECS task in AWS from the official Jenkins Docker image:
jenkins/jenkins:2.555.2-lts-jdk21

Reproduction steps

Install mcp-server plugin 0.172.v9db_cb_43cdb_cc on Jenkins

Configure an MCP client (Kiro IDE in this case) with ~/.kiro/settings/mcp.json:

{
  "mcpServers": {
    "jenkins-native": {
      "url": "https://your-jenkins-host/mcp-server/sse",
      "headers": {
        "Authorization": "Basic <base64-encoded-user:token>"
      }
    }
  }
}

Verify the connection works — execute any MCP tool call (e.g. whoAmI or getJobs). Confirm a successful response.

While the client is connected, curl the health endpoint:

curl https://your-jenkins-host/mcp-health
Observe "activeConnections": 0 despite the active session.

Repeat with Streamable HTTP transport:


{
  "mcpServers": {
    "jenkins-native": {
      "url": "https://your-jenkins-host/mcp-server/mcp",
      "headers": {
        "Authorization": "Basic <base64-encoded-user:token>"
      }
    }
  }
}

Same result — activeConnections remains 0.

Expected Results

activeConnections should reflect clients currently connected via any transport (SSE or Streamable HTTP).

Actual Results

The /mcp-health endpoint always returns "activeConnections": 0 even when clients are actively connected and making successful MCP tool calls.

{"mcpServerStatus":"ok","activeConnections":0,"shuttingDown":false,"timestamp":"2026-06-04T17:46:55.989448234Z"}

Anything else?

Impact on Monitoring
When using Prometheus with a JSON Exporter to scrape /mcp-health, the activeConnections metric is permanently 0. This makes it impossible to:
Monitor how many MCP clients are connected
Set alerts on connection counts
Track MCP adoption across teams
Detect when clients disconnect unexpectedly
Make correlation between MCP Server API cals and System Load.

Are you interested in contributing a fix?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions