← MCP servers · googleapis

Google Gen AI

BLOCKgrade D · trust 63/100

Google Gen AI Python SDK provides an interface for developers to integrate Google's generative models into their Python applications.

Overview

From the repository's own README, as read at the audited commit.

# Google Gen AI SDK[![PyPI version](https://img.shields.io/pypi/v/google-genai.svg)](https://pypi.org/project/google-genai/)![Python support](https://img.shields.io/pypi/pyversions/google-genai)[![PyPI - Downloads](https://img.shields.io/pypi/dw/google-genai)](https://pypistats.org/packages/google-genai)--------**Documentation:** https://googleapis.github.io/python-genai/-----Google Gen AI Python SDK provides an interface for developers to integrateGoogle's generative models into their Python applications. It supportsthe [Gemini Developer API](https://ai.google.dev/gemini-api/docs) and[Gemini Enterprise Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform)APIs.> [!WARNING]> **Updates to Automatic Function Calling (AFC) in upcoming SDK version:**> We are changing AFC behavior in the next major version.> Specifically, users will not be able to> invoke AFC from direct calls to `Models.generate_content` or its stream and> async variants. Instead, users should invoke AFC from `Chats` modules.>> | Methods/fields to be removed | migration guide |> | --- | --- |> | `Live.send` | Use `send_client_content`, `send_realtime_input`, or `send_tool_response` instead |> | `Live.start_stream` | Use `receive` and `send_realtime_input` instead |> | `LiveConnectConfig.generation_config` | Set fields on `LiveConnectConfig` directly |> | `prompt`/`text`/`image` arguments in `Models.generate_videos` (and async variants) | Use `source` argument instead |> | `GenerationConfigThinkingConfig` | Use `ThinkingConfig` instead |>> To avoid unexpected updates, pin the SDK version to `< 3.0.0`.## Agent SkillsLarge Language Models (LLMs) and generative AI coding assistants are often trained on static datasets. As a result, they may be unaware of recent updates and suggest outdated or legacy libraries.To ensure your AI coding helper (such as Antigravity, Claude Code, Cursor, or other IDE extensions) generates up-to-date code using the correct SDK syntax and best practices, w

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add google-genai --env GEMINI_API_KEY=${GEMINI_API_KEY} --env GOOGLE_API_KEY=${GOOGLE_API_KEY} --env GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} --env GOOGLE_GENAI_ACCESS_TOKEN=${GOOGLE_GENAI_ACCESS_TOKEN} -- uvx google-genai
claude-desktop
{
  "mcpServers": {
    "google-genai": {
      "command": "uvx",
      "args": [
        "google-genai"
      ],
      "env": {
        "GEMINI_API_KEY": "${GEMINI_API_KEY}",
        "GOOGLE_API_KEY": "${GOOGLE_API_KEY}",
        "GOOGLE_APPLICATION_CREDENTIALS": "${GOOGLE_APPLICATION_CREDENTIALS}",
        "GOOGLE_GENAI_ACCESS_TOKEN": "${GOOGLE_GENAI_ACCESS_TOKEN}"
      }
    }
  }
}

Exposed tools (9) 6 read · 3 write · 0 destructive

ToolRiskDescription
add_numberswriteAdd two numbers together.
create_endpointwriteCreates an endpoint
get_weatherreadGet the weather in a city.
get_weather_2readDifferent tool to get the weather.
list_endpointsreadLists endpoints
toolreadtool-description
tool1readtool1-description
tool2readtool2-description
update_endpointwriteUpdates a Vertex AI Endpoint resource.

Details

Source
googleapis/python-genai
PyPI
google-genai
Transports
streamable-http
Credentials it reads
GEMINI_API_KEYGOOGLE_API_KEYGOOGLE_APPLICATION_CREDENTIALSGOOGLE_GENAI_ACCESS_TOKENGOOGLE_GENAI_API_KEY
License
Apache-2.0
Stars
3,981 · pushed 0d ago

Trust audit

Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeWARN
L2Instruction surface (what it tells the agent)FAIL
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (1 observation(s))
Network
declared (9 observation(s))
Shell
declared (3 observation(s))
Dependencies
not all pinned
Secrets in source
found

Findings (25)

