Gemini + MCP typescript example

I added support for image response from mcp servers

I also added an example on how to use multiple servers in the same application

Turns out the code I had to handle mcp shouldn’t be that complex (anymore ?)
The official docs shows a simple example Function Calling with the Gemini API  |  Google AI for Developers

I updated the code to use that instead, also I added interactive user approval for tool call

Hello @sigmasd , I was checking your implementation (currently on the lookout of implementing MCP on our stack, including gemini). I do have a question/comment.

Looks like this is not using MCP but you are only wrapping an MCP function into the traditional tool calling, am I right? Gemini is not receiving or calling an MCP server, but a wrapped version of it into the tools.

Hello, as far as I know that’s how you are supposed to interact with mcp servers , they exports tools and you use them

But I might be wrong and it’s been a while since I checked this, if you want to see a robust implementation just checkout zed editor source code they have these parts already figured out

Or you can see gemini-cli since it uses the same Google library for gemini