mcp-cloudrun-proxy
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-cloudrun-proxy
Transparent proxy for using an MCP server deployed on Cloud Run (Streamable HTTP) as a local stdio MCP server.
Access to Cloud Run uses IAM Invoker + ID Token (Bearer), and the proxy automatically refreshes expired tokens.
What It Does
Local side: acts as a stdio MCP server
Remote side: connects to a Streamable HTTP MCP server
Transparently relays JSON-RPC messages bidirectionally
Adds
Authorization: Bearer <ID Token>to all requestsRefreshes tokens and retries/reconnects on
401/403
Related MCP server: FastMCP Remote Proxy
Prerequisites
Python 3.10+
A Cloud Run MCP endpoint (for example:
https://xxxx.run.app/mcp)Valid ADC (Application Default Credentials) in the runtime environment
Cloud Run Invoker role granted to the calling principal
ADC Setup (Local Development)
If you use user credentials locally, you usually need to set up ADC first:
gcloud auth application-default loginNotes:
gcloud auth loginalone may not configure ADC (this tool uses ADC).If you use a service account,
GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.jsonalso works.
Usage
uvx mcp-cloudrun-proxy run \
--url https://xxxx.run.app/mcp \
--audience https://xxxx.run.app \
--token-source google-auth \
--log-level info \
--refresh-margin 60If you installed the command locally (for example with pipx, uv tool, or Nix),
replace uvx mcp-cloudrun-proxy run with mcp-cloudrun-proxy run.
Options:
--url(required): Cloud Run MCP endpoint URL--audience(optional): ID token audience (inferred from--urlif omitted)--log-level:info/debug/warn--refresh-margin: Seconds before expiry to refresh proactively (default:60)--token-source(required):google-auth/gcloud
Notes:
If
--audienceis omitted, the proxy extractsscheme://host[:port]from--url.In many cases, the audience should be the Cloud Run service URL (without
/mcp), but it must match your server-side expectations.In
--token-source gcloudmode, theaudiencevalue is ignored because the gcloud user-credential path does not support audience-scoped ID tokens.Use
--token-source google-authfor service account / metadata-based credentials.Use
--token-source gcloudfor local user ADC when you want token issuance via thegcloudCLI.
Debug Command
Use the debug subcommand to test token issuance and Cloud Run access step by step.
uvx mcp-cloudrun-proxy debug \
--url https://xxxx.run.app/mcp \
--token-source gcloudWhat it checks:
ID token issuance (and prints which token source was used)
Authenticated HTTP reachability to the Cloud Run endpoint
Tip:
If local development changes are not reflected with
uvx, tryuvx --refresh ...oruv cache clean.
Claude Desktop / Claude Code Configuration
Register this proxy as a stdio MCP server. Client config schemas vary, so the examples below are generic patterns.
Recommended example using uvx (no local install):
{
"mcpServers": {
"cloudrun-proxy": {
"command": "uvx",
"args": [
"mcp-cloudrun-proxy",
"run",
"--url",
"https://xxxx.run.app/mcp",
"--audience",
"https://xxxx.run.app",
"--token-source",
"gcloud"
]
}
}
}Nix
You can use this project via Nix without cloning the repository.
Run directly (no install):
nix run github:logicoffee/mcp-cloudrun-proxy -- \
run \
--url https://xxxx.run.app/mcp \
--audience https://xxxx.run.app \
--token-source google-authInstall via Nix:
nix profile install github:logicoffee/mcp-cloudrun-proxyAfter installation:
mcp-cloudrun-proxy run --url https://xxxx.run.app/mcp --audience https://xxxx.run.app --token-source google-authTroubleshooting
401/403keeps happening:Check the
--audiencevalue firstIf you are using user ADC, try
--token-source gcloudand note thataudienceis ignored in gcloud modeIf Cloud Run requires an audience-scoped ID token, use a service account (
--token-source google-auth)Confirm the Cloud Run Invoker role is granted
Confirm ADC points to the expected account
Connection closes immediately:
Confirm
--urlpoints to the MCP endpoint (/mcp)Confirm Streamable HTTP transport is enabled on the Cloud Run side
Logs are not visible:
Logs are written to stderr (stdout is reserved for the MCP protocol)
Security Notes
ID token contents are not logged
Raw Authorization values are not logged or included in exception messages
This proxy is intended as a secure relay that relies on Cloud Run IAM
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Streamable HTTP MCP gateway for NV oOS fleets — one API key, namespaced tools, quotas and policy.
Stateless MCP gateway and OTel span-streaming bridge for hosted MCP servers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables stdio-only MCP clients to connect to IFTTT's remote MCP server by handling OAuth authentication, SSE streaming, and response transformation.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables local MCP clients to access tools from a remote FastMCP server over stdio, handling OAuth authentication and Streamable HTTP communication.-
- AlicenseNot gradedqualityBmaintenanceEnables connecting multiple remote HTTP MCP servers through a single local stdio endpoint, handling OAuth authentication, token refresh, and namespace-scoped tools.MIT
- AlicenseNot gradedqualityBmaintenanceLets stdio-only MCP clients such as Claude Desktop, Cursor, and local agents reach a streamable-http MCP endpoint by transparently relaying line-delimited JSON-RPC over stdin/stdout, passing upstream HTTP errors through unchanged and supporting token-based authentication.86 npmMIT