这是一个模型上下文协议 (MCP) 服务器,提供了与 Gmail 和日历 API 交互的工具。借助该服务器,您能够通过 MCP 接口对电子邮件和日历事件进行编程管理。
本服务器可帮助您通过 MCP 接口对电子邮件和日历事件进行编程管理,以下为您介绍具体的安装和使用方法。
git clone https://github.com/your-repository.git
cd google-workspace-mcp-server
npm install
config.json
文件。{
"google": {
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"refresh_token": "your_refresh_token"
}
}
npm start
以下是一些常见的 Gmail 操作示例:
{
"maxResults": 5,
"query": "is:unread"
}
{
"query": "from:example@gmail.com has:attachment",
"maxResults": 10
}
{
"to": "收件人@example.com",
"subject": "主题",
"body": "邮件正文",
"cc": "抄送@example.com",
"bcc": "密送@example.com"
}
{
"id": "邮件ID",
"addLabels": ["UNREAD"],
"removeLabels": ["INBOX"]
}
{
"maxResults": 10,
"timeMin": "2024-01-01T00:00:00Z",
"timeMax": "2024-12-31T23:59:59Z"
}
{
"summary": "会议标题",
"location": "会议室",
"description": "会议描述",
"start": "2024-01-24T10:00:00Z",
"end": "2024-01-24T11:00:00Z",
"attendees": ["参与者@example.com"]
}
⚠️ 重要提示
- 确保所有 OAuth 2.0 凭证正确配置。
- 检查 Google Cloud Console 中的 API 配额和限制。
认证问题:
API 错误:
此项目根据 MIT 许可证授权。