Skip to main content
Glama
usuijuice

Google User MCP

by usuijuice

Google user MCP

Google OAuth でユーザーを認証し、認証したユーザーの表示名を返す Streamable HTTP MCP サーバーです。提供するツールは get_current_user だけです。

Google OAuth の準備

  1. Google Cloud Console で OAuth 同意画面を設定します。

  2. OAuth 2.0 クライアントを作成し、使用する MCP クライアントのリダイレクト URI を登録します。

  3. 同じクライアント ID を MCP クライアントと、このサーバーの GOOGLE_CLIENT_ID に設定します。

  4. MCP クライアントには必要に応じてクライアントシークレットも設定します。サーバー側には不要です。

Google は Dynamic Client Registration を提供しないため、MCP クライアントには事前登録した クライアント ID を設定してください。認証では openid profile スコープを使用します。

Related MCP server: Remote MCP Server on Cloudflare

設定

.env.example.env にコピーします。プロジェクト直下の .env は起動時に自動で読み込まれ、 すでに設定されている環境変数は上書きしません。

cp .env.example .env

環境変数

必須

説明

GOOGLE_CLIENT_ID

はい

Google Cloud で作成した OAuth 2.0 クライアント ID。

MCP_SERVER_URL

本番では推奨

公開 MCP URL。既定値は http://127.0.0.1:3000/mcp

HOST / PORT

いいえ

listen 先。既定値は 127.0.0.1:3000

本番の MCP_SERVER_URL には HTTPS URL を指定してください。

ローカルでNode.jsサーバーを実行

Node.js 20.12 以上と pnpm が必要です。

pnpm install
pnpm build
pnpm start

MCP エンドポイントは MCP_SERVER_URL です。アクセストークンの OAuth クライアント、期限、 スコープを Google の token info endpoint で検証し、Google OpenID Connect の userinfo endpoint から認証ユーザーの表示名を取得します。

Cloudflare Workersへデプロイ

Workers版も同じGoogle OAuth検証と get_current_user ツールを使用します。公開URLはリクエスト から自動的に判定されるため、Workersには MCP_SERVER_URLHOSTPORT の設定は不要です。

  1. WranglerでCloudflareへログインします。

    pnpm exec wrangler login
  2. Google OAuthクライアントIDをWorkerのsecretとして登録します。

    pnpm exec wrangler secret put GOOGLE_CLIENT_ID
  3. デプロイします。

    pnpm worker:deploy

デプロイ完了時に表示されるURLの末尾へ /mcp を付けたものがMCPエンドポイントです。たとえば Worker URLが https://auth-mcp.example.workers.dev の場合は https://auth-mcp.example.workers.dev/mcp です。

ローカルでWorkers版を動かす場合は、既存の .env から GOOGLE_CLIENT_ID が読み込まれます。

pnpm worker:dev

既定のMCPエンドポイントは http://localhost:8787/mcp です。GoogleはDynamic Client Registrationを提供しないため、接続するMCPクライアントには同じGoogle OAuthクライアントIDと、 そのクライアント用にGoogle Cloud Consoleへ登録したリダイレクトURIを設定してください。

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    C
    maintenance
    Enables deploying a Model Context Protocol (MCP) server on Cloudflare Workers with built-in OAuth authentication. It allows local clients like Claude Desktop to securely connect to and use remote tools through an HTTP/SSE transport.
  • F
    license
    -
    quality
    C
    maintenance
    Enables deploying and running a Model Context Protocol (MCP) server on Cloudflare Workers with built-in OAuth authentication. It allows users to host and access tools remotely via Server-Sent Events (SSE) transport from clients like Claude Desktop.
  • A
    license
    -
    quality
    D
    maintenance
    Enables AI clients to interact with Google services (Gmail, Calendar, Drive, Tasks, YouTube, Contacts) via OAuth-authenticated Cloudflare Workers, allowing actions like sending emails, managing events, and searching files.
    14
    MIT

View all related MCP servers

Related MCP Connectors

  • Google-OAuth-gated LLM gateway: verify a Google ID token, then run a Gemini (Vertex AI) completion f

  • Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.

  • Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/usuijuice/auth-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server