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 服务器

将 Gmail 与 Claude Desktop 集成的模型上下文协议 (MCP) 服务器,使 Claude 能够访问和理解电子邮件内容,同时保持适当的上下文管理和隐私控制。

特征

  • Gmail API 与 OAuth2 身份验证集成
  • 安全令牌管理和存储
  • 注重隐私的数据处理
  • Claude 的上下文窗口管理
  • 全面的日志记录和错误处理
  • Docker 支持,轻松部署

先决条件

  • Node.js >= 18.0.0
  • npm 或 yarn
  • 已启用 Gmail API 的 Google Cloud 项目
  • 克劳德 API 密钥

设置

  1. 克隆存储库:
git clone https://github.com/yourusername/gmail-mcp-server.git cd gmail-mcp-server
  1. 安装依赖项:
npm install
  1. 在根目录中创建一个.env文件,其中包含以下变量:
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. 启动开发服务器:
npm run dev

发展

  • npm run dev :使用热重载启动开发服务器
  • npm test :运行测试
  • npm run lint :运行 ESLint

项目结构

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

贡献

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

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

集成服务器允许 Claude Desktop 安全地访问和处理 Gmail 内容,同时保持适当的上下文管理和隐私控制。

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