Sign inSign up

p0security/mcp-gcp-stdio

By p0security

Updated 16 days ago

stdio-to-HTTP bridge fronting a GCP-hosted MCP server, injecting a bearer token

Image
0

779

p0security/mcp-gcp-stdio repository overview

mcp-gcp-stdio

A stdio↔HTTP bridge that fronts one of Google Cloud's hosted MCP servers (see the supported products list) and injects a bearer token into every request's Authorization header.

Google doesn't publish a container for its hosted MCP servers, only an HTTP endpoint, so this image exists purely to bridge the two: it speaks MCP over stdio on one side, and forwards every request as MCP-over-Streamable-HTTP to the real GCP endpoint on the other. It does not implement any tools itself — whatever tools the configured GCP_MCP_URL exposes are what callers see.

Published on Docker Hub as p0security/mcp-gcp-stdio (linux/amd64 and linux/arm64).

Get the image

Pull the published image:

docker pull p0security/mcp-gcp-stdio:latest

...or build it locally:

yarn install
yarn build
docker build -t p0security/mcp-gcp-stdio .

Configure

The image is configured entirely through environment variables:

VariableDescription
GCP_MCP_URLBase URL of the target GCP MCP server, e.g. https://compute.googleapis.com/mcp (see supported products).
GCP_BEARER_TOKENBearer token injected into the Authorization header of every proxied request.

Run

The container speaks MCP over stdio, not HTTP — there's no port to publish. Run it with -i and drive it by writing newline-delimited JSON-RPC to stdin:

docker run -i --rm \
  -e GCP_MCP_URL=https://compute.googleapis.com/mcp \
  -e GCP_BEARER_TOKEN="$(cat path/to/token)" \
  p0security/mcp-gcp-stdio

Then, in the same session:

{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}
{"jsonrpc": "2.0", "method": "notifications/initialized"}
{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "list_instances", "arguments": {"project": "my-gcp-project", "zone": "us-west1-a"}}}

Each response is written back to stdout as a JSON-RPC message. In practice this container is launched by an MCP client using the MCP SDK's StdioClientTransport (or equivalent), which connects to it exactly this way — driving it by hand is mainly useful for local smoke-testing.

Note that tool names and required arguments vary by GCP product; send tools/list to discover what a given GCP_MCP_URL exposes. Some tools (e.g. Compute Engine's list_instances) require a specific zone rather than supporting an aggregated, all-zones listing.

Tag summary

Content type

Image

Digest

sha256:60a79b49c

Size

63.9 MB

Last updated

16 days ago

docker pull p0security/mcp-gcp-stdio