You are a developer working on a multi-language MCP server project. This workspace encompasses both Rust (Edition 2024) and Python (3.11+) implementations.
iap-https-rust (and its Python counterparts) is a suite of Model Context Protocol (MCP) servers providing system utility tools. It supports multiple transports (Streaming HTTP/SSE and Stdio) and various security models (IAP, API Key).
This repository is divided into several specialized variants:
iap/: Cloud Run + IAP. HTTP transport.manual/: Cloud Run + IAP + API Key (ADC). HTTP transport.local/: Local dev + API Key (gcloud). HTTP transport.stdio/: Basic Stdio transport. No security.stdiokey/: Stdio transport + API Key (gcloud/ADC).
local-python/: Local/Cloud SSE + API Key (gcloud/ADC).manual-python/: Cloud-ready SSE + API Key (gcloud/ADC).stdiokey-python/: Stdio transport + API Key (gcloud/ADC).
- Rust Stack:
rmcp,tokio,axum,sysinfo,serde,tracing. - Python Stack:
mcp,starlette(SSE),uvicorn,psutil,pydantic. - Security: Google Cloud IAP (JWT), Google Cloud API Keys (ADC or
gcloudCLI).
- IAP Middleware: (Rust variants) Extracts identity from
x-goog-iap-jwt-assertion. - API Key Validation:
- Manual/Cloud: Uses
google-apikeys2(Rust) orgoogle-api-python-clientto fetch the expected "MCP API Key" from project1056842563084via ADC. - Local: Uses
gcloud services api-keysCLI to fetch the key for developer convenience.
- Manual/Cloud: Uses
- Task-Local Context: Rust variants use
tokio::task_localto store request context and headers.
- Streaming HTTP: Rust uses
transport-streamable-http-server. - SSE: Python uses
mcp.run(transport="sse"). - Stdio: Standard MCP JSON-RPC over stdin/stdout.
Each subdirectory has a Makefile with standard targets:
- Rust:
make fmt,make clippy,make test,make build. - Python:
make fmt(ruff),make lint(ruff),make test(unittest).
PORT: Port for HTTP/SSE servers (default: 8080).MCP_API_KEY: Manual override for API key validation.GOOGLE_CLOUD_PROJECT: Project ID for API key fetching.
- "Add a disk usage tool to the Stdio Rust variant in
stdiokey/src/main.rs." - "Refactor the Python middleware in
local-python/main.pyto support custom error messages." - "Explain the API key fetching logic in the
manualvariant vs thelocalvariant." - "How do I deploy the Python manual variant to Cloud Run?"