Google Services MCP Server

Google Services MCP Server

Provides access to Google Sheets, Gmail, and Google Calendar through 13 tools that enable reading/writing spreadsheet data, managing emails, and creating/updating calendar events.

Category
访问服务器

README

Google Services MCP Server

MCP (Model Context Protocol) server for Claude Desktop that provides access to Google Sheets, Gmail, and Google Calendar.

Features

  • 13 MCP Tools:
    • Google Sheets (4 tools): Read, write, append, and get sheet info
    • Gmail (4 tools): List, search, get details, and send emails
    • Google Calendar (5 tools): List, create, update, delete, and get event details

Prerequisites

  • Python 3.8 or higher
  • Google Cloud Project with APIs enabled:
    • Google Sheets API
    • Gmail API
    • Google Calendar API
  • OAuth 2.0 credentials (credentials.json)
  • Claude Desktop installed

Installation

1. Clone and Install Dependencies

# Navigate to project directory
cd mcplatestv1

# Install dependencies
pip install -r requirements.txt

2. Setup Google OAuth

  1. Download credentials.json from Google Cloud Console
  2. Place credentials.json in the project root directory
  3. Run the setup script to authenticate:
python src/setup.py
  1. Follow the prompts to authorize access to your Google account
  2. The script will create tokens.json with your access tokens

3. Configure Your Services

Edit config.json:

{
  "google": {
    "clientId": "your-client-id",
    "clientSecret": "your-client-secret",
    "redirectUri": "http://localhost",
    "spreadsheetId": "your-spreadsheet-id",
    "calendarId": "primary"
  }
}

Note: spreadsheetId and calendarId are optional - you can specify them per tool call.

Claude Desktop Setup

Step 1: Find Claude Desktop Config File

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Example: C:\Users\YourName\AppData\Roaming\Claude\claude_desktop_config.json

Mac:

~/Library/Application Support/Claude/claude_desktop_config.json

Linux:

~/.config/Claude/claude_desktop_config.json

Step 2: Edit Config File

Open the config file (create it if it doesn't exist) and add:

{
  "mcpServers": {
    "google-services": {
      "command": "python",
      "args": [
        "D:\\mcplatestv1\\src\\mcp_server.py"
      ],
      "env": {}
    }
  }
}

Important:

  • Update the path to match your actual project location
  • On Windows, use double backslashes (\\) in the path
  • On Mac/Linux, use forward slashes (/)

Step 3: Restart Claude Desktop

Completely quit and restart Claude Desktop for the changes to take effect.

Step 4: Verify Connection

After restarting:

  1. Claude Desktop will automatically start the MCP server
  2. All 13 tools should be available
  3. Test by asking Claude: "What tools do you have access to?"

Usage

Once connected, you can ask Claude to:

  • Read from Sheets: "Read the data from Sheet1!A1:B10"
  • Write to Sheets: "Write these values to my spreadsheet: [['Name', 'Age'], ['John', '30']]"
  • List Emails: "Show me my last 10 emails"
  • Send Email: "Send an email to john@example.com with subject 'Hello' and body 'Test message'"
  • Create Events: "Create a calendar event for tomorrow at 2pm titled 'Meeting'"

Available Tools

Google Sheets

  • read_sheet - Read data from a range
  • write_sheet - Write data to a range
  • append_sheet - Append data to a sheet
  • get_sheet_info - Get spreadsheet information

Gmail

  • list_emails - List emails from inbox
  • get_email_detail - Get detailed email information
  • send_email - Send an email
  • search_emails - Search emails with a query

Google Calendar

  • list_calendar_events - List upcoming events
  • create_calendar_event - Create a new event
  • update_calendar_event - Update an existing event
  • delete_calendar_event - Delete an event
  • get_calendar_event - Get event details

Troubleshooting

Server Won't Start

  1. Check Python path: Make sure Python is in your system PATH

    • Test: Open terminal and type python --version
    • If not found, use full path: "C:\\Python\\python.exe"
  2. Check file path: Verify the path to mcp_server.py is correct

    • Use absolute path in config file
    • Windows: D:\\mcplatestv1\\src\\mcp_server.py
    • Mac/Linux: /path/to/mcplatestv1/src/mcp_server.py
  3. Check dependencies: Make sure all packages are installed

    pip install -r requirements.txt
    

Tools Not Appearing

  1. Check Claude Desktop logs:

    • Look for error messages in Claude Desktop console
    • Check if server process is running
  2. Verify authentication:

    • Make sure tokens.json exists and is valid
    • Re-run python src/setup.py if needed
  3. Restart Claude Desktop:

    • Completely quit (not just close window)
    • Restart and check again

Authentication Errors

  1. Re-authenticate: Run python src/setup.py again
  2. Check credentials: Verify credentials.json is valid
  3. Check scopes: Ensure all required APIs are enabled in Google Cloud Console

Project Structure

mcplatestv1/
├── src/
│   ├── mcp_server.py          # Main MCP server (stdio protocol)
│   ├── google_auth.py         # Google OAuth handling
│   ├── google_sheets.py       # Google Sheets functions
│   ├── google_gmail.py        # Gmail functions
│   ├── google_calendar.py     # Calendar functions
│   ├── agent.py               # Automatic decision logic
│   └── setup.py               # Initial setup script
├── config.json                # Configuration (your credentials)
├── config.example.json        # Configuration template
├── credentials.json           # Google OAuth credentials (download from Cloud Console)
├── tokens.json               # OAuth tokens (generated by setup.py)
├── requirements.txt           # Python dependencies
├── claude_desktop_config.json # Example Claude Desktop config
└── README.md                  # This file

License

This project is for personal use. Make sure to keep your credentials.json and config.json files secure and never commit them to version control.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选