Skip to main content
Glama
TaiVo1905

Google Workspace MCP Server

by TaiVo1905

๐Ÿค– Google Workspace MCP + Telegram AI Agent

A comprehensive learning project focused on exploring and applying modern AI Agent technologies, specifically integrating the Model Context Protocol (MCP) with Google Gemini API and a Telegram Bot.

This project transforms your Telegram into a smart, personal AI Assistant capable of engaging in natural language conversations and directly operating across your entire Google Workspace ecosystem (Gmail, Calendar, Sheets, Docs, Drive).


๐ŸŽฏ Learning Objectives

This project is meticulously designed to help you practice and understand the following core concepts:

  1. Agentic AI & Tool Calling: Understanding how a Large Language Model (Gemini) analyzes user intent and autonomously decides to invoke external tools to accomplish complex tasks.

  2. Model Context Protocol (MCP): Learning the latest open standard (from Anthropic/Google) that standardizes how AI models connect to external data sources and tools.


Related MCP server: mcp-google-calendar

๐Ÿ—๏ธ Tech Stack

Built with a modern, lightweight, and type-safe technology stack:

Layer

Technology

Purpose

AI Brain

Google Gemini (@google/generative-ai)

Blazing-fast LLM Engine (gemini-3.1-flash-lite) responsible for Natural Language Understanding and Tool Calling.

Tool Protocol

MCP SDK v2.0 (@modelcontextprotocol/server)

Defining and registering tools adhering to industry-standard protocols.

Chat Interface

grammY (grammy)

A robust Telegram Bot framework secured via an ALLOWED_USER_IDS whitelist.

Integrations

Google APIs (googleapis)

Native interaction with Gmail, Calendar, Sheets, Drive, and Docs.

Validation

Zod (zod)

Type-safe schema validation ensuring valid input data for MCP tools.

Runtime

Node.js + TypeScript (tsx)

Executing ES Modules natively without complex build steps.


๐Ÿš€ How It Works (The Concept)

  1. User Request: You send a message via Telegram (e.g., "Find my free slots next week and schedule a team sync").

  2. Bot Middleware: The Telegram bot receives the message, validates your identity against the ALLOWED_USER_IDS whitelist, and forwards it to the AI Agent.

  3. Multi-Turn Tool Calling Loop:

    • Gemini deduces the intent and issues a function call to get_calendar_events.

    • The Agent executes the tool via the MCP Server registry.

    • The MCP Server authenticates with Google via OAuth tokens and makes the respective Google API request.

    • The calendar data is returned to Gemini.

    • Gemini analyzes the data, calls find_free_slots, and subsequently calls create_calendar_event to book the meeting.

  4. Final Response: The AI Agent synthesizes the results and sends a final, human-readable response back to you on Telegram.


๐Ÿ“ฆ 13 Built-in MCP Tools

This project abstracts complex Google APIs into 13 LLM-friendly MCP tools:

  • ๐Ÿ“ง Gmail: get_unread_emails, search_emails, get_email_detail, draft_email, send_email.

  • ๐Ÿ“… Calendar: get_calendar_events, find_free_slots, create_calendar_event, update_calendar_event.

  • ๐Ÿ“Š Sheets: read_sheet, append_sheet_row.

  • ๐Ÿ“ Drive/Docs: search_drive_files, read_doc_content.


โš™๏ธ Setup Instructions

1. Prerequisites

  • Node.js 20+

  • A Google Cloud Project (with Gmail, Calendar, Sheets, Docs, and Drive APIs enabled).

  • OAuth 2.0 Client ID (configured as a Desktop Application).

  • Telegram Bot Token (obtained from @BotFather).

  • Gemini API Key.

2. Environment Configuration

Copy the environment template and fill in your details:

cp .env.example .env

Provide your OAuth Client credentials, Bot Token, Gemini API Key, andโ€”most importantlyโ€”your ALLOWED_USER_IDS (your Telegram User ID to prevent unauthorized access).

3. Install Dependencies

npm install

4. Run the Project

npm run dev

During the initial startup, the system will open a browser window requesting Google account authorization. Your OAuth credentials will be securely saved locally in credentials/tokens.json.


๐Ÿ“œ License

This project was built for educational and personal use. Please keep your .env and tokens.json files strictly confidential.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.

  • Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TaiVo1905/google-workspace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server