49b9bb6724
Deploy Docs / deploy-docs (push) Failing after 1s
Conformance Tests / client-conformance (push) Failing after 3s
Conformance Tests / server-conformance (push) Failing after 1s
GitHub Actions Security Analysis / zizmor (push) Failing after 1s
CI / checks (push) Failing after 59m20s
CI / all-green (push) Waiting to run
21 lines
423 B
Python
21 lines
423 B
Python
from starlette.requests import Request
|
|
from starlette.responses import JSONResponse, Response
|
|
|
|
from mcp.server import MCPServer
|
|
|
|
mcp = MCPServer("Notes")
|
|
|
|
|
|
@mcp.tool()
|
|
def add_note(text: str) -> str:
|
|
"""Save a note."""
|
|
return f"Saved: {text}"
|
|
|
|
|
|
@mcp.custom_route("/health", methods=["GET"])
|
|
async def health(request: Request) -> Response:
|
|
return JSONResponse({"status": "ok"})
|
|
|
|
|
|
app = mcp.streamable_http_app()
|