Skip to main content
Glama
davsdevelop

DAVS Gmail MCP Server

by davsdevelop

📧 Gmail AI Assistant with Model Context Protocol (MCP)

This project implements an intelligent assistant capable of interacting directly with a Gmail account using the Model Context Protocol (MCP).

It demonstrates the secure integration of a local LLM (Ollama) with external APIs (Google Workspace), allowing the model to read, summarize, and send emails, as well as consume static resources (PDFs) through dynamic templates, all under a standardized client-server architecture.

🏗️ System Architecture

  • MCP Server (gmail_mcp_server.py): Exposes tools (Tools), static and dynamic resources (Resources / Resource Templates), and predefined prompts to the client. Handles OAuth2 authentication with Google Cloud.

  • MCP Client (client.py): Connects to the MCP server, discovers available capabilities, and dynamically formats them so the language model (Llama 3.1) can use them as Function Calling.

  • Graphical Interface (app.py): Interactive application built with Streamlit that manages conversation history, renders dynamic UI components based on the server response, and facilitates the use of quick prompts.

  • Security: Strict credential handling. Authentication is performed locally, and session tokens are kept in the runtime environment, with no external exposure.

✨ Agent Capabilities

  • Tools: list_emails (Search and filtering) and send_email (Composition and sending).

  • Resources: Access to the user's Gmail profile.

  • Resource Templates: Reading and injecting context from local PDF manuals (e.g. docs://setup-manual/{version}) directly into the LLM context.

  • Prompts: Pre-built flows for daily summaries and professional email composition.

🚀 Installation and Configuration

Prerequisites

  • Python 3.10+

  • Ollama installed with the llama3.1 model.

  • A Google Cloud Platform (GCP) account.

1. Google Credentials Configuration (Required)

For security reasons, this repository does not include access credentials. You must generate your own:

  1. Go to Google Cloud Console.

  2. Create a new project and enable the Gmail API.

  3. Configure the OAuth consent screen (Add your email as a test user).

  4. Create credentials of type OAuth client ID (Desktop application).

  5. Download the JSON file, rename it to credentials.json, and place it in the root of this project.

2. Running the Environment

# Clonar repositorio
git clone [https://github.com/tu-usuario/gmail-mcp-server.git](https://github.com/tu-usuario/gmail-mcp-server.git)
cd gmail-mcp-server

# Crear entorno virtual e instalar dependencias
python -m venv venv
source venv/bin/activate  # En Windows: venv\Scripts\activate
pip install -r requirements.txt

# Iniciar la interfaz gráfica
streamlit run app.py
-
license - not tested
-
quality - not tested
C
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 Connectors

  • StremAI MCP: shared memory for AI coding agents. Connected agents can recall. OAuth + local stdio.

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • AI-powered medical document management for cancer patients. Google Drive, Gmail, Calendar 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/davsdevelop/DAVS-gmail-mcp-server'

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