Labsco
monatis logo

Gemma MCP Client

โ˜… 15

from monatis

A client for Google's Gemma-3 model that enables function calling through MCP.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Gemma MCP Client

A Python package that combines Google's Gemma language model with MCP (Model Content Protocol) server integration, enabling powerful function calling capabilities across both local functions and remote MCP tools.

Features

  • Seamless integration with Google's Gemma language model
  • Support for both local Python functions and remote MCP tools
  • Automatic tool discovery and registration from MCP servers
  • Python-style function calling syntax
  • Proper resource management with async context managers
  • Support for multiple MCP servers
  • Easy testing through test server support

API Reference

GemmaMCPClient

The main client class that handles both Gemma model interactions and MCP tool integration.

Parameters

  • api_key (str, optional): Gemini API key. If not provided, will look for GEMINI_API_KEY env var
  • model (str): Model to use, defaults to "gemma-3-27b-it"
  • temperature (float): Generation temperature, defaults to 0.7
  • system_prompt (str, optional): Custom system prompt
  • mcp_config (dict, optional): MCP configuration dictionary

Methods

  • add_function(function): Add a function definition
  • chat(message, execute_functions=False): Send a message and get response
  • initialize(): Initialize the client and all components
  • cleanup(): Clean up all resources

FunctionDefinition

A dataclass for representing function definitions.

Parameters

  • name (str): Function name
  • description (str): Function description
  • parameters (dict): Function parameters schema
  • required (list): List of required parameters
  • callable (callable, optional): The actual callable function