SOGo MCP Server
A Model Context Protocol (MCP) server that connects your AI agents (like Codex, Claude) to your SOGo groupware server. It enables your AI assistants to read your emails, check your calendar, and search your contacts.
Features
- Email Integration: Read recent unread emails (with full body previews) using IMAP.
- Calendar Integration: Check your schedule for today/tomorrow using CalDAV.
- Contacts Integration: Search your address book for specific contacts by name or email using CardDAV.
Prerequisites
- A SOGo account
- Python 3.11+
- Docker (Optional, for containerized deployment)
Setup Options
You can run this MCP server either Locally (Stdio) or via Docker (SSE).
Option A: Running Locally (Stdio)
This is the most common way to run MCP servers directly connected to local desktop applications like Claude Desktop or Codex.
Clone the repository:
git clone https://github.com/yourusername/sogo-mcp.git cd sogo-mcpInstall dependencies:
pip install -r requirements.txtConfigure your Client:In your client application (e.g. Codex or Claude Desktop), add the server configuration using the absolute path to your
server.pyand your SOGo credentials:{ "mcpServers": { "sogo": { "command": "python", "args": ["/absolute/path/to/sogo-mcp/server.py"], "env": { "SOGO_HOST": "mail.example.com", "SOGO_USER": "[email protected]", "SOGO_PASS": "your_password" } } } }
Option B: Running via Docker (SSE / Networked)
If you want to run the server on a remote machine or isolated in a container, you can use Docker Compose, which runs the server over HTTP SSE on port 8000.
Create an environment file:Copy the example config and fill in your details:
cp .env.example .envEdit
.envwith your SOGo credentials. You can also changeMCP_PORTif port 8000 is already in use on your machine.Start the Docker container:
docker compose up --build -dConnect to the Server:Your server is now available via SSE at
http://localhost:8000/sse(or whichever port you set). Connect your client by pointing it to this URL.
Available Tools
Once connected, your AI agent will have access to the following tools:
get_unread_emails: Fetches the most recent unread emails from your SOGo INBOX, including Date, Sender, Subject, and the text body preview.get_todays_schedule: Retrieves today's calendar events (including expanding recurring events) from your SOGo CalDAV calendars.search_contacts: Searches your SOGo CardDAV personal address book for contacts matching a name or email query.
Contributing
Pull requests are welcome! If you encounter any issues with parsing specific SOGo setups, please open an issue.
License
MIT License