Labsco
savethepolarbears logo

Google Photos

β˜… 24

from savethepolarbears

Access and manage your Google Photos library with AI assistants.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

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.

Capability Status API 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

  • Call create_picker_session β€” returns a URL the user opens in their browser

  • User selects photos from their full library

  • 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

Available tools (19)

Search & browse

Tool Description search_photos Text-based photo search search_photos_by_location Search by location name search_media_by_filter Filter by dates, categories, media type, favorites, archived get_photo Get photo details (optional base64) list_albums List all albums get_album Get album details list_album_photos List photos in an album list_media_items List all media items describe_filter_capabilities JSON reference of all filter options

Write & manage

Tool Description create_album Create a new album upload_media Upload a local file add_media_to_album Add existing items to an album (max 50) create_album_with_media Create album + upload files in one call (max 50) add_album_enrichment Add text or location enrichment set_album_cover Set album cover photo

Picker API

Tool Description create_picker_session Start a Picker session for full library access poll_picker_session Check session status and retrieve selected photos

Auth

Tool Description auth_status Check authentication status start_auth Start OAuth flow via temporary local server

Example queries

Copy & paste β€” that's it
"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.

Development

Project structure

Copy & paste β€” that's it
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

Copy & paste β€” that's it
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:

Copy & paste β€” that's it
npx tsc --noEmit # Type check
npm run lint # ESLint
npm test # Tests

License

MIT