LM

linuxrrze/mcp-mail-oauth

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

0 stars 0 forks 품질 55 트렌드 8

AI 조수가 읽을 수 있도록 MCP 서버는 OAuth 토큰 (XOAUTH2 / OAUTHBEARER)을 수용하는 IMAP / SMTP 서버에 전송합니다. 사용 : 추가 권한 단계 없음, 저장 암호 없음, 아니 ...

개요

AI Assistant를 읽을 수 있는 MCP 서버는 OAuth 토큰 (XOAUTH2 / OAUTHBEARER)를 허용하는 IMAP/SMTP 서버에서 다음을 보냅니다: 추가 허가 단계 없음, 저장된 암호 없음, 서버의 사용자 상태 없음. WebUI + Keycloak + Dovecot / Postfix를 엽니다. 서버는 credential에 대한 두 가지 변형을 지원합니다. Open WebUI, Dovecot 및 Postfix 구성을 포함한 다른 모든 것은 동일합니다. 세부 사항, 결정 차트 및 Keycloak 레이아웃 : . 1. Keycloak을 가진 WebUI를 여는 사용자 기록. 2. Open WebUI의 MCP auth 유형은 사용자의 액세스 토큰을 전달합니다. 3. mcp-mail-oauth는 (signature, Issuer, 경청자 mcp-mail, per-tool 범위)를 검증하고 이메일 주장에서 mailbox 이름을 걸립니다. 4. Dovecot/Postfix에 로그인합니다. Dovecot는 Keycloak (active, 청중 dovecot, 범위 우편)에 대한 인트로픽션에 의해 확인합니다. 두 개의 Keycloak 클라이언트 : WebUI 및 dovecot를 엽니 다. 1 ~ 3 단계는 동일합니다.

개요(AI 번역)

MCP 서버는 AI Assistant를 읽고 **signed-in user’s를 보냅니다. OAuth 토큰 (XOAUTH2 / OAUTHBEARER), **사용자의 기존 로그인 **: 추가 권한 없음 단계, 저장된 암호 없음, 서버의 per-user 국가.

WebUI + Keycloak + Dovecot / Postfix를 엽니다. 서버 지원 2 credential에 대한 변형은 메일 서버에 표시됩니다. 다른 모든 것, Open WebUI, Dovecot 및 Postfix 구성을 포함하여 동일합니다. 세부 사항, 결정 차트 및 Keycloak 레이아웃 : **docs/mail-credential.md **.

앞으로 토큰 (기본, MAIL_TOKEN_EXCHANGE=off)

  1. Keycloak을 가진 WebUI를 여는 사용자 기록.
  2. Open WebUI’s MCP auth type “OAuth” 사용자의 액세스 토큰을 전달합니다.
  3. mcp-mail-oauth는 그것을 증명합니다 (signature, 발행인, 청중 [T1]], per-tool 범위) 그리고 그것의 email 주장에서 mailbox 이름을 가지고.
  4. Dovecot/Postfix 와 같은 토큰**에 로그인합니다. Dovecot 확인하여 Keycloak에 대한 논쟁 (활성, 청중 dovecot], 범위 mail).

두 개의 Keycloak 클라이언트 : WebUI의 및 dovecot를 엽니 다.

토큰 교환 (MAIL_TOKEN_EXCHANGE=on)

1 ~ 3 단계는 동일합니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

mcp-mail-oauth

An MCP server that lets an AI assistant read and send the signed-in user’s own mail on an IMAP/SMTP server that accepts OAuth tokens (XOAUTH2 / OAUTHBEARER), using the user’s existing login: no extra authorization step, no stored passwords, no per-user state on the server.

Built for Open WebUI + Keycloak + Dovecot/Postfix. The server supports two variants for the credential it presents to the mail server. Everything else, including the Open WebUI, Dovecot and Postfix configuration, is identical. Details, a decision chart and the Keycloak layouts: docs/mail-credential.md.

Forwarded token (default, MAIL_TOKEN_EXCHANGE=off)

sequenceDiagram
    actor U as User
    participant OW as Open WebUI
    participant KC as Keycloak
    participant MCP as mcp-mail-oauth
    participant MS as Dovecot / Postfix

    U->>OW: Log in
    OW->>KC: OIDC login (client openwebui)
    KC-->>OW: Access tokenaud: mcp-mail, dovecotscope: mail, mcp:mail/*

    U->>OW: "Show my newest mails"
    OW->>MCP: MCP tool callAuthorization: Bearer (user's token)
    Note over MCP: Verifies signature, issuer,audience mcp-mail and tool scope.Mailbox = token's email claim
    MCP->>MS: IMAP / SMTP login,XOAUTH2 with the same token
    MS->>KC: Introspect token (as client dovecot)
    KC-->>MS: active, email, scope mail
    MS-->>MCP: Mailbox data
    MCP-->>OW: Tool result
    OW-->>U: Answer

    Note over OW,KC: Before the token expires, Open WebUIrefreshes it with its refresh token
  1. The user logs in to Open WebUI with Keycloak.
  2. Open WebUI’s MCP auth type “OAuth” forwards that user’s access token.
  3. mcp-mail-oauth verifies it (signature, issuer, audience mcp-mail, per-tool scope) and takes the mailbox name from its email claim.
  4. It logs in to Dovecot/Postfix with the same token. Dovecot checks it by introspection against Keycloak (active, audience dovecot, scope mail).

Two Keycloak clients: Open WebUI’s and dovecot.

Token exchange (MAIL_TOKEN_EXCHANGE=on)

sequenceDiagram
    participant OW as Open WebUI
    participant KC as Keycloak
    participant MCP as mcp-mail-oauth
    participant MS as Dovecot / Postfix

    OW->>KC: OIDC login (client openwebui)
    KC-->>OW: Token Aaud: mcp-mail only, no mail scope
    OW->>MCP: Tool call, Bearer token A
    Note over MCP: Same checks as above
    MCP->>KC: RFC 8693 exchange as client mcp-mail:token A for audience dovecot
    KC-->>MCP: Token B (aud dovecot, scope mail),cached until shortly before expiry
    MCP->>MS: IMAP / SMTP login with token B
    MS->>KC: Introspect token B (as client dovecot)
    KC-->>MS: active, email, scope mail
    MS-->>MCP: Mailbox data
    MCP-->>OW: Tool result

Steps 1 to 3 are the same. In step 4 the server presents a separate token that Keycloak issued to it for the mail server. Token A alone is refused by

GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →