Google Photos MCP Server
Google Photos MCP サーバー
Google フォト統合のための Model Context Protocol (MCP) サーバーです。Claude、Gemini、その他の AI アシスタントが Google フォトライブラリの写真を読み取り、書き込み、選択できるようにします。
✅ Picker API サポート (2025年3月以降)
このサーバーは Google Photos Picker API を実装しており、2025年3月31日の特定の Library API スコープの廃止後も、ライブラリへのフルアクセスを提供します。
機能 | ステータス | API |
フォトライブラリ全体の閲覧 | ✅ | Picker API |
テキスト/日付/カテゴリによる写真検索 | ✅ | Library API |
アルバム作成と写真アップロード | ✅ | Library API |
アプリ作成コンテンツへのアクセス | ✅ | Library API |
Picker API の仕組み
create_picker_sessionを呼び出す — ユーザーがブラウザで開く URL が返されますユーザーがライブラリ全体から写真を選択します
poll_picker_sessionを呼び出す —mediaItemsSetが true になると、選択された写真が返されます
Related MCP server: Immich MCP Server
🛡️ セキュリティ通知: CORS の削除
セキュリティ上の理由(localhost へのドライブバイ攻撃を防ぐため)により、CORS ミドルウェアは削除されました。
✅ STDIO モード (Claude Desktop): 通常通り動作します
✅ ストリーミング HTTP (Cursor, サーバー間): 通常通り動作します
❌ ブラウザ AJAX: サポートされていません (設計上の仕様)
機能
読み取り操作
テキスト、日付、場所、カテゴリ、お気に入りによる写真検索
メディアタイプ(写真/動画)、日付範囲、アーカイブ状態によるフィルタリング
base64 エンコードされた画像を含む写真詳細の取得
アルバムとその内容の一覧表示
利用可能なフィルタ機能の説明
書き込み操作
アルバムの作成と写真のアップロード
create_album_with_mediaによるバッチアップロード(最大50ファイル)アルバムへのテキストおよび位置情報の追加
アルバムカバー写真の設定
Picker 操作
ライブラリ全体にアクセスするための Picker セッションの作成
セッションのポーリングと選択されたメディアアイテムの取得
インフラストラクチャ
⚡ ストリーミング HTTP トランスポート (MCP 2025-06-18 仕様)
🔗 接続プーリングを備えた HTTPS Keep-Alive
🔒 OS キーチェーンへのトークン保存
📊 自動追跡によるクォータ管理
🔄 自動トークン更新
前提条件
Node.js 22.22+
Photos Library API が有効な Google Cloud プロジェクト
OAuth 2.0 認証情報 (Web アプリケーションタイプ)
セットアップ
1. Google Cloud のセットアップ
Google Cloud Console にアクセスします
新しいプロジェクトを作成(または既存のプロジェクトを選択)します
Photos Library API を有効にします
OAuth 2.0 認証情報(Web アプリケーション)を作成します
http://localhost:3000/auth/callbackを承認済みリダイレクト URI として追加しますクライアント ID とクライアントシークレットを控えておきます
2. インストール
git clone https://github.com/savethepolarbears/google-photos-mcp.git
cd google-photos-mcp
npm install3. 設定
cp .env.example .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=development4. ビルドと実行
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 reload5. 認証
HTTP モードで開始:
npm startブラウザで
http://localhost:3000/authにアクセスしますGoogle OAuth フローを完了します
トークンは自動的に OS キーチェーンに保存されます
注意: 認証は最初に HTTP モードで完了する必要があります。その後、Claude Desktop 用に STDIO モードに切り替えてください。
動的ポート
PORT=3001 npm start
# Also update GOOGLE_REDIRECT_URI in .env to matchクライアント設定
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 (推奨):
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 cursorMCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js # HTTP
npx @modelcontextprotocol/inspector node dist/index.js --stdio # STDIO利用可能なツール (19)
検索と閲覧
ツール | 説明 |
| テキストベースの写真検索 |
| 場所名による検索 |
| 日付、カテゴリ、メディアタイプ、お気に入り、アーカイブによるフィルタリング |
| 写真詳細の取得 (オプションで base64) |
| 全アルバムの一覧表示 |
| アルバム詳細の取得 |
| アルバム内の写真一覧 |
| 全メディアアイテムの一覧表示 |
| 全フィルタオプションの JSON リファレンス |
書き込みと管理
ツール | 説明 |
| 新規アルバムの作成 |
| ローカルファイルのアップロード |
| 既存アイテムをアルバムに追加 (最大50) |
| アルバム作成 + ファイルアップロードを一度に実行 (最大50) |
| テキストまたは位置情報の追加 |
| アルバムカバー写真の設定 |
Picker API
ツール | 説明 |
| ライブラリ全体にアクセスするための Picker セッションを開始 |
| セッションステータスの確認と選択された写真の取得 |
認証
ツール | 説明 |
| 認証ステータスの確認 |
| 一時的なローカルサーバーを介した OAuth フローの開始 |
クエリ例
"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)位置情報データ
位置情報は概算であり、OpenStreetMap/Nominatim ジオコーディングを使用して写真の説明から抽出されます。利用可能な場合、緯度/経度、市区町村、地域、国が含まれます。
デプロイ / リリース
このプロジェクトは、Claude Desktop や Cursor などの AI クライアントと一緒にローカルで実行することを目的とした Model Context Protocol (MCP) サーバーです。ローカルのチェックアウトや NPM インストールを最新の状態に保つ以外に、リモートデプロイやリリースプロセスは必要ありません。
トラブルシューティング
Node バージョン: 古いバージョンはサポートされていないため、Node.js 22.22+ を使用していることを確認してください。
認証:
GOOGLE_CLIENT_ID is not setエラーが発生したり、認証が失敗したりする場合は、.envファイルがルートディレクトリに存在し、正しい Google Cloud 認証情報が含まれていることを確認してください。STDIO モードに切り替える前に、必ずnpm start(HTTP モード) を実行して認証を行ってください。クォータの問題: Google Photos API の制限が適用されます。1日10,000リクエストのクォータ制限に達していないことを確認してください。サーバーは
quotaManagerを介してこれを追跡します。CORS エラー: サーバーはドライブバイ攻撃を防ぐために意図的に CORS を無効にしています。ブラウザの AJAX リクエストから直接サーバーを呼び出そうとしないでください。
開発
プロジェクト構造
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テスト
npm test # All tests (Vitest)
npm run test:watch # Interactive TDD
npm run test:coverage # Coverage report
npm run test:security # Security suite only品質チェック
マージ前に以下の3つすべてに合格する必要があります:
npx tsc --noEmit # Type check
npm run lint # ESLint
npm test # Testsライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Sort, search and tidy your Google Photos from chat: find photos and videos, read their details, dow…
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceExposes a visual library with semantic search, tagging, editing, and management of photos as tools for AI agents like Claude Code.13 npm49MIT- FlicenseNot gradedqualityCmaintenanceEnables users to search and retrieve photos from a self-hosted Immich photo library via natural language, supporting CLIP-based semantic search, metadata filtering, album browsing, and share link creation.-
- AlicenseAqualityBmaintenanceEnables AI agents to search, inspect, organize, and export photos from a local Apple Photos library using natural language, including scene labels, text, faces, places, and albums.132MIT
- AlicenseAqualityBmaintenanceEnables AI agents to work with a user's Google Photos through Google's picker, letting users choose exactly what the agent sees while providing tools for uploading media, creating and sharing albums, writing captions and enrichments, searching app-created media, and managing multiple Google accounts.2940 npm1MIT