| Crates.io | gmail-mcp-server |
| lib.rs | gmail-mcp-server |
| version | 0.1.1 |
| created_at | 2025-05-24 13:01:28.184354+00 |
| updated_at | 2025-05-24 13:05:02.721717+00 |
| description | A clean, simplified MCP server for Gmail integration built with Rust |
| homepage | https://github.com/RustSandbox/gmail_MCP |
| repository | https://github.com/RustSandbox/gmail_MCP |
| max_upload_size | |
| id | 1687398 |
| size | 105,338 |
A clean, simplified Model Context Protocol (MCP) server for Gmail integration. Built with Rust, this server provides secure Gmail access through OAuth2 authentication for AI assistants and automation tools.
๐ Rust Learning Exercise: This project serves as a hands-on exercise in my journey of learning Rust programming. It demonstrates practical application of Rust concepts including async programming, error handling, OAuth2 implementation, and clean code architecture.
๐ Inspired by Rig Framework: This implementation replicates and adapts examples from the excellent Rig framework by 0xPlaygrounds. Rig is a powerful Rust framework for building portable, modular & lightweight AI agents with support for multiple LLM providers and vector stores. This Gmail MCP server was built as a learning exercise based on Rig's patterns and architecture.
This server implements the Model Context Protocol (MCP) to provide Gmail functionality:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ AI Assistant โโโโโบโ Gmail MCP Server โโโโโบโ Gmail API โ
โ (Claude, etc) โ โ (This Project) โ โ (Google) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
client_secret.json)Clone & Build
git clone https://github.com/RustSandbox/gmail_MCP.git
cd gmail_MCP
cargo build --release
Configure Gmail API
client_secret.json in project rootRun Server
cargo run
Server starts on http://localhost:3003/sse
The server provides a single tool:
gmail_reader - Read Gmail emails
action (string): Action to perform ("read")max_results (number, optional): Max emails to fetch (1-500, default: 10)No environment variables needed! The server uses:
client_secret.json - OAuth2 credentials (required)token_cache.json - Generated automatically after first authtoken_cache.json to re-authenticatesrc/
โโโ main.rs # MCP server setup and tool registration
โโโ lib.rs # Gmail API integration and OAuth2
โโโ reademail.rs # Email processing and URL cleanup
โโโ Cargo.toml # Dependencies and metadata
Clean Code Principles Applied:
cargo test
cargo clippy
cargo fmt
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ and ๐ฆ Rust