Skip to content

Commit 4c212e9

Browse files
committed
Fast MCP 3.0 and health endpoint
1 parent 0b63eb4 commit 4c212e9

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
pytest.ini
44
./tests/
55
Dockerfile
6+
debug.Dockerfile
7+
./scripts/
8+
./mcp/
9+
./genius_agent.egg-info/
10+
./build/
11+
./.ruff_cache/
12+
./.git/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
hooks:
2828
- id: black
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.14.13
30+
rev: v0.14.14
3131
hooks:
3232
- id: ruff
3333
types_or: [ python, pyi, jupyter ]

audio_transcriber/audio_transcriber_mcp.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import requests
1212
from pydantic import Field
1313
from eunomia_mcp.middleware import EunomiaMcpMiddleware
14+
from starlette.requests import Request
15+
from starlette.responses import JSONResponse
1416
from fastmcp import FastMCP, Context
1517
from fastmcp.server.auth.oidc_proxy import OIDCProxy
1618
from fastmcp.server.auth import OAuthProxy, RemoteAuthProvider
@@ -56,6 +58,10 @@
5658

5759

5860
def register_tools(mcp: FastMCP):
61+
@mcp.custom_route("/health", methods=["GET"])
62+
async def health_check(request: Request) -> JSONResponse:
63+
return JSONResponse({"status": "OK"})
64+
5965
@mcp.tool(
6066
annotations={
6167
"title": "Transcribe Audio",

compose.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
# build: . # Debug
66
container_name: audio-transcriber-mcp
77
hostname: audio-transcriber-mcp
8-
command: ["audio-transcriber-mcp"]
8+
command: [ "audio-transcriber-mcp" ]
99
extra_hosts:
1010
- "host.docker.internal:host-gateway"
1111
logging:
@@ -21,13 +21,19 @@ services:
2121
- "OPENAI_API_KEY=llama"
2222
ports:
2323
- "8014:8014"
24+
healthcheck:
25+
test: [ "CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8014/health')" ]
26+
interval: 30s
27+
timeout: 10s
28+
retries: 3
29+
start_period: 10s
2430

2531
audio-transcriber-agent:
2632
image: docker.io/knucklessg1/audio-transcriber:latest
2733
# build: . # Debug
2834
container_name: audio-transcriber-agent
2935
hostname: audio-transcriber-agent
30-
command: ["audio-transcriber-agent"]
36+
command: [ "audio-transcriber-agent" ]
3137
extra_hosts:
3238
- "host.docker.internal:host-gateway"
3339
depends_on:
@@ -50,3 +56,9 @@ services:
5056
- "ENABLE_WEB_UI=True"
5157
ports:
5258
- "9014:9014"
59+
healthcheck:
60+
test: [ "CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:9014/health')" ]
61+
interval: 30s
62+
timeout: 10s
63+
retries: 3
64+
start_period: 10s

0 commit comments

Comments
 (0)