Skip to main content
Glama
urmi123-ui

Google MCP Server

by urmi123-ui
README.md
# Google MCP Server

A FastAPI-based MCP-style server that integrates with Google Docs and Gmail, requiring terminal approval before executing any action.

## Prerequisites

1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/).
2. Enable the following APIs:
   - Google Docs API
   - Gmail API
3. Create OAuth 2.0 Client ID credentials (Desktop app type).
4. Download the JSON file, rename it to `credentials.json`, and place it in this directory (`google-mcp-server/`).

## Installation

```bash
pip install -r requirements.txt
```

## Running the Server

```bash
python server.py
# or
uvicorn server:app --reload
```

## Usage

### Append to Google Doc
Send a POST request to `/append_to_doc`:
```json
{
    "doc_id": "your_document_id",
    "content": "Text to append\n"
}
```

### Create Gmail Draft
Send a POST request to `/create_email_draft`:
```json
{
    "to": "example@example.com",
    "subject": "Test Draft",
    "body": "This is a test email body."
}
```

The server will prompt for your approval in the terminal before executing any of these actions. Type `y` and press Enter to approve.