{"type":"mcp_server","name":"mcp-headless-gmail","description":"This repository provides a Docker-ready MCP server for headless Gmail access, enabling remote email retrieval and sending without local credentials or browser setup, using decoupled architecture and automatic token refresh.","category":"Communication","language":"Python","stars":55,"forks":3,"owner":"baryhuang","github_url":"https://github.com/baryhuang/mcp-headless-gmail","homepage":null,"setup":"## Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/mcp-headless-gmail.git\n   cd mcp-headless-gmail\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -e .\n   ```\n\n3. Build the Docker image:\n   ```bash\n   docker build -t mcp-headless-gmail .\n   ```\n\n4. Create a new builder instance (if you haven't already):\n   ```bash\n   docker buildx create --use\n   ```\n\n5. Build and push the image for multiple platforms:\n   ```bash\n   docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t buryhuang/mcp-headless-gmail:latest --push .\n   ```\n\n6. Verify the image is available for the specified platforms:\n   ```bash\n   docker buildx imagetools inspect buryhuang/mcp-headless-gmail:latest\n   ```\n\n7. Obtain Google API credentials by going to the Google Cloud Console, creating a new project, enabling the Gmail API, configuring OAuth consent screen, creating OAuth client ID credentials, and saving the client ID and client secret.\n\n8. Use OAuth 2.0 to obtain access and refresh tokens with the scopes `https://www.googleapis.com/auth/gmail.readonly` and `https://www.googleapis.com/auth/gmail.send`.","tools":"## Available Tools\n\n1. Get most recent emails from Gmail (retrieves emails with the first 1k characters of the body).\n2. Get full email body content (retrieves content in 1k chunks using offset parameter).\n3. Send emails through Gmail (sends emails to specified recipients).\n4. Refresh access tokens separately (refreshes access tokens using refresh token, client ID, and client secret).\n5. Automatic refresh token handling (automatically refreshes tokens when they expire).","faq":null,"created_at":"2025-03-20T06:12:47+00:00","updated_at":"2025-03-27T13:09:30+00:00","source_url":"https://model-context-protocol.com/servers/headless-gmail-access-remote-email-server","related_articles":[]}