js-genai: This package should not require MCP

This package recently added a dependency on @modelcontextprotocol/sdk.

The difference between @google/genai 0.14.1 and 1.3.0 is 59 new packages, including:

  1. A server (Express)
  2. A transitive dependency (@modelcontextprotocol/sdk > ajv > uri-js) on a package that has not been maintained for 4 years and has 4 CVEs in its dependencies
  3. MCP’s already-notorious security posture.

I have no desire to ship all this. Those of us who just want to use Gemini / Vertex should not be burdened with the MCP SDK and all that comes with it.

Please make MCP optional, or move those features to a separate module, so that we can use Gemini without shipping a bunch of security holes.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 17

Commits related to this issue

Most upvoted comments

Yeah, same issue here. When removing the MCP package, typescript fails to compile:

node_modules/@google/genai/dist/genai.d.ts:1:29 - error TS2307: Cannot find module '@modelcontextprotocol/sdk/client/index.js' or its corresponding type declarations.

1 import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@sagarnanera use 1.5.1. its fixed.