VS Code Copilot 智能体模式:添加邮件 MCP 服务器

· 4 分钟阅读 · QuickInbox 团队

  • VS Code
  • Copilot
  • MCP

VS Code 中 GitHub Copilot 的智能体模式可以使用 MCP 服务器。加上邮件服务器后,Copilot 就能生成测试地址,并读取你的应用发出的验证码和链接。

第 1 步:创建 .vscode/mcp.json

在你的项目中创建 .vscode/mcp.json,写入下面这段。VS Code 第一次会询问你的 API 密钥并安全保存,所以密钥永远不会出现在文件里:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "quickinbox-key",
      "description": "QuickInbox API key",
      "password": true
    }
  ],
  "servers": {
    "quickinbox": {
      "type": "http",
      "url": "https://quickinbox.net/mcp",
      "headers": { "Authorization": "Bearer ${input:quickinbox-key}" }
    }
  }
}

在文件中点击服务器名称上方的 Start。因为密钥不在文件里,可以放心提交,每位同事输入自己的密钥。

第 2 步:在 Agent 模式中使用

打开 Copilot Chat,切换到 Agent 模式,并确认工具列表中已启用 QuickInbox 工具。然后这样问:

Sign up on http://localhost:5173 with a new QuickInbox address, read the
6-digit code from the email and finish the signup.

想在所有工作区中使用?

在命令面板中运行 MCP: Open User Configuration,把同样的内容粘贴进去。

Copilot 获得的工具

  • quickinbox_generate_test_address:在你的命名空间里生成一个新地址,例如 acme7x.signup-test@quickinbox.net。
  • quickinbox_get_verification:从最新的匹配邮件中找出验证码或链接。
  • quickinbox_get_emails:读取最新的邮件,也可以只看某一个地址。
  • quickinbox_list_namespaces、quickinbox_whoami 和 quickinbox_about:告诉智能体它能用什么。

在 VS Code 里用的是 Claude Code?

Claude Code 扩展使用 Claude Code 自己的设置。在 VS Code 的终端里运行 Claude Code 命令,工具也会出现在那里。

相关指南

试一试:QuickInbox MCP 服务器包含在每个套餐中,包括每月 5,000 封邮件的免费套餐。创建免费账户,生成 API 密钥,两分钟内即可连接你的智能体。

← 全部文章