Skip to main content
Glama
Mohking1

maildoc

by Mohking1

maildoc

AI 에이전트와 자동화를 위한 가벼운 이메일 검색, 첨부파일 검색, PDF 추출 도구입니다.

설정

pip install -r requirements.txt

.env에 자격 증명을 설정하세요 (.env.example 참조):

GMAIL_USERNAME=user@example.com
GMAIL_APP_PASSWORD=your_app_password

빠른 시작

from maildoc import search_emails, download_attachment, extract_pdf_text

# Search emails with attachments
emails = search_emails(
    sender="billing@example.com",
    with_attachments=True,
    limit=5,
)

# Download and extract text from PDF attachments (with optional password for protected files)
for email in emails:
    for att in email["attachments"]:
        if att["filename"].endswith(".pdf"):
            pdf_bytes = download_attachment(email["uid"], att["filename"])
            if pdf_bytes:
                # Pass password if the PDF is password-protected (e.g., bank statements)
                text = extract_pdf_text(pdf_bytes, password="optional_password")
                print(text)

MCP 서버 (Claude Desktop / Cursor / Antigravity)

Model Context Protocol (MCP) 서버로 실행합니다:

python server.py

claude_desktop_config.json 예시:

{
  "mcpServers": {
    "maildoc": {
      "command": "python",
      "args": ["/absolute/path/to/maildoc/server.py"],
      "env": {
        "GMAIL_USERNAME": "user@example.com",
        "GMAIL_APP_PASSWORD": "your_app_password"
      }
    }
  }
}

도구 참조

이메일 및 검색

  • search_emails(sender, subject, body, seen, date_gte, date_lt, with_attachments, folder, limit): 사서함을 검색하고 구조화된 사전을 반환합니다.

  • fetch_email_by_uid(uid, folder): UID로 이메일 하나를 가져옵니다.

  • list_folders(): 사서함 폴더를 나열합니다.

  • mark_email_as_read(uid, folder): 이메일을 읽음으로 표시합니다.

  • move_email(uid, destination_folder, source_folder): 이메일을 폴더 간에 이동합니다.

  • delete_email(uid, folder): 이메일을 삭제합니다.

  • create_folder(folder_name): 사서함 폴더를 생성합니다.

  • delete_folder(folder_name): 사서함 폴더를 삭제합니다.

  • connect_to_email(), disconnect_from_email(): 연결 수명 주기 도우미입니다.

PDF 추출

  • read_pdf_attachment(uid, attachment_filename, password=None, folder="INBOX"): 첨부파일을 다운로드하고 한 단계로 텍스트를 직접 추출합니다 (MCP / AI 에이전트에 적합).

  • extract_pdf_text(pdf_bytes, password=None): PDF 바이트에서 모든 텍스트를 추출합니다.

  • extract_pdf_page_text(pdf_bytes, page_number, password=None): 특정 페이지(1부터 시작)에서 텍스트를 추출합니다.

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mohking1/maildoc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server