MCP server to interact with Google products. Right now, this MCP server supports Gmail and Calendar integration with the following capabilities: Multiple google accounts Get your Gmail user information Query emails with flexible search (e.g., unread, from specific senders, date ranges, with attachments) Retrieve complete email content by ID Create new draft emails with recipients, subject, body an
Add this skill
npx mdskills install MarkusPfundstein/mcp-gsuiteComprehensive Gmail and Calendar MCP server with excellent OAuth2 setup documentation and multi-account support
1# mcp-gsuite MCP server23[](https://smithery.ai/server/mcp-gsuite)4MCP server to interact with Google products.56## Example prompts78Right now, this MCP server supports Gmail and Calendar integration with the following capabilities:9101. General11* Multiple google accounts12132. Gmail14* Get your Gmail user information15* Query emails with flexible search (e.g., unread, from specific senders, date ranges, with attachments)16* Retrieve complete email content by ID17* Create new draft emails with recipients, subject, body and CC options18* Delete draft emails19* Reply to existing emails (can either send immediately or save as draft)20* Retrieve multiple emails at once by their IDs.21* Save multiple attachments from emails to your local system.22233. Calendar24* Manage multiple calendars25* Get calendar events within specified time ranges26* Create calendar events with:27 + Title, start/end times28 + Optional location and description29 + Optional attendees30 + Custom timezone support31 + Notification preferences32* Delete calendar events3334Example prompts you can try:3536* Retrieve my latest unread messages37* Search my emails from the Scrum Master38* Retrieve all emails from accounting39* Take the email about ABC and summarize it40* Write a nice response to Alice's last email and upload a draft.41* Reply to Bob's email with a Thank you note. Store it as draft4243* What do I have on my agenda tomorrow?44* Check my private account's Family agenda for next week45* I need to plan an event with Tim for 2hrs next week. Suggest some time slots.4647## Quickstart4849### Install5051### Installing via Smithery5253To install mcp-gsuite for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-gsuite):5455```bash56npx -y @smithery/cli install mcp-gsuite --client claude57```5859#### Oauth 26061Google Workspace (G Suite) APIs require OAuth2 authorization. Follow these steps to set up authentication:62631. Create OAuth2 Credentials:64 - Go to the [Google Cloud Console](https://console.cloud.google.com/)65 - Create a new project or select an existing one66 - Enable the Gmail API and Google Calendar API for your project67 - Go to "Credentials" → "Create Credentials" → "OAuth client ID"68 - Select "Desktop app" or "Web application" as the application type69 - Configure the OAuth consent screen with required information70 - Add authorized redirect URIs (include `http://localhost:4100/code` for local development)71722. Required OAuth2 Scopes:737475```json76 [77 "openid",78 "https://mail.google.com/",79 "https://www.googleapis.com/auth/calendar",80 "https://www.googleapis.com/auth/userinfo.email"81 ]82```83843. Then create a `.gauth.json` in your working directory with client8586```json87{88 "web": {89 "client_id": "$your_client_id",90 "client_secret": "$your_client_secret",91 "redirect_uris": ["http://localhost:4100/code"],92 "auth_uri": "https://accounts.google.com/o/oauth2/auth",93 "token_uri": "https://oauth2.googleapis.com/token"94 }95}96```97984. Create a `.accounts.json` file with account information99100```json101{102 "accounts": [103 {104 "email": "alice@bob.com",105 "account_type": "personal",106 "extra_info": "Additional info that you want to tell Claude: E.g. 'Contains Family Calendar'"107 }108 ]109}110```111112You can specifiy multiple accounts. Make sure they have access in your Google Auth app. The `extra_info` field is especially interesting as you can add info here that you want to tell the AI about the account (e.g. whether it has a specific agenda)113114Note: When you first execute one of the tools for a specific account, a browser will open, redirect you to Google and ask for your credentials, scope, etc. After a successful login, it stores the credentials in a local file called `.oauth.{email}.json` . Once you are authorized, the refresh token will be used.115116#### Claude Desktop117118On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`119120On Windows: `%APPDATA%/Claude/claude_desktop_config.json`121122<details>123 <summary>Development/Unpublished Servers Configuration</summary>124125126```json127{128 "mcpServers": {129 "mcp-gsuite": {130 "command": "uv",131 "args": [132 "--directory",133 "<dir_to>/mcp-gsuite",134 "run",135 "mcp-gsuite"136 ]137 }138 }139}140```141142143Note: You can also use the `uv run mcp-gsuite --accounts-file /path/to/custom/.accounts.json` to specify a different accounts file or `--credentials-dir /path/to/custom/credentials` to specify a different credentials directory.144145```json146{147 "mcpServers": {148 "mcp-gsuite": {149 "command": "uv",150 "args": [151 "--directory",152 "<dir_to>/mcp-gsuite",153 "run",154 "mcp-gsuite",155 "--accounts-file",156 "/path/to/custom/.accounts.json",157 "--credentials-dir",158 "/path/to/custom/credentials"159 ]160 }161 }162}163```164165</details>166167<details>168 <summary>Published Servers Configuration</summary>169170171```json172{173 "mcpServers": {174 "mcp-gsuite": {175 "command": "uvx",176 "args": [177 "mcp-gsuite",178 "--accounts-file",179 "/path/to/custom/.accounts.json",180 "--credentials-dir",181 "/path/to/custom/credentials"182 ]183 }184 }185}186```187188</details>189190### Configuration Options191192The MCP server can be configured with several command-line options to specify custom paths for authentication and account information:193194* `--gauth-file`: Specifies the path to the `.gauth.json` file containing OAuth2 client configuration. Default is `./.gauth.json`.195* `--accounts-file`: Specifies the path to the `.accounts.json` file containing information about the Google accounts. Default is `./.accounts.json`.196* `--credentials-dir`: Specifies the directory where OAuth credentials are stored after successful authentication. Default is the current working directory with a subdirectory for each account as `.oauth.{email}.json`.197198These options allow for flexibility in managing different environments or multiple sets of credentials and accounts, especially useful in development and testing scenarios.199200Example usage:201202```bash203uv run mcp-gsuite --gauth-file /path/to/custom/.gauth.json --accounts-file /path/to/custom/.accounts.json --credentials-dir /path/to/custom/credentials204```205206This configuration is particularly useful when you have multiple instances of the server running with different configurations or when deploying to environments where the default paths are not suitable.207208## Development209210### Building and Publishing211212To prepare the package for distribution:2132141. Sync dependencies and update lockfile:215216```bash217uv sync218```2192202. Build package distributions:221222```bash223uv build224```225226This will create source and wheel distributions in the `dist/` directory.2272283. Publish to PyPI:229230```bash231uv publish232```233234Note: You'll need to set PyPI credentials via environment variables or command flags:235* Token: `--token` or `UV_PUBLISH_TOKEN`236* Or username/password: `--username`/`UV_PUBLISH_USERNAME` and `--password`/`UV_PUBLISH_PASSWORD`237238### Debugging239240Since MCP servers run over stdio, debugging can be challenging. For the best debugging241experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).242243You can launch the MCP Inspector via [ `npm` ](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:244245```bash246npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-gsuite run mcp-gsuite247```248249Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.250251You can also watch the server logs with this command:252253```bash254tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-gsuite.log255```256
Full transparency — inspect the skill content before installing.