feat: add /health and / endpoints for server discoverability#52
Open
jon-emerson wants to merge 1 commit intoSigNoz:mainfrom
Open
feat: add /health and / endpoints for server discoverability#52jon-emerson wants to merge 1 commit intoSigNoz:mainfrom
jon-emerson wants to merge 1 commit intoSigNoz:mainfrom
Conversation
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>
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/healthendpoint returning server status, name, version, and MCP endpoint path/root endpoint for server discoverabilityserverNameandserverVersionas package-level constants for consistencyProblem
MCP clients probing the server with GET requests to
/or/healthreceive 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
/healthreturns 200 with correct JSON/returns 200 with correct JSONPOST /mcpstill works for MCP requests