Skip to content

feat: add health-check in documentation and enrich response [MCP-517]#1267

Open
gusanthiago wants to merge 2 commits into
mongodb-js:mainfrom
gusanthiago:MCP-517/mcp-docs-healthcheck
Open

feat: add health-check in documentation and enrich response [MCP-517]#1267
gusanthiago wants to merge 2 commits into
mongodb-js:mainfrom
gusanthiago:MCP-517/mcp-docs-healthcheck

Conversation

@gusanthiago

@gusanthiago gusanthiago commented Jun 21, 2026

Copy link
Copy Markdown

Proposed Changes

Closes #1223.

The README never documented that the health check path is /health, so I added a
"Monitoring Server (Health Check & Metrics)" section covering:

  • The health-check/health and metrics/metrics mappings.
  • A runnable example, plus the comma-separated --monitoringServerFeatures health-check,metrics form.
  • That the server only starts when both monitoringServerHost and monitoringServerPort are set.

I also enriched the /health response. It still returns status: "ok" (nothing breaks),
but now includes version, uptimeSeconds, and timestamp, and sets Cache-Control: no-store:

{ "status": "ok", "version": "1.13.0", "uptimeSeconds": 42, "timestamp": "2026-06-20T12:00:00.000Z" }

I didn't add a DB/readiness check — connections are per-session, so there's no single
"is the DB up" answer without a bigger change. Happy to drop the response changes if you'd
prefer this stay docs-only.

Testing

  • Updated monitoringServer.test.ts for the new fields and header (9/9 passing).
  • Verified against a local build:
    $ curl -D - http://127.0.0.1:8080/health
    HTTP/1.1 200 OK
    Cache-Control: no-store
    {"status":"ok","version":"1.13.0","uptimeSeconds":4,"timestamp":"2026-06-21T02:17:13.884Z"}
    

Checklist

  • I have signed the MongoDB CLA
  • New and existing unit tests pass locally with my changes
  • I have added/updated documentation as needed

@gusanthiago gusanthiago requested a review from a team as a code owner June 21, 2026 02:34
@gusanthiago gusanthiago requested review from fmenezes and removed request for a team June 21, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

health-check documentation is insufficient, lacking the actual path /health

1 participant