Skip to content

feat: add /health and / endpoints for server discoverability#52

Open
jon-emerson wants to merge 1 commit intoSigNoz:mainfrom
jon-emerson:feat/add-health-endpoints
Open

feat: add /health and / endpoints for server discoverability#52
jon-emerson wants to merge 1 commit intoSigNoz:mainfrom
jon-emerson:feat/add-health-endpoints

Conversation

@jon-emerson
Copy link
Copy Markdown

@jon-emerson jon-emerson commented Jan 8, 2026

Summary

  • Add /health endpoint returning server status, name, version, and MCP endpoint path
  • Add / root endpoint for server discoverability
  • Extract serverName and serverVersion as package-level constants for consistency

Problem

MCP clients probing the server with GET requests to / or /health receive 404 errors, making it difficult to determine if the server is running. This causes confusion when debugging connectivity issues.

Solution

Add two lightweight endpoints:

  • GET /health{"status":"ok","server":"SigNozMCP","version":"0.0.1","mcp_endpoint":"/mcp"}
  • GET /{"name":"SigNozMCP","version":"0.0.1","mcp_endpoint":"/mcp","health":"/health"}

Test plan

  • Verified /health returns 200 with correct JSON
  • Verified / returns 200 with correct JSON
  • Verified POST /mcp still works for MCP requests
  • Verified debug logging appears for endpoint requests

Add health check and root endpoints to help MCP clients verify server
connectivity. Previously, clients would get 404 errors when probing
the server, making it difficult to determine if the server was running.

New endpoints:
- GET /health - Returns server status, name, version, and MCP endpoint
- GET / - Returns server info for discoverability

Changes:
- Extract serverName and serverVersion as package-level constants
- Add JSON-encoded responses with proper error handling
- Add debug logging for endpoint requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jon-emerson
Copy link
Copy Markdown
Author

This fixes a very painful issue I've had since starting to use the Signoz MCP server, where Claude Code thinks the MCP is broken especially if I try to use Claude Code outside of the Signoz MCP server repo clone. I could never get the MCP to work in my actual web application repo until I made this change.

@pradeepitm12 pradeepitm12 added the safe-to-test Add this label to run CI. label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Add this label to run CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants