{"type":"mcp_server","name":"Gmail-MCP-Server","description":"This repository provides an MCP server for Gmail integration with Claude Desktop, enabling AI assistants to manage Gmail through natural language. It supports email sending, reading, searching, and label management","category":"Communication","language":"JavaScript","stars":1151,"forks":22,"owner":"GongRzhe","github_url":"https://github.com/GongRzhe/Gmail-MCP-Server","homepage":null,"setup":"## Setup\n\n**Installing via Smithery:**\n\n```bash\nnpx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude\n```\n\n**Installing Manually:**\n\n1.  Create a Google Cloud Project and obtain credentials:\n\n    a. Create a Google Cloud Project:\n       - Go to [Google Cloud Console](https://console.cloud.google.com/)\n       - Create a new project or select an existing one\n       - Enable the Gmail API for your project\n\n    b. Create OAuth 2.0 Credentials:\n       - Go to \"APIs & Services\" > \"Credentials\"\n       - Click \"Create Credentials\" > \"OAuth client ID\"\n       - Choose either \"Desktop app\" or \"Web application\" as application type\n       - Give it a name and click \"Create\"\n       - For Web application, add `http://localhost:3000/oauth2callback` to the authorized redirect URIs\n       - Download the JSON file of your client's OAuth keys\n       - Rename the key file to `gcp-oauth.keys.json`\n\n2.  Run Authentication:\n\n    You can authenticate in two ways:\n\n    a. Global Authentication (Recommended):\n    ```bash\n    # First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder\n    mkdir -p ~/.gmail-mcp\n    mv gcp-oauth.keys.json ~/.gmail-mcp/\n\n    # Run authentication from anywhere\n    npx @gongrzhe/server-gmail-autoauth-mcp auth\n    ```\n\n    b. Local Authentication:\n    ```bash\n    # Place gcp-oauth.keys.json in your current directory\n    # The file will be automatically copied to global config\n    npx @gongrzhe/server-gmail-autoauth-mcp auth\n    ```\n\n    The authentication process will:\n    - Look for `gcp-oauth.keys.json` in the current directory or `~/.gmail-mcp/`\n    - If found in current directory, copy it to `~/.gmail-mcp/`\n    - Open your default browser for Google authentication\n    - Save credentials as `~/.gmail-mcp/credentials.json`\n\n    > **Note**:\n    > - After successful authentication, credentials are stored globally in `~/.gmail-mcp/` and can be used from any directory\n    > - Both Desktop app and Web application credentials are supported\n    > - For Web application credentials, make sure to add `http://localhost:3000/oauth2callback` to your authorized redirect URIs\n\n3.  Configure in Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"gmail\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@gongrzhe/server-gmail-autoauth-mcp\"\n      ]\n    }\n  }\n}\n```\n\n**Docker Support:**\n\n1. Authentication:\n```bash\ndocker run -i --rm \\\n  --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \\\n  -v mcp-gmail:/gmail-server \\\n  -e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \\\n  -e \"GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json\" \\\n  -p 3000:3000 \\\n  mcp/gmail auth\n```\n\n2. Usage:\n```json\n{\n  \"mcpServers\": {\n    \"gmail\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"-v\",\n        \"mcp-gmail:/gmail-server\",\n        \"-e\",\n        \"GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json\",\n        \"mcp/gmail\"\n      ]\n    }\n  }\n}\n```","tools":"## Available Tools\n\n1.  Send Email (`send_email`) (Sends a new email immediately.)\n2.  Draft Email (`draft_email`) (Creates a draft email without sending it.)\n3.  Read Email (`read_email`) (Retrieves the content of a specific email by its ID.)\n4.  Search Emails (`search_emails`) (Searches for emails using Gmail search syntax.)\n5.  Modify Email (`modify_email`) (Adds or removes labels from emails.)\n6.  Delete Email (`delete_email`) (Permanently deletes an email.)\n7.  List Email Labels (`list_email_labels`) (Retrieves all available Gmail labels.)","faq":null,"created_at":"2024-12-26T02:58:42+00:00","updated_at":"2025-03-28T21:31:41+00:00","source_url":"https://model-context-protocol.com/servers/gmail-mcp-server-ai-email-management","related_articles":[]}