Logo di Google Photos MCP Server

Google Photos MCP Server

Community
savethepolarbears

A Model Context Protocol repository for Google Photos API

Autoresavethepolarbears
Repositorygoogle-photos-mcp
LinguaTypeScript
Fork
15
Stelle
44
Strumenti disponibili
0
Tipo di trasportostdio, streamable-http
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Google Photos MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    44 stelle e 15 fork nel repository collegato.

Google Photos MCP Server

A Model Context Protocol (MCP) server for Google Photos integration, enabling Claude, Gemini, and other AI assistants to read, write, and pick photos from your Google Photos library.

✅ Picker API Support (March 2025+)

This server implements the Google Photos Picker API, providing full library access even after the March 31, 2025 deprecation of certain Library API scopes.

CapabilityStatusAPI
Browse full photo library✅Picker API
Search photos by text/date/category✅Library API
Create albums & upload photos✅Library API
Access app-created content✅Library API

How the Picker API works

  1. Call create_picker_session — returns a URL the user opens in their browser
  2. User selects photos from their full library
  3. Call poll_picker_session — when mediaItemsSet is true, selected photos are returned

🛡️ Security Notice: CORS Removed

CORS middleware has been removed for security (prevents drive-by attacks on localhost).

  • ✅ STDIO mode (Claude Desktop): Works normally
  • ✅ Streamable HTTP (Cursor, server-to-server): Works normally
  • ❌ Browser AJAX: Not supported (by design)

Features

Read operations

  • Search photos by text, date, location, category, favorites
  • Filter by media type (photo/video), date ranges, archived status
  • Get photo details including base64-encoded images
  • List albums and their contents
  • Describe available filter capabilities

Write operations

  • Create albums and upload photos
  • Batch upload with create_album_with_media (up to 50 files)
  • Add text and location enrichments to albums
  • Set album cover photos

Picker operations

  • Create picker sessions for full library access
  • Poll sessions and retrieve selected media items

Infrastructure

  • ⚡ Streamable HTTP transport (MCP 2025-06-18 spec)
  • 🔗 HTTPS Keep-Alive with connection pooling
  • 🔒 OS keychain token storage
  • 📊 Quota management with automatic tracking
  • 🔄 Automatic token refresh

Prerequisites

  • Node.js 22.22+
  • Google Cloud project with Photos Library API enabled
  • OAuth 2.0 credentials (Web application type)

Setup

1. Google Cloud setup

  1. Go to Google Cloud Console
  2. Create a new project (or select existing)
  3. Enable Photos Library API
  4. Create OAuth 2.0 credentials (Web application)
  5. Add http://localhost:3000/auth/callback as an authorized redirect URI
  6. Note your Client ID and Client Secret

2. Installation

bash
git clone https://github.com/savethepolarbears/google-photos-mcp.git
cd google-photos-mcp
npm install

3. Configuration

bash
cp .env.example .env

Edit .env:

env
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3000/auth/callback
PORT=3000
NODE_ENV=development

4. Build & run

bash
npm run build    # Compile TypeScript
npm start        # HTTP mode (for auth & Cursor)
npm run stdio    # STDIO mode (for Claude Desktop)
npm run dev      # Dev mode with live reload

5. Authenticate

  1. Start in HTTP mode: npm start
  2. Visit http://localhost:3000/auth in your browser
  3. Complete the Google OAuth flow
  4. Tokens are saved automatically to the OS keychain

Note: Authentication must be completed in HTTP mode first. After that, switch to STDIO mode for Claude Desktop.

Dynamic port

bash
PORT=3001 npm start
# Also update GOOGLE_REDIRECT_URI in .env to match

Client configuration

Claude Desktop (STDIO)

json
{
  "mcpServers": {
    "google-photos": {
      "command": "node",
      "args": ["/path/to/google-photos-mcp/dist/index.js", "--stdio"],
      "env": {
        "GOOGLE_CLIENT_ID": "your_client_id",
        "GOOGLE_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_REDIRECT_URI": "http://localhost:3000/auth/callback"
      }
    }
  }
}

