Google MCP Agent
Allows to read and manage Gmail inbox, including fetching unread, read, and spam emails, and reading full email bodies.
Allows to list enrolled Google Classroom courses.
Allows to read content from Google Docs files as part of the Google Drive integration.
Allows to list files and read content from Google Drive, supporting Google Docs, plain text, and PDF files.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google MCP AgentShow me my unread emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π Google MCP Agent
A unified FastMCP-powered agent that connects Gmail, Google Drive, and Google Classroom with LLM-ready tools for automation, parsing, and intelligent retrieval.
π What This Repo Offers
β Read and manage Gmail (inbox, unread, spam)
β Read file content from Google Drive (Docs, PDFs, TXT)
β List Google Classroom courses
β LLM-compatible tools exposed via FastMCP
β Easily deployable with
uvin an agentic RAG pipeline
Related MCP server: Gmail MCP Server
βοΈ Setup Guide
Before running the project, set up your Google Cloud project for OAuth.
π 1. Enable APIs in Google Cloud Console
Go to GCP Console
Navigate to "APIs & Services" > "OAuth consent screen"
Choose "External" > Fill in app name and support email
Under Scopes, you don't need to add anything manually now
Under Test users, add the Gmail/Drive account you want to access (must match the email you're using)
π§Ύ 2. Create OAuth 2.0 Credentials
Go to "APIs & Services" > "Credentials"
Click "Create Credentials" > "OAuth client ID"
Choose "Desktop App" or "Web App"
Download the
client_creds.jsonfile
π Authentication Info (One-time Manual, Then Persistent)
The first time you run the server, a browser window will open asking you to log in and authorize access.
After successful login, a
token.jsonfile will be created automatically in your local directory.This file contains your OAuth access/refresh token and is reused for future runs.
You wonβt need to re-authenticate unless the token expires or is deleted.
β οΈ No need to publish the app β keeping it in testing mode is fine as long as the user is whitelisted.
π οΈ Configuration Example
Add this block to your msp.json or equivalent MCP config to run the main server:
{
"mcpServers": {
"main_mcp_server": {
"command": "uv",
"args": [
"--directory",
"absolute_path\\to\\current_project",
"run",
"server.py",
"--creds-file-path",
"absolute_path\\to\\client_creds.json",
"--token-path",
"absolute_path\\to\\app_tokens.json"
]
}
}π§° Available Tools (Exposed via FastMCP) These tools are registered with FastMCP and can be used directly by your copilot system or any agent pipeline.
π¬ Gmail Tools πΉ get_unread_emails(limit: int = 5) Returns a list of unread emails from the user's inbox with metadata like subject, sender, and snippet. Automatically marks them as read.
πΉ read_email(email_id: str) Reads and decodes the full plain-text body of a specific email by its ID.
πΉ get_read_emails(limit: int = 50) Fetches recently read (non-unread) emails from the inbox.
πΉ get_spam_emails(limit: int = 20) Retrieves a list of emails from the Gmail spam folder with minimal metadata.
π Google Drive Tools
πΉ list_my_drive_files(limit: int = 10) Returns a list of recent files in the user's Google Drive, including ID, name, MIME type, and last modified time.
πΉ read_file_content(file_id: str) Reads and extracts text from a file in Drive. Supports:
Google Docs (exported as plain text)
Plain .txt files
PDFs (parsed using PyPDF2)
π« Google Classroom Tool πΉ list_courses() Fetches the list of enrolled Google Classroom courses (read-only).
Each tool can be invoked via MCP runtime or LLM-powered interfaces. This setup enables rich, context-aware workflows that interact with the user's real data.
This server cannot be deployed
Maintenance
Related MCP Connectors
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Provides tools for searching Google Workspace documentation and much more.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Google Docs MCP Pack β read, create, and edit Google Docs via OAuth.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail and Google Calendar using the MCP protocol, supporting multiple Google accounts, email management, and calendar operations through natural language.2432MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to interact with Gmail accounts for searching, reading, sending, and managing emails through secure OAuth2 authentication. It provides comprehensive tools for message operations, conversation threads, and account statistics using the FastMCP framework.8-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail and Google Docs via MCP, including email search, read, send, and document read/create operations.-
- AlicenseNot gradedqualityDmaintenanceEnables management of Google Drive files, Docs, Sheets, and Slides through natural language using MCP, with support for file operations, search, and shared drives.6MIT