Skip to content

fix(run/mcp-server): pin uv image, update to Python 3.14 & fastmcp 4.2.6, cast PORT to int - #15000

Open
wietsevenema wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
wietsevenema:fix/run-mcp-server-deps
Open

wietsevenema wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
wietsevenema:fix/run-mcp-server-deps

Conversation

@wietsevenema

Copy link
Copy Markdown

Description

Updates the Cloud Run remote MCP server sample (run/mcp-server/) to keep its dependencies current, pinned, and aligned with the Dockerfile and tutorial:

  • Pin uv in Dockerfile: Replace ghcr.io/astral-sh/uv:latest with ghcr.io/astral-sh/uv:0.13.10.
  • Update Python requirement to >=3.14: Align pyproject.toml and README.md with FROM python:3.14-slim (moving off EOL Python 3.10).
  • Bump fastmcp to 4.2.6: Update fastmcp (and its required opentelemetry-*==1.45.2 dependency) in pyproject.toml and regenerate uv.lock.
  • Cast PORT to int in server.py: Pass port=int(os.getenv("PORT", 8080)) so uvicorn logs cleanly on startup without a %d format TypeError.

Testing

  • Deployed run/mcp-server/ from source to Cloud Run (--no-allow-unauthenticated).
  • Verified clean container build (python:3.14-slim, uv:0.13.10, fastmcp==4.2.6) and startup logs (Uvicorn running on http://0.0.0.0:8080, no logging errors).
  • Verified live add and subtract tool calls via gcloud run services proxy and uv run test_server.py.

@wietsevenema
wietsevenema requested review from a team as code owners November 27, 2026 12:39
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@product-auto-label product-auto-label Bot added api: run Issues related to the Cloud Run API. samples Issues that are directly related to samples. labels Nov 27, 2026
…2.6, cast PORT to int

- Pin uv in Dockerfile to ghcr.io/astral-sh/uv:0.13.10 instead of :latest.
- Update pyproject.toml and README.md from EOL Python 3.10 to >=3.14 (matching FROM python:3.14-slim).
- Bump fastmcp to 4.2.6 (and required opentelemetry-* to 1.45.2) and regenerate uv.lock.
- Cast PORT to int in server.py (int(os.getenv('PORT', 8080))) to fix uvicorn's %d startup logging TypeError.
@wietsevenema

Copy link
Copy Markdown
Author

Hi @iennae, could you please take a look at this PR when you have a moment? It pins the uv image, updates the sample to Python 3.14 and fastmcp==4.2.6 to match the tutorial, and casts PORT to int to fix uvicorn's startup logging error. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: run Issues related to the Cloud Run API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants