Back to MCP directory
publicPublicdnsLocal runtime

gmail-notes-server

一个基于TypeScript和Gmail API构建的MCP服务器,实现了简单的笔记系统功能,包括笔记资源管理、创建工具和摘要生成提示。

article

README

🚀 Gmail-MCP MCP 服务器

一个基于 TypeScript 和 Gmail API 构建的 Gmail MCP 服务器,此服务器能够展示核心 MCP 概念。它支持使用 note:// URI 和元数据来表示文本笔记资源,还配备了创建新笔记的工具以及生成笔记摘要的提示功能。

🚀 快速开始

Gmail-MCP MCP 服务器是一个强大的工具,可帮助你高效管理笔记资源。下面为你介绍其基本使用步骤。

✨ 主要特性

资源

  • 可列出和访问使用 note:// URI 的笔记。
  • 每个笔记包含标题、内容和元数据。
  • 使用纯文本 MIME 类型提供简单的内容访问。

工具

  • create_note:用于创建新的文本笔记。标题和内容为必填参数,笔记将被存储在服务器状态中。

提示

  • summarize_notes:生成所有存储笔记的摘要。该功能会包括所有笔记内容作为嵌入资源,并返回结构化的提示以供 LLM 进行总结。

📦 安装指南

通过 Smithery 安装

要通过 Smithery 自动安装 Gmail 笔记服务器以供 Claude Desktop 使用,可执行以下命令:

npx -y @smithery/cli install @mundume/gmail-mcp --client claude

手动安装

要与 Claude Desktop 一起使用,请添加服务器配置:

  • 在 MacOS 上:配置文件路径为 ~/Library/Application Support/Claude/claude_desktop_config.json
  • 在 Windows 上:配置文件路径为 %APPDATA%/Claude/claude_desktop_config.json。

配置内容如下:

{
  "mcpServers": {
    "gmail-mcp": {
      "command": "/path/to/gmail-mcp/build/index.js"
    }
  }
}

调试

由于 MCP 服务器通过标准输入输出进行通信,调试可能具有挑战性。我们推荐使用 MCP Inspector,它作为包脚本提供,可执行以下命令:

npm run inspector

Inspector 将提供访问浏览器中的调试工具的 URL。

💻 使用示例

基础用法

以下是安装依赖和构建服务器的命令示例:

# 安装依赖
npm install
# 构建服务器
npm run build

高级用法

带有自动重建功能的开发,可使用以下命令:

npm run watch
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client