Skip to main content
Glama
IgnatRU

charity-gmail-mcp

by IgnatRU

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.


Related MCP server: Moist

1. Google Cloud Console setup (you do this yourself)

  1. Go to console.cloud.google.com and create a new project (or reuse one you already use for this account).

  2. Go to APIs & Services > Library, search for Gmail API, and click Enable.

  3. 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.uk as a test user if the app is in "Testing" publishing status.

  4. 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:

  1. 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/).

  2. 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.

  3. Add an environment variable PUBLIC_URL set 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.

  4. Confirm it's up by visiting https://<your-url>/.well-known/oauth-protected-resource in 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

  1. In Claude: Customize > Connectors > "+" > Add custom connector.

  2. Server URL: https://<your-deployed-url>/mcp

  3. Click Advanced settings and paste the OAuth Client ID and Client Secret from step 1.

  4. Click Add, then Connect.

  5. You'll be redirected to Google's sign-in — log in as ignat@wesolveproblems.org.uk and approve the Gmail scopes.

  6. 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.

Related MCP Connectors

  • Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.

  • Permissioned access to Gmail, Drive and Calendar via the user's own Google account

  • MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.

  • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Gmail access through MCP, allowing LLMs to read, compose, and send emails.
    10
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Connects multiple Gmail accounts to Claude Desktop via MCP, enabling email search, labeling, drafts, and confirmed sending through natural language.
    13
    62 npm
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with Gmail accounts via MCP, providing tools for listing labels, searching, reading, drafting, and sending emails with OAuth2 authentication.
    -