Cursor IDE

STDIO (recommended):

  • Type: Command
  • Command: node /path/to/google-photos-mcp/dist/index.js --stdio

HTTP:

  • Type: URL
  • URL: http://localhost:3000/mcp

Smithery

bash
# Claude Desktop
npx -y @smithery/cli install google-photos-mcp --client claude

# Cursor IDE
npx -y @smithery/cli install google-photos-mcp --client cursor

MCP Inspector

bash
npx @modelcontextprotocol/inspector node dist/index.js        # HTTP
npx @modelcontextprotocol/inspector node dist/index.js --stdio # STDIO

Available tools (19)

Search & browse

ToolDescription
search_photosText-based photo search
search_photos_by_locationSearch by location name
search_media_by_filterFilter by dates, categories, media type, favorites, archived
get_photoGet photo details (optional base64)
list_albumsList all albums
get_albumGet album details
list_album_photosList photos in an album
list_media_itemsList all media items
describe_filter_capabilitiesJSON reference of all filter options

Write & manage

ToolDescription
create_albumCreate a new album
upload_mediaUpload a local file
add_media_to_albumAdd existing items to an album (max 50)
create_album_with_mediaCreate album + upload files in one call (max 50)
add_album_enrichmentAdd text or location enrichment
set_album_coverSet album cover photo

Picker API

ToolDescription
create_picker_sessionStart a Picker session for full library access
poll_picker_sessionCheck session status and retrieve selected photos

Auth

ToolDescription
auth_statusCheck authentication status
start_authStart OAuth flow via temporary local server

Example queries

text
"Show me photos from my trip to Paris"
"Find photos of my dog from 2024"
"List my photo albums"
"Upload these vacation photos to a new album called 'Summer 2025'"
"Search for landscape photos from last year, ordered newest first"
"Let me pick some photos from my library" (triggers Picker API)

Location data

Location data is approximate, extracted from photo descriptions using OpenStreetMap/Nominatim geocoding. When available, includes latitude/longitude, city, region, country.

Deployment / release

This project is a Model Context Protocol (MCP) server intended to be run locally alongside AI clients like Claude Desktop or Cursor. There is no remote deployment or release process required beyond keeping your local checkout or NPM installation up to date.

Troubleshooting

  • Node Version: Ensure you are using Node.js 22.22+ as older versions are not supported.
  • Authentication: If you encounter GOOGLE_CLIENT_ID is not set errors or authentication fails, verify your .env file is present in the root directory and contains your correct Google Cloud credentials. Remember to run npm start (HTTP mode) to authenticate before switching to STDIO mode.
  • Quota Issues: Google Photos API limits apply. Ensure you aren't hitting the 10,000 requests/day quota limit. The server tracks this via quotaManager.
  • CORS Errors: The server intentionally disables CORS to prevent drive-by attacks. Do not attempt to call the server directly from browser AJAX requests.

Development

Project structure

text
src/
├── index.ts              # HTTP entry point
├── dxt-server.ts         # STDIO/DXT entry point
├── mcp/core.ts           # All tool handlers (19 tools)
├── api/
│   ├── client.ts         # REST client (Library + Picker)
│   ├── photos.ts         # Facade module (re-exports)
│   ├── types.ts          # TypeScript interfaces
│   └── repositories/     # Low-level API calls
├── auth/                 # OAuth, tokens, keychain
├── schemas/              # Zod validation schemas
├── utils/                # Config, logging, quota, retry
└── views/                # HTML templates

Testing

bash
npm test              # All tests (Vitest)
npm run test:watch    # Interactive TDD
npm run test:coverage # Coverage report
npm run test:security # Security suite only

Quality checks

All three must pass before merge:

