Gmail MCP Server

MIT License

Integrations

  • Provides access to email content from Gmail accounts using OAuth2 authentication, allowing Claude to read and understand emails while maintaining context and privacy controls.

  • Integrates with Google Cloud Project for Gmail API access, handling authentication and token management for secure access to email data.

Gmail MCP Server

A Model Context Protocol (MCP) server that integrates Gmail with Claude Desktop, enabling Claude to access and understand email content while maintaining proper context management and privacy controls.

Features

  • Gmail API integration with OAuth2 authentication
  • Secure token management and storage
  • Privacy-focused data handling
  • Context window management for Claude
  • Comprehensive logging and error handling
  • Docker support for easy deployment

Prerequisites

  • Node.js >= 18.0.0
  • npm or yarn
  • Google Cloud Project with Gmail API enabled
  • Claude API key

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/gmail-mcp-server.git cd gmail-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following variables:
GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_REDIRECT_URI=http://localhost:3000/auth/google/callback CLAUDE_API_KEY=your_claude_api_key PORT=3000
  1. Start the development server:
npm run dev

Development

  • npm run dev: Start the development server with hot reloading
  • npm test: Run tests
  • npm run lint: Run ESLint

Project Structure

gmail-mcp-server/ ├── src/ │ ├── server.js # Main server entry point │ ├── auth.js # Authentication handling │ ├── gmail.js # Gmail API integration │ ├── claude.js # Claude API integration │ ├── logger.js # Logging configuration │ └── utils/ # Utility functions ├── tests/ # Test files ├── .env # Environment variables ├── .gitignore # Git ignore rules ├── package.json # Project dependencies └── README.md # Project documentation

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

-
security - not tested
A
license - permissive license
-
quality - not tested

An integration server that allows Claude Desktop to securely access and process Gmail content while maintaining proper context management and privacy controls.

  1. Features
    1. Prerequisites
      1. Setup
        1. Development
          1. Project Structure
            1. Contributing
              1. License
                ID: 89f8mrxo7p