MCP Server Suite: Calculator + Gmail Integration
April 20, 2025 ยท View on GitHub
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
- Create a new Google Cloud project
- Enable the Gmail API
- Configure OAuth consent screen:
- Select "external" (no publishing required)
- Add your email as a "Test user"
- Add OAuth scope:
https://www.googleapis.com/auth/gmail/modify - Create OAuth Client ID for "Desktop App"
- Download and save OAuth credentials JSON file
2. Server Installation
# 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):
{
"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
-
Start Calculator Server:
cd calculator-mcp-server python math-mcp-server/mcp_server.py -
Start Gmail Server:
cd gmail-mcp-server python src/gmail/server.py --creds-file-path [path]/client_creds.json --token-path [path]/app_tokens.json -
Use in Claude Desktop:
- Perform calculations: "Calculate 5 * (3 + 2) - 4 / 2"
- Send results: "Send these calculation results to example@email.com"
๐ Example Workflow
-
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... -
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