bash
npx tsc --noEmit   # Type check
npm run lint        # ESLint
npm test            # Tests

License

MIT

Installazione

TypingMind
{
  "mcpServers": {
    "google-photos-mcp": {
      "command": "node",
      "args": [
        "dist/index.js",
        "--stdio"
      ],
      "env": {
        "GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
        "GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>",
        "GOOGLE_REDIRECT_URI": "<GOOGLE_REDIRECT_URI>"
      }
    }
  }
}

Usa MCP Google Photos MCP Server con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Google Photos MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Puoi eseguire MCP localmente sul tuo dispositivo o connetterti all'URL di un server MCP remoto.

Opzione 1: usa il connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Google Photos MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Google Photos MCP Server.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "google-photos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "google-photos-mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Google Photos MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Google Photos MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Google Photos MCP Server per aiutarmi con questa attività?
Google Photos MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con Google Photos MCP Server.

Opzione 2: aggiungi l'URL di un server MCP

Usa questo metodo se Google Photos MCP Server è già ospitato in remoto o se il tuo team vuole un unico connettore condiviso accessibile a più utenti.

1

Apri Connettori MCP

In TypingMind, vai su Plugin, apri Connettori MCP e scegli Aggiungi URL.

  1. Apri TypingMind nel tuo browser.
  2. Vai a Plugin.
  3. Apri Connettori MCP.
  4. Fai clic su Aggiungi URL.
Modulo di TypingMind per aggiungere l'URL di un server MCP personalizzato
2

Incolla l'URL del server

Inserisci l'URL del server MCP fornito dal provider nel campo URL del server. Aggiungi un nome per la connessione, una descrizione, un'icona, header HTTP personalizzati o le impostazioni del client OAuth se richiesti dal server.

  1. Incolla l'URL del server MCP fornito dal provider nel campo URL del server.
  2. Inserisci un nome per la connessione a Google Photos MCP Server.
  3. Aggiungi una descrizione e un'icona per riconoscere più facilmente la connessione.
  4. Aggiungi header HTTP personalizzati o i dati del client OAuth se il server richiede l'autenticazione.
3

Crea la connessione

Fai clic su Crea connessione, poi torna all'elenco dei plugin e verifica che la nuova connessione MCP sia attiva.

  1. Fai clic su Crea connessione.
  2. Torna all'elenco dei connettori MCP.
  3. Verifica che la connessione Google Photos MCP Server risulti attiva.
  4. Aggiorna l'elenco dei plugin se la connessione non appare subito.
4

Cambia modello senza riconnetterti

Avvia una chat con il tuo modello preferito, abilita gli strumenti di Google Photos MCP Server dalla sezione Plugin e passa a un altro modello quando serve. La connessione MCP rimane disponibile nell'area di lavoro di TypingMind.

  1. Avvia una nuova chat in TypingMind.
  2. Seleziona il modello IA che vuoi usare.
  3. Abilita gli strumenti di Google Photos MCP Server dalla sezione Plugin.
  4. Chiedi al modello di usare lo strumento quando serve.
  5. Passa a un altro modello IA e riutilizza la stessa connessione MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Google Photos MCP Server per aiutarmi con questa attività?
Google Photos MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con Google Photos MCP Server.

Domande frequenti

A cosa serve il server MCP Google Photos MCP Server?

Google Photos MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Google Photos MCP Server MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Google Photos MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Google Photos MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Google Photos MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Google Photos MCP Server MCP a TypingMind?

Puoi collegare Google Photos MCP Server a TypingMind con il connettore MCP locale oppure aggiungendo l'URL di un server MCP remoto. Usa il connettore locale quando il server deve accedere a file, app o risorse private sul tuo dispositivo; usa invece l'URL del server quando il server MCP è ospitato in remoto.

Quali strumenti offre Google Photos MCP Server MCP in TypingMind?

Google Photos MCP Server mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Google Photos MCP Server MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Google Photos MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