charity-gmail-mcp
Enables accessing Gmail tools (search, read, draft) for a specific Google account via MCP, designed as a custom connector for Claude/Cowork to use alongside a different Google account.
README
charity-gmail-mcp
A remote MCP server exposing Gmail tools for one specific Google account
(intended for ignat@wesolveproblems.org.uk, the We Solve Problems charity
account). The point of building this is so it can run as a custom
connector in Claude/Cowork, freeing up the native Gmail/Drive connector to
be connected to a different Google account (e.g. the boat disposal
business inbox) at the same time.
How it works (no accounts created for you, no passwords handled)
This server does not implement its own login system. It tells Claude that
Google itself is the authorization server (via a standard metadata file
at /.well-known/oauth-protected-resource). When you connect this server to
Claude, Claude redirects you to Google's own sign-in and consent screen —
you log into ignat@wesolveproblems.org.uk there, directly with Google, the
same way you would for any "Sign in with Google" flow. Claude then holds the
resulting Google access token and sends it to this server with every
request. This server only uses that token to call the Gmail API on Google's
servers — it never sees or stores a password.
You will need to do the Google Cloud Console setup yourself (step 1 below), since it requires signing into your own Google account.
1. Google Cloud Console setup (you do this yourself)
- Go to console.cloud.google.com and create a new project (or reuse one you already use for this account).
- Go to APIs & Services > Library, search for Gmail API, and click Enable.
- Go to APIs & Services > OAuth consent screen.
- User type: External (unless you have Google Workspace and want Internal).
- Fill in the app name (e.g. "Charity Gmail MCP"), your support email, etc.
- Add scopes:
gmail.readonly,gmail.compose,gmail.labels. - Add
ignat@wesolveproblems.org.ukas a test user if the app is in "Testing" publishing status.
- Go to APIs & Services > Credentials > Create Credentials > OAuth client ID.
- Application type: Web application.
- Authorized redirect URI:
https://claude.ai/api/mcp/auth_callback(this is Claude's own callback URL, not something you host). - Save. Copy the Client ID and Client Secret — you'll paste these into Claude later, not into this codebase.
2. Deploy this server
The server needs a public HTTPS URL that Anthropic's servers can reach (Claude connects to it from Anthropic's cloud, not from your device, even in Cowork/Desktop). Any Node host works. Render.com's free tier is the simplest to get started with — note that Render does not have an "upload a folder" button; it deploys either from a connected Git repo or a prebuilt Docker image. For a small project like this, a Git repo is the easy path:
- Create an empty repo on GitHub and push this folder to it — or, if you'd
rather keep it inside an existing bigger repo, commit this folder there
at any path (e.g.
tools/charity-gmail-mcp/). - In Render: New + > Web Service, connect that GitHub repo.
- Build command:
npm install - Start command:
npm start - If this folder lives inside a bigger repo, also set Root Directory
(Settings > Build & Deploy) to that folder's path, e.g.
tools/charity-gmail-mcp. Build/start commands then run relative to it, and files outside it aren't visible to the service. See Render's monorepo support docs.
- Build command:
- Add an environment variable
PUBLIC_URLset to the URL Render assigns you, e.g.https://charity-gmail-mcp.onrender.com(no trailing slash). You may need to deploy once first to learn the URL, then set the env var and redeploy. - Confirm it's up by visiting
https://<your-url>/.well-known/oauth-protected-resourcein a browser — you should see a small JSON document.
Alternatives to Render: Railway, Fly.io, or any VPS running Node 18+. Avoid
serverless platforms with cold-start file systems unless you're comfortable
adapting the code — this implementation is stateless so it should actually
work fine on most of them, but Cloudflare Workers specifically would need
the googleapis-style calls ported to raw fetch (this code already uses
plain fetch-free googleapis... see note below).
Note: this server currently talks to Gmail via the googleapis npm
package. If you deploy to an edge/Workers runtime that doesn't support it,
swap those calls for direct fetch() calls to
https://gmail.googleapis.com/gmail/v1/... with the bearer token — the
tool logic and shapes stay the same.
3. Add it to Claude / Cowork
- In Claude: Customize > Connectors > "+" > Add custom connector.
- Server URL:
https://<your-deployed-url>/mcp - Click Advanced settings and paste the OAuth Client ID and Client Secret from step 1.
- Click Add, then Connect.
- You'll be redirected to Google's sign-in — log in as
ignat@wesolveproblems.org.ukand approve the Gmail scopes. - Done. This connector now gives Claude Gmail tools for the charity account, independently of whatever account is connected via the native Gmail/Drive connector.
Tools this server exposes
| Tool | What it does |
|---|---|
search_messages |
Search Gmail with normal Gmail search syntax |
get_message |
Fetch a single message's full content by ID |
get_thread |
Fetch a full conversation thread by ID |
list_labels |
List all Gmail labels |
create_draft |
Create a draft email (never sends — you send manually) |
Local testing before deploying
npm install
PUBLIC_URL=http://localhost:3000 npm start
Then in another terminal:
curl http://localhost:3000/.well-known/oauth-protected-resource
You should see a JSON document listing Google as the authorization server.
A POST to /mcp without an Authorization: Bearer <token> header should
return 401 Unauthorized.
Limitations / things to harden if this goes beyond personal use
- No rate limiting or logging.
- If Google's access token expires mid-session, Claude handles refresh via its own OAuth client credentials flow with Google — this server doesn't need to do anything extra for that.
- Attachment content isn't exposed (matches the native Gmail connector's
own limitation) — only metadata via
get_message.
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.