A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
MCP server for Gmail, Google Calendar, and Google Drive integration using fastmcp. Supports multiple accounts, email man
MCP server to interact with Google products, rewritten using the fastmcp library.
This project is a fork of mcp-gsuite.
Right now, this MCP server supports Gmail and Calendar integration with the following capabilities:
Example prompts you can try:
Retrieve my latest unread messages
Search my emails from the Scrum Master
Retrieve all emails from accounting
Take the email about ABC and summarize it
Write a nice response to Alice's last email and upload a draft.
Reply to Bob's email with a Thank you note. Store it as draft
What do I have on my agenda tomorrow?
Check my private account's Family agenda for next week
I need to plan an event with Tim for 2hrs next week. Suggest some time slots.
The easiest way to set up authentication is using the interactive setup command:
# Install the package
pip install fastmcp-gsuite
# or with uv
uv pip install fastmcp-gsuite
# Run interactive setup
uv run fastmcp-gsuite-setup
Prerequisites:
The setup wizard will guide you through:
Additional Commands:
# Add another Google account
uv run fastmcp-gsuite-setup --add-account
# List configured accounts
uv run fastmcp-gsuite-setup --list
# Remove an account
uv run fastmcp-gsuite-setup --remove-account user@example.com
Google Workspace (G Suite) APIs require OAuth2 authorization. Follow these steps to set up authentication manually:
Create OAuth2 Credentials:
urn:ietf:wg:oauth:2.0:oob will be used automaticallyRequired OAuth2 Scopes:
[
"openid",
"https://mail.google.com/",
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/userinfo.email"
]
.gauth.json in your working directory:{
"installed": {
"client_id": "$your_client_id",
"client_secret": "$your_client_secret",
"redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
}
}
Note:
"installed" for Desktop app credentials (recommended)"web" format also works with this libraryurn:ietf:wg:oauth:2.0:oob is the Out-of-Band (OOB) redirect URI.accounts.json file with account information:{
"accounts": [
{
"email": "alice@bob.com",
"account_type": "personal",
"extra_info": "Additional info that you want to tell Claude: E.g. 'Contains Family Calendar'"
}
]
}
You can specify 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).
# Set environment variables
export GOOGLE_ACCOUNT_EMAIL="your-email@example.com"
export GOOGLE_CLIENT_ID="your-client-id"
export GOOGLE_CLIENT_SECRET="your-client-secret"
# Run the script
uv run python scripts/get_refresh_token.py
This will open a browser for authorization and create .oauth2.{email}.json credential files.
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"gsuite": {
"command": "uv",
"args": [
"--directory",
"<dir_to>/fastmcp-gsuite",
"run",
"fastmcp-gsuite"
]
}
}
}
Note: Configuration is now primarily handled via environment variables or a .env file in the working directory, using pydantic-settings . See the Configuration Options section below.
{
"mcpServers": {
"fastmcp-gsuite": {
"command": "uv",
"args": [
"--directory",
"<dir_to>/fastmcp-gsuite",
"run",
"fastmcp-gsuite" # Use the new entry point
# Configuration via .env or environment variables is preferred now
]
}
}
}
{
"mcpServers": {
"fastmcp-gsuite": {
"command": "uvx",
"args": [
"fastmcp-gsuite" # Use the new entry point
# Configuration via .env or environment variables is preferred now
]
}
}
}
.env file or Environment Variables)Configuration is now managed using pydantic-settings . Create a .env file in the directory where you run the server, or set environment variables:
GAUTH_FILE: Path to the .gauth.json file containing OAuth2 client configuration. Default: ./.gauth.jsonACCOUNTS_FILE: Path to the .accounts.json file containing Google account information. Default: ./.accounts.jsonCREDENTIALS_DIR: Directory to store the generated .oauth2.{email}.json credential files. Default: . (current directory)Example .env file:
GAUTH_FILE=/path/to/your/.gauth.json
ACCOUNTS_FILE=/path/to/your/.accounts.json
CREDENTIALS_DIR=/path/to/your/credentials
This allows for flexible configuration without command-line arguments when running the server.
Problem: "No refresh token received"
Problem: "Browser doesn't open automatically"
Problem: "Redirect URI mismatch" error
urn:ietf:wg:oauth:2.0:oob as the redirect URIProblem: "Permission denied when creating .gauth.json"
GAUTH_FILE environment variable to specify a different locationProblem: "Account already exists" when adding account
--remove-account to remove the old account first, or choose to overwrite when promptedProblem: Setup works but MCP server can't find credentials
GAUTH_FILE, ACCOUNTS_FILE, and CREDENTIALS_DIR environment variables to point to the correct locationsFor more help, see the GitHub Issues.
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/ directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token or UV_PUBLISH_TOKEN--username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORDThis project is configured to automatically publish to PyPI when a tag is pushed to the repository. The publishing process is handled by a GitHub Actions workflow.
To publish a new version:
pyproject.tomlv0.4.2)# Example workflow to release a new version
git add pyproject.toml
git commit -m "Bump version to 0.4.2"
git tag -a v0.4.2 -m "Version 0.4.2"
git push && git push --tags
The GitHub Actions workflow will automatically build and publish the package to PyPI. Make sure to set the following secrets in your GitHub repository:
PYPI_API_TOKEN: Your PyPI API tokenYou can also use the version bumping commands in the Makefile:
# Bump patch version (0.4.1 -> 0.4.2)
make bump-patch
# Bump minor version (0.4.1 -> 0.5.0)
make bump-minor
# Bump major version (0.4.1 -> 1.0.0)
make bump-major
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory /path/to/fastmcp-gsuite run fastmcp-gsuite
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
You can also watch the server logs with this command:
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-fastmcp-gsuite.log # Log filename might change based on the server name
To run the standard E2E tests, you need to set up the necessary environment variables with valid Google credentials:
# Make sure valid Google credentials are set in your environment variables
dotenvx run -f .env.local -- uv run make e2e-tests
These tests use the Google API libraries directly to authenticate and test the functionality.
There are also MCP-based E2E tests that test the functionality through the MCP protocol, simulating how Claude or other clients would interact with the MCP server:
# Specify the environment file containing your Google credentials
make mcp-e2e-tests ENV_FILE=.env.local
This will run tests that:
The environment file should contain the following variables:
GSUITE_CREDENTIALS_JSON - Base64 encoded JSON credentialsGOOGLE_ACCOUNT_EMAIL - Your Google account emailGOOGLE_PROJECT_ID - Your Google Cloud project IDGOOGLE_CLIENT_ID - Your OAuth client IDGOOGLE_CLIENT_SECRET - Your OAuth client secretBoth types of E2E tests are excluded from CI pipelines and should only be run locally with valid credentials.
This project implements end-to-end (E2E) tests using real Google accounts. You can run the E2E tests using the following steps.
To run E2E tests, you need:
A .env.local file with the following environment variables:
GSUITE_CREDENTIALS_JSON : Base64 encoded Google credentialsGOOGLE_ACCOUNT_EMAIL : Google account email for testingGOOGLE_PROJECT_ID : Google project IDGOOGLE_CLIENT_ID : Google client IDGOOGLE_CLIENT_SECRET : Google client secretE2E test dependencies installed:
uv pip install -e ".[e2e]"
dotenvx run -f .env.local -- uv run make mcp-all-e2e-tests
# Gmail tests
dotenvx run -f .env.local -- uv run make mcp-e2e-tests
# Google Calendar tests
dotenvx run -f .env.local -- uv run make mcp-google-e2e-tests
# Google Drive tests
dotenvx run -f .env.local -- uv run make mcp-gdrive-e2e-tests
# Google Tasks tests
dotenvx run -f .env.local -- uv run make mcp-tasks-e2e-tests
# Google Contacts tests
dotenvx run -f .env.local -- uv run make mcp-contacts-e2e-tests
MCP server integration for DaVinci Resolve Studio
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots