Gmail MCP C7429127

MCP安全风控

提供方 Linal180

安全风控 未标注 OAuth 授权 社区 / 第三方

一个基于TypeScript构建的生产级Gmail API集成服务器,支持AI代理工具调用,提供完整的Gmail功能。

一句话选型结论

按资料字段整理

Gmail MCP C7429127 属于安全风控类 MCP 服务器,传输方式未标注,OAuth 授权,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类安全风控 传输方式未标注 鉴权OAuth 授权 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 9 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

安全风控
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量9暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

Gmail集成TypeScript本地部署AI代理工具邮件管理OAuth2认证

安装与配置

未标注 OAuth 授权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 9 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 9 个工具,职责相对集中,接入后不容易误操作。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在安全风控场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Gmail MCP C7429127当前 9 未标注 未标注 无 2026-05-17
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

安全风控
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Linal180上游标注的维护方 Linal180
分类安全风控本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

7.8 KB
来自项目仓库与上游目录的原文,未做删改

Gmail MCP Server

A production-ready Model Context Protocol (MCP) server for Gmail API integration, built with TypeScript and designed for AI agent tool calling.

🚀 Features

  • Full Gmail API Integration - Send, read, search, and manage emails
  • OAuth2 Authentication - Secure token-based authentication with automatic refresh
  • 9 Comprehensive Tools - Complete Gmail functionality for AI agents
  • TypeScript Implementation - Type-safe, maintainable code
  • Comprehensive Testing - 83.3% test success rate with edge case handling
  • Rate Limiting - Built-in API rate limiting and error handling
  • Production Ready - Robust error handling and security features

📋 Gmail Tools Available

Tool Description Capabilities
send_email Send emails with attachments Compose, send, CC/BCC support
read_emails Read and list emails Pagination, filtering, metadata
get_email Get specific email details Full email content, headers
search_emails Advanced email search Query-based search, filters
manage_labels Create/delete email labels Label management, organization
manage_threads Thread operations Mark read/unread, archive, delete
manage_drafts Draft email management Create, update, delete drafts
manage_attachments Handle email attachments Download, process attachments
email_actions Bulk email operations Batch actions, automation

🛠️ Prerequisites

  • Node.js 18+
  • npm or yarn
  • Google Cloud Platform account
  • Gmail account

📦 Installation

  1. Clone the repositorybash git clone <repository-url> cd gmail-mcp-server

  2. Install dependenciesbash npm install

  3. Build the projectbash npm run build

🔐 Gmail API Setup

Step 1: Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Note your project ID

Step 2: Enable Gmail API

  1. Navigate to APIs & Services → Library
  2. Search for "Gmail API"
  3. Click Enable

Step 3: Create OAuth2 Credentials

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth client ID
  3. Choose Desktop application
  4. Download the JSON file
  5. Note the client_id and client_secret

Step 4: Configure OAuth Consent Screen

  1. Go to APIs & Services → OAuth consent screen
  2. Choose External user type
  3. Fill in app information:
    - App name: Gmail MCP Server
    - User support email: your-email@gmail.com
    - Developer contact: your-email@gmail.com
  4. Add scopes:
    - https://www.googleapis.com/auth/gmail.readonly
    - https://www.googleapis.com/auth/gmail.send
    - https://www.googleapis.com/auth/gmail.modify
    - https://www.googleapis.com/auth/gmail.compose
  5. Add test users (your email address)
  6. Save configuration

Step 5: Generate Refresh Token

  1. Set environment variables (replace with your values):bash export GMAIL_CLIENT_ID="your-client-id.apps.googleusercontent.com" export GMAIL_CLIENT_SECRET="your-client-secret"

  2. Generate refresh token:bash npm run generate-token

  3. Follow the prompts:
    - Enter your Client ID when prompted
    - Enter your Client Secret when prompted
    - Browser will open for authorization
    - Grant permissions to your Gmail account
    - Copy the authorization code from the URL
    - Paste it back into the terminal
    - Copy the generated GMAIL_REFRESH_TOKEN

  4. Set the refresh token:bash export GMAIL_REFRESH_TOKEN="your-refresh-token"

🚀 Usage

Basic Usage

  1. Set all environment variables:bash export GMAIL_CLIENT_ID="your-client-id.apps.googleusercontent.com" export GMAIL_CLIENT_SECRET="your-client-secret" export GMAIL_REFRESH_TOKEN="your-refresh-token"

  2. Run the server:bash npm start

  3. Test the connection:bash npm test

Example Tool Usage```typescript

// Send an email
const result = await server.execute('send_email', {
to: 'recipient@example.com',
subject: 'Test Email',
body: 'Hello from Gmail MCP Server!',
isHtml: false
});

// Read emails
const emails = await server.execute('read_emails', {
maxResults: 10,
query: 'is:unread'
});

// Search emails
const searchResults = await server.execute('search_emails', {
query: 'from:important@example.com',
maxResults: 5
});


## 🧪 Testing

### Run All Tests```bash
npm test

Run Structure Tests (No Credentials Required)```bash

npm run test:structure


### Watch Mode```bash
npm run test:watch

Expected Test Results

  • ✅ Credential Validation - PASSED
  • ✅ Connection Test - PASSED
  • ✅ Email Sending - PASSED
  • ✅ Email Reading - PASSED
  • ✅ Email Search - PASSED
  • ✅ Thread Management - PASSED
  • ✅ Rate Limiting - PASSED
  • ✅ Edge Cases - PASSED
  • ✅ Error Handling - PASSED

📁 Project Structure```

gmail-mcp-server/
├── src/
│ ├── gmail-true-mcp.ts # Main Gmail MCP server
│ ├── true-json-base.ts # Base MCP server class
│ ├── server-manager.ts # Server management interfaces
│ └── gmail-test.ts # Test suite
├── docs/
│ └── GMAIL_MCP_DOCUMENTATION.md # Detailed API documentation
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file


## 🔧 Configuration

### Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `GMAIL_CLIENT_ID` | OAuth2 client ID from Google Cloud | Yes |
| `GMAIL_CLIENT_SECRET` | OAuth2 client secret from Google Cloud | Yes |
| `GMAIL_REFRESH_TOKEN` | OAuth2 refresh token (generated) | Yes |

### Rate Limiting

The server includes built-in rate limiting:
- **Default**: 100 requests per 100 seconds
- **Configurable**: Adjust in `gmail-true-mcp.ts`
- **Automatic**: Handles Gmail API quotas

## 🛡️ Security

- **OAuth2 Authentication** - Industry-standard secure authentication
- **Token Refresh** - Automatic access token renewal
- **Credential Protection** - Never logs sensitive information
- **Rate Limiting** - Prevents API quota exhaustion
- **Error Handling** - Graceful failure handling

## 📚 Documentation

- **API Reference**: See `docs/GMAIL_MCP_DOCUMENTATION.md`
- **Tool Schemas**: Detailed parameter specifications
- **Error Codes**: Comprehensive error handling guide
- **Examples**: Real-world usage examples

## 🚀 Deployment

### Production Checklist

- [ ] Set up Google Cloud project
- [ ] Configure OAuth consent screen
- [ ] Generate refresh token
- [ ] Set environment variables
- [ ] Run test suite
- [ ] Deploy to your infrastructure

### Environment Setup```bash
# Production environment variables
export GMAIL_CLIENT_ID="your-production-client-id"
export GMAIL_CLIENT_SECRET="your-production-client-secret"
export GMAIL_REFRESH_TOKEN="your-production-refresh-token"
export NODE_ENV="production"

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details

🆘 Support

For issues and questions:
1. Check the documentation
2. Review the test suite
3. Check Google Cloud Console configuration
4. Verify OAuth consent screen setup

🎯 Next Steps

This Gmail MCP Server demonstrates the capability to build enterprise-grade MCP servers for AI agent tool calling. The implementation can be used as a template for building MCP servers for other services like:

  • GitHub API
  • Slack API
  • Notion API
  • Google Drive API
  • And 500+ other services

Built with ❤️ for AI agent integration

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
Gmail MCP C7429127 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Gmail MCP C7429127 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Gmail MCP C7429127 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Gmail MCP C7429127 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Gmail MCP C7429127 能提供哪些能力?

资料显示约 9 个工具;能力标签包括 Gmail集成、邮件管理、TypeScript、AI代理工具。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。