# MCP Server Suite: Calculator + Gmail Integration A powerful Model Context Protocol (MCP) server suite that combines an advanced calculator with Gmail integration, allowing you to perform complex mathematical calculations and send results via email through Claude Desktop MCP Client. ## 🌟 Features ### Advanced Calculator - 📱 Complex BODMAS (Bracket, Order, Division, Multiplication, Addition, Subtraction) operations - 🧮 Advanced mathematical functions: - Trigonometric functions (sin, cos, tan) - Exponential and logarithmic operations - Square and cube roots - Factorial calculations - Fibonacci sequence generation - ✅ Step-by-step reasoning verification - 📊 Calculation consistency checks ### Gmail Integration - 📧 Send calculation results via email - 📥 Retrieve and read unread emails - 🗑️ Manage emails (mark as read, move to trash) - 🌐 Open emails in browser ## 🏗️ Project Structure ``` MCP-Server-V4-Gmail/ ├── calculator-mcp-server/ # Calculator MCP Server │ ├── math-mcp-server/ │ │ ├── mcp_server.py # Calculator implementation │ │ └── models.py # Data models │ ├── pyproject.toml │ └── README.md └── gmail-mcp-server/ # Gmail MCP Server ├── src/ │ └── gmail/ │ ├── server.py # Gmail integration │ └── __init__.py ├── pyproject.toml └── README.md ``` ## 🚀 Setup & Installation ### Prerequisites - Python 3.12 or higher - Claude Desktop MCP Client - Google Cloud Platform account (for Gmail API) ### 1. Gmail API Setup 1. Create a [new Google Cloud project](https://console.cloud.google.com/projectcreate) 2. Enable the [Gmail API](https://console.cloud.google.com/workspace-api/products) 3. Configure [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent): - Select "external" (no publishing required) - Add your email as a "Test user" 4. Add OAuth scope: `https://www.googleapis.com/auth/gmail/modify` 5. Create [OAuth Client ID](https://console.cloud.google.com/apis/credentials/oauthclient) for "Desktop App" 6. Download and save OAuth credentials JSON file ### 2. Server Installation ```bash # Clone the repository cd MCP-Server-V4-Gmail # Set up Calculator Server cd calculator-mcp-server uv venv uv pip install -r requirements.txt # Set up Gmail Server cd ../gmail-mcp-server uv venv uv pip install -r requirements.txt ``` ### 3. Claude Desktop Configuration Add both servers to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`): ```json { "mcpServers": { "calculator": { "command": "uv", "args": [ "--directory", "[path-to-repo]/calculator-mcp-server", "run", "mcp-server" ] }, "gmail": { "command": "uv", "args": [ "--directory", "[path-to-repo]/gmail-mcp-server", "run", "gmail", "--creds-file-path", "[path-to-credentials]/client_creds.json", "--token-path", "[path-to-tokens]/app_tokens.json" ] } } } ``` ## 💻 Usage 1. **Start Calculator Server:** ```bash cd calculator-mcp-server python math-mcp-server/mcp_server.py ``` 2. **Start Gmail Server:** ```bash cd gmail-mcp-server python src/gmail/server.py --creds-file-path [path]/client_creds.json --token-path [path]/app_tokens.json ``` 3. **Use in Claude Desktop:** - Perform calculations: "Calculate 5 * (3 + 2) - 4 / 2" - Send results: "Send these calculation results to example@email.com" ## 📋 Example Workflow 1. Calculate complex expression: ``` User: Calculate (sin(45) + cos(30)) * sqrt(16) Claude: Let me break this down... [Shows step-by-step calculation] Result: 3.2834... ``` 2. Send results via email: ``` User: Send this result to john@example.com Claude: I'll draft an email with the calculation results... [Shows email draft] Shall I send it? ``` ## 🔒 Security - Gmail API uses OAuth 2.0 for authentication - Tokens are stored securely in specified location - Email operations require explicit user confirmation ## 📝 License MIT License ## 👥 Authors - Calculator Server by Saish Shetty - Gmail Integration by Original Authors