HIGHPrompt injection · prompt.override · CWE-94, CWE-1427
CHANGELOG.md:1038
* Support jailbreak in HarmCategory and BlockedReason ([011e218](https://github.com/googleapis/python-genai/commit/011e218b8d06444c848fbc8ba11c01608ff2d613))
Why it matters. asks the agent to drop prior instructions or safety
Fix. remove the instruction
MEDIUMCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
google/genai/__init__.py:33
module = importlib.import_module(f'.{name}', __name__)
MEDIUMCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
google/genai/_gaos/sdk.py:165
return importlib.import_module(modname, package=__package__)
MEDIUMCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
google/genai/_gaos/sdk.py:384
return importlib.import_module(modname, package=__package__)
MEDIUMHard-coded secrets · secret.generic · CWE-798, CWE-321
google/genai/tests/gaos/test_credentials_lifecycle.py:175
token="updated-bearer-token",
MEDIUMHard-coded secrets · secret.generic · CWE-798, CWE-321
google/genai/tests/live/test_live.py:2252
api_client_mock.api_key = 'auth_tokens/TEST_AUTH_TOKEN'
LOWInventory / provenance · inv.binary · CWE-1104
docs/objects.inv
objects.inv
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
LOWInventory / provenance · inv.binary · CWE-1104
google/genai/tests/data/pixel.m4a
pixel.m4a
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
LOWInventory / provenance · inv.binary · CWE-1104
google/genai/tests/data/voice_sample.wav
voice_sample.wav
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
LOWInventory / provenance · inv.hidden_file · CWE-1104
docs/.nojekyll
.nojekyll
Why it matters. hidden member outside the usual dotfiles
Fix. review its purpose
LOWCode injection · code.deserialize · CWE-78, CWE-94, CWE-95
google/genai/tests/errors/test_api_error.py:372
pickled_error = pickle.loads(pickle.dumps(errors.APIError(1, {})))
Why it matters. deserialises untrusted bytes into live objects
Fix. use json or yaml.safe_load
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
docs/_static/doctools.js:60
Documentation.PLURAL_EXPR = new Function(
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWInsecure crypto · crypto.weak_hash · CWE-327, CWE-338
google/genai/_local_tokenizer_loader.py:166
filename = hashlib.sha1(file_url.encode()).hexdigest()
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
google/genai/tests/conftest.py:174
'../../../../../google/cloud/aiplatform/sdk/genai/replays',
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
google/genai/tests/models/test_generate_content.py:520
model='gemini-2.5-flash/../../upload/v1beta/files',
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
google/genai/tests/shared/models/test_edit_image.py:27
os.path.join(os.path.dirname(__file__), '../../data/google.png')
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
google/genai/tests/shared/models/test_edit_image.py:31
os.path.join(os.path.dirname(__file__), '../../data/checkerboard.png')
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
google/genai/tests/shared/models/test_segment_image.py:27
os.path.join(os.path.dirname(__file__), '../../data/google.png')
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
google/genai/tests/gaos/test_credentials_lifecycle.py:127
"base_url": f"http://127.0.0.1:{server.server_port}",
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
google/genai/tests/gaos/test_credentials_lifecycle.py:261
"base_url": f"http://127.0.0.1:{server.server_port}",
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
google/genai/tests/gaos/test_credentials_lifecycle.py:315
"base_url": f"http://127.0.0.1:{server.server_port}",
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
google/genai/tests/gaos/test_environments_lifecycle.py:119
"base_url": f"http://127.0.0.1:{server.server_port}",
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
google/genai/tests/gaos/test_environments_lifecycle.py:185
"base_url": f"http://127.0.0.1:{server.server_port}",
LOWObfuscation / stealth · obf.decode_call · CWE-506, CWE-94
google/genai/live.py:822
data=base64.b64decode(blob_input.data),
LOWObfuscation / stealth · obf.decode_call · CWE-506, CWE-94
google/genai/tests/types/test_bytes_internal.py:43
assert base64.b64decode(_BASE64_NOT_URL_SAFE) == _RAW_BYTES

Gates applied: instruction_override, no_behavioural_pass.

Audited 2026-09-18 · audit v0.4.0 · source sha c9d168fc9f45 · full audit: observations/trust-audit/mcp-server/googleapis__google-gen-ai.json · Report an issue or request a re-scan

Audit history

DateSourceVerdictGradeScoreChange
2026-09-18c9d168fc9f45BLOCKD63first audit

Also audited

Servers with a similar trust profile.

More from googleapis

Questions

What is the Google Gen AI MCP server?

Google Gen AI Python SDK provides an interface for developers to integrate Google's generative models into their Python applications.

What tools does Google Gen AI expose?

9 in total: 6 read-only, 3 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is Google Gen AI safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (63/100) and found 1 critical or high issue in the source. Each one is listed on this page with the file and line it is on.

What credentials does Google Gen AI need?

It reads GEMINI_API_KEY, GOOGLE_API_KEY, GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_GENAI_ACCESS_TOKEN and GOOGLE_GENAI_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does Google Gen AI run?

It speaks streamable-http, so it runs as a service you connect to over the network. It is published on PyPI as google-genai.

How current is this page?

The grade is for one exact copy of the source (c9d168fc9f45), read on 2026-09-18. The repository is watched and re-audited when it changes.

Provenance: OBSERVED · read 2026-09-18 · job trust-audit-2026-09-18