Skip to content

feat: add health check endpoint - #16

Merged
davmacario merged 1 commit into
davmacario:mainfrom
LucasLeao18:fix/health-endpoint
Sep 20, 2026
Merged

davmacario merged 1 commit into
davmacario:mainfrom
LucasLeao18:fix/health-endpoint

Conversation

@LucasLeao18

Copy link
Copy Markdown
Contributor

Problem

Deployments currently have no lightweight HTTP endpoint that an orchestrator can use to check whether the MCP server is reachable.

Solution

Register a public GET /health route through FastMCP's custom route support. It returns {"status":"ok"} and does not query storage, so the check stays cheap and does not depend on index contents.

A focused test exercises the route through the actual Starlette app and verifies that storage is untouched.

Validation

  • python -m uv run pytest tests/test_mcp_server.py
  • python -m uv run ruff check src/notes_rag/mcp_server.py tests/test_mcp_server.py
  • python -m uv run pyright src/notes_rag/mcp_server.py tests/test_mcp_server.py

The full suite reports two existing Windows-specific failures in test_storage_utils.py: SQLite keeps chroma.sqlite3 open during unlink, and caplog.text escapes backslashes. All other tests pass (37 passed, including the new test).

Closes #6

@davmacario davmacario left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @LucasLeao18 thanks for your contribution!

This is exactly what I had in mind :) good job.
Will merge skipping workflows as there is currently a bug causing them to fail on PRs from forks.

@davmacario
davmacario merged commit 8bbccc6 into davmacario:main Sep 20, 2026
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

[enhancement] Add healthcheck/ping endpoint

2 participants