# How TPMs Can Build an MCP Server That Connects to Google Workspace — And Automate Everything

*By [Gianfranco Mileo](https://gianfranco-mileo.com/) · Published May 26, 2026 · updated September 6, 2026 · 10 min read · Category: AI & Technology · Tags: MCP, Automation, Gemini · Canonical: https://gianfranco-mileo.com/blog/tpms-build-mcp-server-gsuite-automation*

> The Model Context Protocol (MCP) is the missing bridge between your AI assistant and every Google Workspace tool you use daily. Here's how TPMs can build one — with real code, real ideas, and real impact.

Imagine asking Gemini: *"What's blocking the Android launch? Summarize the last 7 days of emails, check the project tracker, and draft a status update to the VP."* And it just… does it. No copy-pasting. No tab-switching. No hour-long context-gathering ritual before every weekly review.

That's not a fantasy. That's the Model Context Protocol (MCP) — and it's available right now. This guide shows TPMs exactly how to build an MCP server that connects Gemini (or any MCP-compatible AI) to Google Workspace, and walks through 15+ automation ideas that will change how you operate.

---

## What Is MCP, and Why Should Every TPM Care?

The **Model Context Protocol** is an open standard created by Anthropic (and adopted by Google, OpenAI, and others) that lets AI models *call tools* in a structured, secure way. Think of it as a USB standard for AI integrations — instead of every AI having proprietary plugins, MCP gives any compliant AI a consistent way to reach out to external systems.

For TPMs, this matters enormously. Our job is fundamentally about **context aggregation** — pulling signals from Jira, Docs, Gmail, Slides, Calendar, and Sheets, synthesizing them, and making decisions. MCP lets your AI do that aggregation *for* you, on demand, in real time.

### The TPM's Daily Context Tax

Before you can even start thinking, you spend 90 minutes every morning:

- Reading 40+ emails for status signals
- Scanning your Calendar for upcoming deadlines and stakeholder meetings
- Pulling up the shared Tracker Sheet to check milestones
- Checking Drive for the latest PRD or design doc
- Writing status summaries from scratch

An MCP server eliminates that tax. You ask one question, and your AI agent does all of the above in seconds.

---

## Architecture: How a TPM-Focused MCP Server Works

Here's the high-level architecture:

```
┌──────────────────────────────────────┐
│         AI Client (Gemini/Claude)    │
│         "What's blocking launch?"    │
└──────────────────┬───────────────────┘
                   │ MCP Protocol (JSON-RPC over stdio/SSE)
                   ▼
┌──────────────────────────────────────┐
│         Your MCP Server (Node.js)    │
│                                      │
│  Tools:                              │
│  • gmail_search(query, days)         │
│  • calendar_upcoming(days)           │
│  • sheets_read(spreadsheetId, range) │
│  • drive_search(query)               │
│  • docs_get(docId)                   │
│  • gmail_draft(to, subject, body)    │
│  • calendar_create_event(...)        │
│  • sheets_append(spreadsheetId, ...) │
└──────┬──────┬──────┬──────┬──────────┘
       │      │      │      │
    Gmail  Calendar Drive  Sheets
       └──────┴──────┴──────┘
         Google Workspace APIs
         (OAuth 2.0 Service Account)
```

---

## Getting Started: Setting Up Your MCP Server

### Step 1: Project Setup

```
mkdir tpm-mcp-server && cd tpm-mcp-server
npm init -y
npm install @modelcontextprotocol/sdk googleapis dotenv
```

### Step 2: Google Cloud Setup

1. Create a project in [Google Cloud Console](https://console.cloud.google.com)
2. Enable APIs: Gmail API, Google Calendar API, Google Drive API, Google Sheets API
3. Create a **Service Account** and download the JSON key
4. Share your Google Workspace resources with the service account email (or use domain-wide delegation for full access)
5. Set the JSON key path in your `.env`:

```
# .env
GOOGLE_APPLICATION_CREDENTIALS=./service-account.json
GMAIL_USER=you@yourcompany.com
```

### Step 3: Create the MCP Server

```
// server.js
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { google } from 'googleapis';
import { z } from 'zod';

const auth = new google.auth.GoogleAuth({
  keyFile: process.env.GOOGLE_APPLICATION_CREDENTIALS,
  scopes: [
    'https://www.googleapis.com/auth/gmail.readonly',
    'https://www.googleapis.com/auth/gmail.compose',
    'https://www.googleapis.com/auth/calendar',
    'https://www.googleapis.com/auth/drive.readonly',
    'https://www.googleapis.com/auth/spreadsheets',
  ],
});

const gmail    = google.gmail({ version: 'v1', auth });
const calendar = google.calendar({ version: 'v3', auth });
const drive    = google.drive({ version: 'v3', auth });
const sheets   = google.sheets({ version: 'v4', auth });

const server = new McpServer({ name: 'tpm-gsuite', version: '1.0.0' });

// ── TOOL: Search Gmail ──
server.tool('gmail_search',
  { query: z.string(), maxResults: z.number().optional().default(10) },
  async ({ query, maxResults }) => {
    const res = await gmail.users.messages.list({
      userId: process.env.GMAIL_USER,
      q: query, maxResults,
    });
    const messages = await Promise.all(
      (res.data.messages || []).map(async ({ id }) => {
        const msg = await gmail.users.messages.get({
          userId: process.env.GMAIL_USER, id, format: 'metadata',
          metadataHeaders: ['Subject', 'From', 'Date'],
        });
        const h = msg.data.payload.headers;
        return {
          subject: h.find(x => x.name === 'Subject')?.value,
          from:    h.find(x => x.name === 'From')?.value,
          date:    h.find(x => x.name === 'Date')?.value,
          snippet: msg.data.snippet,
        };
      })
    );
    return { content: [{ type: 'text', text: JSON.stringify(messages, null, 2) }] };
  }
);

// ── TOOL: Get Upcoming Calendar Events ──
server.tool('calendar_upcoming',
  { days: z.number().default(7) },
  async ({ days }) => {
    const now  = new Date();
    const end  = new Date(now.getTime() + days * 86400000);
    const res  = await calendar.events.list({
      calendarId: 'primary', timeMin: now.toISOString(),
      timeMax: end.toISOString(), singleEvents: true, orderBy: 'startTime',
    });
    return { content: [{ type: 'text', text: JSON.stringify(res.data.items, null, 2) }] };
  }
);

// ── TOOL: Read Google Sheet ──
server.tool('sheets_read',
  { spreadsheetId: z.string(), range: z.string() },
  async ({ spreadsheetId, range }) => {
    const res = await sheets.spreadsheets.values.get({ spreadsheetId, range });
    return { content: [{ type: 'text', text: JSON.stringify(res.data.values, null, 2) }] };
  }
);

// ── TOOL: Draft Gmail ──
server.tool('gmail_draft',
  { to: z.string(), subject: z.string(), body: z.string() },
  async ({ to, subject, body }) => {
    const raw = Buffer.from(
      `To: ${to}\nSubject: ${subject}\nContent-Type: text/plain\n\n${body}`
    ).toString('base64url');
    await gmail.users.drafts.create({
      userId: process.env.GMAIL_USER,
      requestBody: { message: { raw } },
    });
    return { content: [{ type: 'text', text: 'Draft created successfully.' }] };
  }
);

// ── TOOL: Search Drive ──
server.tool('drive_search',
  { query: z.string(), maxResults: z.number().default(5) },
  async ({ query, maxResults }) => {
    const res = await drive.files.list({
      q: query, pageSize: maxResults,
      fields: 'files(id,name,modifiedTime,webViewLink)',
    });
    return { content: [{ type: 'text', text: JSON.stringify(res.data.files, null, 2) }] };
  }
);

// Start the server
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('TPM MCP Server running on stdio');
```

---

## 15 Automations That Will Change How You Work

Once your MCP server is running and connected to Gemini or Claude Desktop, here are the prompts you can use immediately:

### 📊 Status & Reporting

1. **"Weekly Status Draft"** — *"Search my Gmail for emails mentioning [project name] from the last 7 days. Check the milestone tracker in [Sheet ID] for red/yellow items. Draft a weekly status email to [VP name]."*
2. **"Blocker Radar"** — *"Scan Gmail for threads with words 'blocked', 'dependency', 'waiting on', 'need decision' from the last 3 days. Group them by project and format as a priority list."*
3. **"Launch Readiness Check"** — *"Read the launch checklist in [Doc ID] and cross-reference with the last 10 emails mentioning the launch. Identify which checklist items have no recent email activity (potential forgotten tasks)."*

### 📅 Meeting Efficiency

4. **"Pre-Meeting Brief"** — *"I have a meeting with [name] in 2 hours. Search Gmail for our last 5 email threads. Find any docs they shared in Drive. Summarize key discussion points."*
5. **"Auto Agenda Builder"** — *"Look at my calendar for tomorrow. For each meeting that has no description/agenda, search Gmail for recent context and write a proposed agenda. Create a draft email to all attendees."*
6. **"Meeting Load Analysis"** — *"Get my calendar for next 2 weeks. Calculate how many hours I spend in meetings per day. Identify meeting-free blocks of 2+ hours. Suggest 3 blocks for deep work."*
7. **"Recurring Meeting ROI"** — *"Look at my recurring meetings. For each one, find the last 3 email threads that were sent after the meeting. Assess whether decisions made in the meeting led to action."*

### 📨 Email Triage

8. **"Executive Escalation Filter"** — *"Search Gmail for emails from [VP/Director names]. Summarize each email in one sentence. Flag any that contain a question directed at me or a request."*
9. **"Unresponded Threads"** — *"Find email threads from the last 5 days where I was the last one to receive a message but haven't replied. Sort by age."*
10. **"Stakeholder Health Check"** — *"List every person in my Calendar for the next 2 weeks. Search Gmail for my last email exchange with each of them. Flag any stakeholder I haven't emailed in over 2 weeks."*

### 📋 Documentation & Tracking

11. **"Decision Log Auto-fill"** — *"Search Gmail for emails with words 'decision', 'we decided', 'agreed', 'going with' from the last 30 days. Extract each decision with context. Append them to the decision log spreadsheet [Sheet ID]."*
12. **"Risk Registry from Email"** — *"Scan Gmail for phrases like 'risk', 'concern', 'issue', 'problem', 'worried about' in project-related threads. Extract them with sender and date. Format as a risk registry table."*
13. **"OKR Progress from Docs"** — *"Get the OKR doc from Drive [ID]. For each Key Result, search Gmail and Sheets for evidence of progress. Summarize what's on track, at risk, or behind."*

### 🚀 Launch & Delivery

14. **"Go/No-Go Signal Aggregator"** — *"Read the go/no-go checklist doc. For each owner, search Gmail for their most recent sign-off or status on their checklist item. Build a dashboard view."*
15. **"Post-Mortem Prep"** — *"An incident happened [date]. Search Gmail for all threads mentioning [incident codename] between [date range]. Extract timeline events, people involved, and impact statements. Draft the timeline section of the post-mortem."*

---

## Useful MCP Servers & Resources from the Community

You don't have to build everything from scratch. The MCP ecosystem is growing fast:

- **[modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers)** — Official reference MCP server implementations (filesystem, GitHub, Slack, Google Maps, and more)
- **[googleapis/google-auth-library-nodejs](https://github.com/googleapis/google-auth-library-nodejs)** — Official Node.js Google auth library
- **[Zapier MCP Server](https://github.com/zapier/mcp-server-zapier)** — Connect 6,000+ apps via Zapier through MCP
- **[Cal.com MCP](https://github.com/calcom/cal.com)** — Calendar management via MCP
- **MCP Inspector** — CLI tool to test and debug your MCP server locally: `npx @modelcontextprotocol/inspector node server.js`
- **Claude Desktop** — Native MCP client, add your server to `claude_desktop_config.json`
- **Gemini CLI / ADK** — Google's agent development kit supports MCP servers as tools

### GitHub Projects to Fork & Extend

- `github.com/modelcontextprotocol/typescript-sdk` — The TypeScript SDK used in this guide
- `github.com/punkpeye/awesome-mcp-servers` — Curated list of 200+ community MCP servers
- `github.com/google-gemini/cookbook` — Gemini API examples including agent/tool patterns
- `github.com/anthropics/anthropic-cookbook` — MCP examples and agent patterns

---

## Connecting to Claude Desktop (5 minutes)

```
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "tpm-gsuite": {
      "command": "node",
      "args": ["/path/to/your/tpm-mcp-server/server.js"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json",
        "GMAIL_USER": "you@yourcompany.com"
      }
    }
  }
}
```

Restart Claude Desktop. You'll see a 🔌 icon — your server is connected. Now type any of the prompts above and watch it work.

---

## Security Considerations for Enterprise TPMs

Before deploying at Google or any large org:

- **Scopes**: Request the minimum necessary OAuth scopes. Use `gmail.readonly` instead of `gmail.modify` unless you need to write
- **Service Account isolation**: Use separate service accounts per MCP server instance
- **No secrets in code**: Use Secret Manager (GCP) or 1Password Secret References
- **Audit logging**: Log every tool call with timestamp, user, and parameters to Cloud Logging
- **Data residency**: If your org has data sovereignty requirements, ensure your MCP server runs in the same region as your GCP project
- **Review with security team**: Domain-wide delegation is powerful — get approval before using it

---

## The Bigger Picture: TPMs as the AI Integration Layer

Here's the insight that changes everything: **TPMs already are MCP servers** — in human form. We aggregate context from dozens of sources, apply judgment, and produce synthesized outputs (status updates, risk assessments, decisions). MCP just lets us offload the mechanical parts of that to AI.

The TPMs who thrive in the next 5 years won't be the ones who resist AI — they'll be the ones who understand how to wire it into the systems their organizations already use. Building an MCP server is the most leveraged skill a TPM can develop right now.

Your first MCP server might take a weekend. Your second will take an afternoon. By your fifth, you'll be building them for your entire team — and shipping 10× more than the humans still reading emails one by one.

Related: see [The TPM's Guide to Evaluating AI Tools Without the Hype](https://gianfranco-mileo.com/blog/the-tpms-guide-to-evaluating-ai-tools-without-the-hype) and [Managed Agents, DRIs, and the TPM: What Actually Moves the Needle](https://gianfranco-mileo.com/blog/managed-agents-dris-and-the-tpm-what-actually-moves-the-needle).

---

## Quick Start Checklist

- ☐ Enable Gmail, Calendar, Drive, Sheets APIs in Google Cloud Console
- ☐ Create a service account and download JSON key
- ☐ `npm install @modelcontextprotocol/sdk googleapis`
- ☐ Copy the server.js template above and customize
- ☐ Test with MCP Inspector: `npx @modelcontextprotocol/inspector node server.js`
- ☐ Add to Claude Desktop or Gemini CLI config
- ☐ Run your first automation: "Summarize my last 7 days of project emails"
- ☐ Share your MCP server with your team

The tools are free. The APIs are documented. The protocol is open. The only thing between you and 10× productivity is an afternoon of coding. Let's build.

---

Original article: https://gianfranco-mileo.com/blog/tpms-build-mcp-server-gsuite-automation  
More articles: https://gianfranco-mileo.com/blog · RSS: https://gianfranco-mileo.com/feed.xml · JSON Feed: https://gianfranco-mileo.com/feed.json · Site context for agents: https://gianfranco-mileo.com/llms.txt
