Gmail MCP server running on a local docker on your PC
1.3K
Create a Google Cloud Project and obtain credentials:
a. Create a Google Cloud Project:
b. Create OAuth 2.0 Credentials:
http://localhost:3000/oauth2callback to the authorized redirect URIsgcp-oauth.keys.jsonRun Authentication:
You can authenticate in two ways:
a. Global Authentication (Recommended):
# First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder
mkdir -p ~/.gmail-mcp
mv gcp-oauth.keys.json ~/.gmail-mcp/
# Run authentication from anywhere
npx @gongrzhe/server-gmail-autoauth-mcp auth
b. Local Authentication:
# Place gcp-oauth.keys.json in your current directory
# The file will be automatically copied to global config
npx @gongrzhe/server-gmail-autoauth-mcp auth
The authentication process will:
gcp-oauth.keys.json in the current directory or ~/.gmail-mcp/~/.gmail-mcp/~/.gmail-mcp/credentials.jsondocker run -i --rm \
--mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
-v mcp-gmail:/gmail-server \
-e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \
-e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" \
-p 3000:3000 \
mcp/gmail auth
Map a common downloads folder between all your MCP server, that they can share fils between the servers
{
"mcpServers": {
"gmail": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"<path to user folder>/.gmail-mcp:/gmail-server",
"-v",
"<path to your downloads folder>:Downloads",
"-e",
"GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json",
"-e",
"GMAIL_OAUTH_PATH=/gmail-server/gcp-oauth.keys.json",
"oswaldslabbert/gmail-mcp"
]
}
}
}
Content type
Image
Digest
sha256:f63d72505…
Size
122.1 MB
Last updated
11 months ago
docker pull oswaldslabbert/gmail-mcp