health
Check server status, verify configuration, and retrieve version information to monitor system health and ensure operational readiness.
Instructions
Health check for the MCP server. Returns server status, configuration validity, and version information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/my_mcp_server/server.py:536-555 (handler)The 'health' MCP tool is registered with @mcp.tool() and implemented as the 'health' function, which returns diagnostic information about the server status and configuration.
@mcp.tool() def health() -> Dict[str, Any]: """ Health check for the MCP server. Returns server status, configuration validity, and version information. """ config = get_config() oauth_ready = _auth_provider is not None account_preconfigured = bool(config.upstream.build_api_base_url()) return { "status": HealthStatus.HEALTHY.value, "server": config.server.server_name, "version": __version__, "timestamp": datetime.now(timezone.utc).isoformat(), "oauth_enabled": oauth_ready, "api_preconfigured": account_preconfigured, "authentication_mode": "oauth" if oauth_ready else ("preconfigured" if account_preconfigured else "not_configured"), "ready_for_use": oauth_ready or account_preconfigured, }