Google Photos MCP Serverのロゴ

Google Photos MCP Server

コミュニティ
savethepolarbears

A Model Context Protocol repository for Google Photos API

公開者savethepolarbears
リポジトリgoogle-photos-mcp
言語TypeScript
フォーク
15
スター
44
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
リンク
  • ツールをAIワークフローに接続

    Google Photos MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには44件のスターと15件のフォークがあります。

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

インストール

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>"
      }
    }
  }
}

Google Photos MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Google Photos MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Google Photos MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Google Photos MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "google-photos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "google-photos-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてGoogle Photos MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Google Photos MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Google Photos MCP Serverを使ってこのタスクを手伝ってもらえますか?
Google Photos MCP Server
はい、読みました。
Google Photos MCP Serverで調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

Google Photos MCP Serverがすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックしてください。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを貼り付けてください。
  2. Google Photos MCP Serverの接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックしてください。
  2. MCPコネクタの一覧に戻ってください。
  3. Google Photos MCP Serverの接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でGoogle Photos MCP Serverのツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でGoogle Photos MCP Serverのツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Google Photos MCP Serverを使ってこのタスクを手伝ってもらえますか?
Google Photos MCP Server
はい、読みました。
Google Photos MCP Serverで調べた結果をお伝えします。

よくある質問

Google Photos MCP Server MCPサーバーは何に使いますか?

Google Photos MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでGoogle Photos MCP Server MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでGoogle Photos MCP Serverを利用できます。

TypingMindでGoogle Photos MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。Google Photos MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Google Photos MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Google Photos MCP Serverは、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでGoogle Photos MCP Server MCPのどのようなツールを利用できますか?

Google Photos MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Google Photos MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Google Photos MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