
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β whenmediaItemsSetis 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
"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
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
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:
npx tsc --noEmit # Type check
npm run lint # ESLint
npm test # Tests
License
MIT
git clone https://github.com/savethepolarbears/google-photos-mcp.git
cd google-photos-mcp
npm installBefore it works, you'll need: GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_REDIRECT_URI
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
-
Go to Google Cloud Console
-
Create a new project (or select existing)
-
Enable Photos Library API
-
Create OAuth 2.0 credentials (Web application)
-
Add
http://localhost:3000/auth/callbackas an authorized redirect URI -
Note your Client ID and Client Secret
2. Installation
git clone https://github.com/savethepolarbears/google-photos-mcp.git
cd google-photos-mcp
npm install
3. Configuration
cp .env.example .env
Edit .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
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
-
Start in HTTP mode:
npm start -
Visit
http://localhost:3000/authin your browser -
Complete the Google OAuth flow
-
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
PORT=3001 npm start
# Also update GOOGLE_REDIRECT_URI in .env to match
Client configuration
Claude Desktop (STDIO)
{
"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
# 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
npx @modelcontextprotocol/inspector node dist/index.js # HTTP
npx @modelcontextprotocol/inspector node dist/index.js --stdio # STDIO
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 seterrors or authentication fails, verify your.envfile is present in the root directory and contains your correct Google Cloud credentials. Remember to runnpm 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.