Skip to content

Add health endpoint #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions blockscout_mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import typer
import uvicorn
from mcp.server.fastmcp import FastMCP
from starlette.requests import Request
from starlette.responses import PlainTextResponse

from blockscout_mcp_server.constants import SERVER_INSTRUCTIONS, SERVER_NAME
from blockscout_mcp_server.tools.address_tools import (
Expand Down Expand Up @@ -52,6 +54,11 @@
cli_app = typer.Typer()


@mcp.custom_route("/health", methods=["GET"], include_in_schema=False)
async def health_check(_: Request) -> PlainTextResponse:
return PlainTextResponse("OK", status_code=200)


@cli_app.command()
def main_command(
http: Annotated[bool, typer.Option("--http", help="Run server in HTTP Streamable mode.")] = False,
Expand Down