You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fba075a
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Add MCP probe to comprehensive health endpoint (#3685)
## Why make this change?
- Closes#2843
- The comprehensive `/health` report advertised whether MCP was enabled
in its `configuration` block but never actually probed the MCP endpoint,
so MCP outages were invisible to health monitoring.
## What is this change?
- **`HealthCheckHelper`** — New `UpdateMcpHealthCheckResultsAsync`,
wired into `UpdateHealthCheckDetailsAsync` alongside the
data-source/entity/embeddings checks. Runs only when `IsMcpEnabled`;
emits a `HealthCheckResultEntry` named `mcp`, tagged `["mcp"]`,
comparing response time against the default 1000 ms threshold.
- **`HttpUtilities.ExecuteMcpQueryAsync`** — POSTs a JSON-RPC
`initialize` request to `runtimeConfig.McpPath` with `Accept:
application/json, text/event-stream`, reusing the existing
`CheckSanityOfUrl` SSRF guard and role-header propagation. `initialize`
is used because `tools/list` requires an active session under the
Streamable HTTP transport.
- **`Utilities.CreateHttpMcpQuery`** — Builds the minimal initialize
payload.
- **`HealthCheckConstants`** — Adds the `mcp` tag.
Single `mcp` tag (mirroring the data-source check's single `data-source`
tag) rather than reusing `endpoint`, which is reserved for per-entity
REST/GraphQL checks. The check is gated solely on `IsMcpEnabled` with a
default threshold — no new config surface.
## How was this tested?
- [x] Integration Tests — extended
`ComprehensiveHealthEndpoint_ValidateContents` to assert the `mcp` tag
appears iff MCP is enabled.
- [x] Unit Tests — `TestHealthCheckMcpResponseAsync` /
`TestFailureHealthCheckMcpResponseAsync` cover success and non-2xx
responses.
## Sample Request(s)
```http
GET /health
```
Resulting check entry when MCP is enabled:
```json
{
"name": "mcp",
"status": "Healthy",
"tags": ["mcp"],
"data": { "duration-ms": 12, "threshold-ms": 1000 }
}
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Souvik Ghosh <souvikofficial04@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
/// Tests the serialization behavior of <see cref="RuntimeHealthCheckConfig"/> for the <see cref="RuntimeHealthCheckConfig.MaxQueryParallelism"/> property."
0 commit comments