
ayush-k-shukla/gmail-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Implementation of a Gmail MCP server with RAG support
Обзор
This MCP server integrates with Gmail APIs to list, delete, summarize, and send emails and labels. - Ensure you have Node.js (v18 or higher recommended) and npm installed. Download Node.js - If you want to use RAG features, install Docker: Get Docker - Create a Google Cloud project - Enable the Gmail API - Configure an OAuth consent screen - If have workspace account then make it private - Otherwise set some test users (emails against which want to test) to test before app is verified. - Create an OAuth Client ID for application type "Web App" - Download the JSON file of your client's OAuth keys - Rename the key file to gcp-oauth-keys.json and place into the root of the repo. - Run npm install from the root directory to install all required dependencies. 1. - Run npm run build from the root repo directory. 2. - Run node dist/mcp.
README
Показан фрагмент оригинального README. Открыть оригинал.
Gmail MCP server
This MCP server integrates with Gmail APIs to list, delete, summarize, and send emails and labels.
Prerequisites
- Node.js & npm: Ensure you have Node.js (v18 or higher recommended) and npm installed. Download Node.js
- Docker (for RAG/Chroma DB): If you want to use RAG features, install Docker: Get Docker
Getting started
Setup Google cloud project
- Create a Google Cloud project
- Enable the Gmail API
- Configure an OAuth consent screen
- If have workspace account then make it private
- Otherwise set some test users (emails against which want to test) to test before app is verified.
- Create an OAuth Client ID for application type “Web App”
- Download the JSON file of your client’s OAuth keys
- Rename the key file to
gcp-oauth-keys.jsonand place into the root of the repo.
Install dependencies
- Run
npm installfrom the root directory to install all required dependencies.
How to Run
- Build the project:
- Run
npm run buildfrom the root repo directory.
- Run
- Authenticate:
- Run
node dist/mcp.js auth - This will open an authentication flow in your system browser
- Note down the token generated is only valid for
1 hrso relogin if get any error likeError: No refresh token is set. - Credentials will be saved in the root of this repo with file name
gmail-server-credentials.json
- Run
MCP Server Configuration Examples
VS Code settings.json
To use this server in VS Code, add the following to your settings.json:
{
"mcpServers": {
"gmail-mcp-server": {
"type": "stdio",
"command": "node",
"args": [""],
"env": {
"GMAIL_OAUTH_PATH": "",
"ENABLE_RAG": "false" // mark as true if want to use rag
}
}
}
}
Claude Desktop claude_desktop_config.json
To use this server in Claude Desktop, add the following to your claude_desktop_config.json:
{
"mcpServers": {
"gmail-mcp-server": {
"type": "stdio",
"command": "node",
"args": [""],
"env": {
"GMAIL_OAUTH_PATH": "",
"ENABLE_RAG": "false" // mark as true if want to use rag
}
}
}
}
Replace the placeholders (``) with the actual full paths on your system for clarity and reliability.
Environment Variables
GMAIL_OAUTH_PATH: Absolute path to your Gmail OAuth credentials JSON file (e.g.,gmail-server-credentials.json).
Установка
docker run -v ./chroma-data:/data -p 8000:8000 chromadb/chromaКонфигурация
{
"mcpServers": {
"gmail-mcp-server": {
"type": "stdio",
"command": "node",
"args": ["<absolute path to dist/mcp.js>"],
"env": {
"GMAIL_OAUTH_PATH": "<absolute path to gmail-server-credentials.json>",
"ENABLE_RAG": "false" // mark as true if want to use rag
}
}
}
}