@micro-x-ai/mcp-google
v0.1.0
Published
Google MCP server — Gmail, Calendar, and Contacts tools over OAuth2
Maintainers
Readme
@micro-x-ai/mcp-google
Google MCP server providing Gmail, Calendar, and Contacts tools over OAuth2. Works with any MCP-compatible client including Claude Desktop, Claude Code, and the micro-x agent loop.
Install and run
npx -y @micro-x-ai/mcp-googleOn first run, a browser window opens for Google OAuth consent. Tokens are cached locally and refreshed automatically on subsequent runs.
Required environment variables
| Variable | Description |
|----------|-------------|
| GOOGLE_CLIENT_ID | OAuth2 client ID from Google Cloud Console |
| GOOGLE_CLIENT_SECRET | OAuth2 client secret from Google Cloud Console |
Optional environment variables
| Variable | Description | Default |
|----------|-------------|---------|
| GOOGLE_TOKEN_BASE_DIR | Directory for cached OAuth tokens | POSIX: ${XDG_DATA_HOME:-~/.local/share}/mcp-google · Windows: %APPDATA%/mcp-google |
OAuth setup
- Go to Google Cloud Console.
- Create a project (or select an existing one).
- Enable the Gmail API, Google Calendar API, and People API.
- Go to APIs & Services > Credentials > Create Credentials > OAuth client ID.
- Application type: Web application.
- Add
http://127.0.0.1as an authorised redirect URI (the server picks a random port at runtime and appends it). - Copy the client ID and client secret into your environment.
Tools
Gmail
| Tool | Description |
|------|-------------|
| gmail_search | Search Gmail messages by query |
| gmail_read | Read a Gmail message by ID |
| gmail_send | Send an email via Gmail |
Calendar
| Tool | Description |
|------|-------------|
| calendar_list | List upcoming calendar events |
| calendar_create | Create a calendar event |
| calendar_get | Get a calendar event by ID |
Contacts
| Tool | Description |
|------|-------------|
| contacts_search | Search contacts by name or email |
| contacts_list | List contacts |
| contacts_get | Get a contact by resource name |
| contacts_create | Create a new contact |
| contacts_update | Update an existing contact |
| contacts_delete | Delete a contact |
Client configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"google": {
"command": "npx",
"args": ["-y", "@micro-x-ai/mcp-google"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}Claude Code
Add to .mcp.json:
{
"mcpServers": {
"google": {
"command": "npx",
"args": ["-y", "@micro-x-ai/mcp-google"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}micro-x agent loop
Add to config.json under McpServers:
{
"McpServers": {
"google": {
"Command": "npx",
"Args": ["-y", "@micro-x-ai/mcp-google"],
"Env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}Security
- OAuth tokens are cached locally in
GOOGLE_TOKEN_BASE_DIRand are never sent anywhere except Google's APIs. - Tokens include a refresh token — revoke access at any time via Google Account Permissions.
- The OAuth scopes requested are:
gmail.readonly,gmail.send,calendar,contacts.
Flags
| Flag | Description |
|------|-------------|
| --help, -h | Print usage information and exit |
License
MIT
