Google User MCP

Google User MCP

Authenticates users via Google OAuth and returns the authenticated user's display name through the get_current_user tool. Supports deployment on Node.js and Cloudflare Workers.

Category
Visit Server

README

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 スコープを使用します。

設定

.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_URL、HOST、PORT の設定は不要です。

  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を設定してください。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured