A sample project that integrates Google Maps API with Genkit. Access Google Maps features from Gemini AI models through the Model Context Protocol (MCP).


This sample provides access to the following Google Maps features:
- Get coordinates from addresses (
maps_geocode
) - Get addresses from coordinates (
maps_reverse_geocode
) - Search for nearby places (
maps_search_places
) - Get detailed place information (
maps_place_details
) - Calculate distance and travel time between two points (
maps_distance_matrix
) - Retrieve elevation data (
maps_elevation
) - Get directions (
maps_directions
)
- Node.js 20 or higher
- Firebase CLI
- Genkit CLI
- Access to a Google Cloud (Firebase) Project
- Google Maps Platform API key
- Google AI API key
# Clone the project
git clone https://github.com/nozomi-koborinai/genkit-mcp-google-maps-sample
cd genkit-mcp-google-maps-sample
# Install dependencies
npm install
# Install development tools
npm install --save-dev genkit-cli@latest
Set the following secrets in Firebase Secret Manager:
GOOGLE_GENAI_API_KEY
: Google AI API keyGOOGLE_MAPS_API_KEY
: Google Maps API key
export GOOGLE_GENAI_API_KEY=your_genai_api_key
export GOOGLE_MAPS_API_KEY=your_maps_api_key
Open Genkit Develoer UI.
npx genkit start -o -- tsx --watch src/index.ts
firebase deploy --only functions