mcp-google-contacts
A remote MCP server for Google Contacts, deployed on Cloudflare Workers, that enables Claude to create, search, list, get, and update your Google contacts via the People API. Designed as a custom connector for claude.ai, it supports OAuth and can extract contact details from business card photos.
README
mcp-google-contacts
A remote MCP server for Google Contacts, deployed on Cloudflare Workers, for use as a custom connector in claude.ai (web/desktop/mobile). Each user who connects authorizes their own Google account via OAuth — the server proxies that OAuth flow and never sees your Google password, just the tokens it needs to call the People API on your behalf.
Built for a specific workflow: send Claude a photo of a namecard/business card and have it extract the details and save a new contact for you.
Architecture
@cloudflare/workers-oauth-provider— implements the OAuth 2.1 server that claude.ai talks to (authorize/token/dynamic client registration), and hands your Worker an encryptedpropsbag per authorized user.google-handler.ts— a small Hono app that owns/authorizeand/callback: shows the consent screen, redirects to Google, exchanges the code for tokens, and stores the Google refresh token inprops.agents'McpAgent— a Durable Object-backed MCP server. Tool calls readthis.props.googleRefreshTokenand mint a fresh Google access token on demand (cached in-memory per Worker isolate) before calling the People API.workers-oauth-utils.ts— CSRF/session/approval-dialog plumbing, copied near-verbatim from Cloudflare's reference OAuth demo (provider-agnostic).
Tools
create_contact— create a contact (name, company, title, emails, phones, address, notes)search_contacts— search existing contacts by name/email/phone/company (use before creating, to avoid duplicates)list_contacts— list contacts, most recently modified firstget_contact— fetch full details for one contactupdate_contact— update fields on an existing contact
1. Google Cloud setup
- Go to the Google Cloud Console and create (or pick) a project.
- Enable the Google People API.
- Go to APIs & Services → Credentials → Create Credentials → OAuth client ID.
- Application type: Web application
- Authorized redirect URI:
https://<your-worker-subdomain>.workers.dev/callback(you'll know your Worker's URL after the firstwrangler deploy— you can add/edit this redirect URI afterward in the Cloud Console). - Save the Client ID and Client Secret.
- If your OAuth consent screen is in "Testing" mode, add your own Google account as a test user.
2. Cloudflare setup
npm install
npx wrangler login
npx wrangler kv namespace create OAUTH_KV
Copy the id printed by the last command into wrangler.jsonc under both
kv_namespaces[0].id and env.development.kv_namespaces[0].id.
If npx wrangler whoami lists more than one Cloudflare account, add
"account_id" to wrangler.jsonc (see the comment there) or set the
CLOUDFLARE_ACCOUNT_ID env var — otherwise wrangler can't tell which
account to deploy to.
Set secrets (you'll be prompted to paste each value):
npx wrangler secret put GOOGLE_CLIENT_ID
npx wrangler secret put GOOGLE_CLIENT_SECRET
npx wrangler secret put COOKIE_ENCRYPTION_KEY # e.g. output of: openssl rand -hex 32
3. Deploy
npm run deploy
This prints your Worker's URL, e.g. https://mcp-google-contacts.<your-subdomain>.workers.dev.
Go back to the Google Cloud Console and make sure the OAuth client's redirect
URI is exactly <that-url>/callback.
4. Connect it to claude.ai
In claude.ai: Settings → Connectors → Add custom connector, and enter:
https://mcp-google-contacts.<your-subdomain>.workers.dev/mcp
Claude will walk you through authorizing — you'll see the consent screen
from google-handler.ts, then Google's own OAuth screen. Once approved, the
Google Contacts tools are available in your conversations.
Local development
cp .env.development.example .env.development # fill in the same three values as the secrets above
npm run dev
wrangler dev runs the Worker locally; note that Google's OAuth redirect
must match what you're actually running against (add http://localhost:8788/callback
as an additional authorized redirect URI in Google Cloud Console for local testing).
Notes
- Uses the
https://www.googleapis.com/auth/contactsOAuth scope (read/write access to your contacts) plusemail profileto identify who's connecting. - Google access tokens expire in ~1 hour; this server refreshes them on demand from the stored refresh token rather than syncing to this Worker's own OAuth token lifetime — simpler and correct regardless of how long a Claude session goes between its own token refreshes.
search_contacts/list_contactspage through all ofpeople/me's connections client-side rather than using the People API'ssearchContactsendpoint, which requires a separate index warm-up and can lag behind recent edits.- A previous local-only version of this server (stdio transport, for Claude Desktop) is available in this repo's git history if you'd rather run it locally instead of deploying.
Contributing
See CONTRIBUTING.md for local setup and the quality
checks (npm run check) to run before opening a PR.
License
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.