Yahoo Mail MCP Server

Yahoo Mail MCP Server

Enables reading, searching, composing, and managing Yahoo Mail emails via IMAP with OAuth support for both local and remote MCP clients.

Category
访问服务器

README

Yahoo Mail MCP Server

Yahoo Mail MCP server for Claude and other MCP clients.

This server supports two modes:

  • stdio + Yahoo app password for local desktop use
  • sse + delegated Yahoo OAuth for remote Claude connector use

The remote OAuth flow is the important part here: the user connects your MCP URL in Claude, Claude starts MCP OAuth, your server redirects the user to Yahoo consent, Yahoo redirects back to your server, and your server finishes the MCP OAuth flow back to Claude. The user never has to paste a Yahoo app password into Claude.

What’s included

  • Yahoo IMAP access with OAuth-backed remote auth
  • MCP OAuth endpoints for remote connector login
  • Yahoo consent redirect flow
  • IMAP XOAUTH2 login for per-user mailbox access
  • UID-based email operations
  • Tools:
    • list_emails
    • read_email
    • search_emails
    • list_folders
    • delete_emails
    • archive_emails
    • mark_as_read
    • mark_as_unread
    • flag_emails
    • unflag_emails
    • move_emails
    • draft_email

Auth model

1. Local mode

Use this when running through stdio.

  • Requires YAHOO_EMAIL
  • Requires YAHOO_APP_PASSWORD

2. Remote Claude connector mode

Use this when hosting the server over HTTP/SSE.

  • Requires YAHOO_CLIENT_ID
  • Requires YAHOO_CLIENT_SECRET
  • User signs into Yahoo in the browser
  • User grants Yahoo Mail permissions
  • Claude receives MCP access/refresh tokens from this server
  • This server stores Yahoo refresh/access tokens in memory and uses IMAP XOAUTH2

Important production note

Current token/session storage is in-memory.

That means:

  • reconnect is required after process restart or redeploy
  • multi-instance deployments need a shared store like Redis or a database

If you want true long-lived production sessions across deploys, move:

  • pendingYahooAuthorizations
  • mcpAuthCodes
  • mcpAccessTokens
  • mcpRefreshTokens
  • yahooSessions

into a persistent shared store.

Yahoo app setup

Create a Yahoo developer app and enable the permissions your server needs.

Recommended permissions:

  • OpenID Email
  • OpenID Profile (optional but useful)
  • Yahoo Mail read access
  • Yahoo Mail write access

Default requested scopes in this server:

YAHOO_SCOPES="openid email"

If Yahoo requires approval for restricted mail scopes on your app, complete that in Yahoo Developer first.

Your Yahoo callback URL should point to:

https://your-domain.com/oauth/callback

For local testing:

http://localhost:3000/oauth/callback

Environment variables

Remote OAuth mode

TRANSPORT_MODE=sse
PORT=3000

YAHOO_CLIENT_ID=your-yahoo-client-id
YAHOO_CLIENT_SECRET=your-yahoo-client-secret
YAHOO_SCOPES=openid email

# Optional but recommended behind proxies/platforms
PUBLIC_BASE_URL=https://your-domain.com

Local stdio mode

TRANSPORT_MODE=stdio

YAHOO_EMAIL=your.email@yahoo.com
YAHOO_APP_PASSWORD=your-yahoo-app-password

Quick start

npm install
cp .env.example .env

Run local stdio mode

npm run start:stdio

Run remote SSE mode

npm run start:sse

Claude remote connector setup

After deploying the server:

  1. Deploy this repo on Render
  2. In Render environment variables, set:
TRANSPORT_MODE=sse
PUBLIC_BASE_URL=https://your-render-service.onrender.com
YAHOO_CLIENT_ID=...
YAHOO_CLIENT_SECRET=...
YAHOO_SCOPES=openid email
  1. Add the remote MCP URL in Claude
  2. Use your SSE endpoint:
https://your-domain.com/mcp/sse
  1. Claude discovers the MCP auth metadata
  2. Claude opens the server authorization flow
  3. Your server redirects the user to Yahoo
  4. User approves Yahoo Mail permissions
  5. Yahoo redirects back to your server
  6. Your server completes MCP OAuth and Claude marks the connector connected

For your exact use case, yes — this is the intended path:

  • deploy once on Render
  • use the Render URL in Claude cloud connector
  • user clicks connect
  • user signs into Yahoo and accepts permissions
  • Claude stores the connector session
  • later tool calls use Yahoo OAuth without asking the user for an app password

HTTP endpoints

  • GET /health
  • GET /mcp/sse
  • POST /mcp/message
  • GET /.well-known/openid-configuration
  • GET /.well-known/oauth-authorization-server
  • GET /.well-known/oauth-authorization-server/mcp/sse
  • GET /.well-known/oauth-protected-resource
  • GET /.well-known/oauth-protected-resource/mcp/sse
  • POST /register
  • GET /oauth/authorize
  • POST /oauth/token
  • GET /oauth/callback

Local smoke tests

npm run test:health
npm run test:sse

You can also inspect metadata in OAuth mode:

curl http://localhost:3000/.well-known/oauth-authorization-server
curl http://localhost:3000/.well-known/oauth-protected-resource/mcp/sse

Deployment notes

Render / Fly / any HTTPS host

  • set TRANSPORT_MODE=sse
  • set YAHOO_CLIENT_ID
  • set YAHOO_CLIENT_SECRET
  • set PUBLIC_BASE_URL
  • set Yahoo app callback to https://your-domain.com/oauth/callback
  • do not rely on in-memory sessions for multi-instance production

CORS / proxies

The server already enables permissive CORS for remote MCP clients and respects proxy protocol headers.

How the new remote auth works internally

  1. Claude hits /mcp/sse
  2. Server challenges with WWW-Authenticate and protected resource metadata
  3. Claude discovers /oauth/authorize, /oauth/token, /register
  4. Server receives MCP auth request
  5. Server redirects user to Yahoo
  6. Yahoo returns code to /oauth/callback
  7. Server exchanges Yahoo code for Yahoo access/refresh tokens
  8. Server creates its own MCP auth code for Claude
  9. Claude exchanges that code at /oauth/token
  10. Claude uses the returned MCP access token on future MCP requests
  11. Tool calls use the mapped Yahoo session and IMAP XOAUTH2

Files to check

  • server.js
  • .env.example
  • docker-compose.yml
  • render.yaml
  • fly.toml

Current limitations

  • token/session storage is in-memory
  • stdio mode still uses app password, not browser OAuth
  • remote Yahoo OAuth depends on your Yahoo app having required mail scopes enabled

Version

Current implementation version: 4.0.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选