diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..314514a --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +MCP_API_KEY=your-secret-key-here diff --git a/README.md b/README.md index 90a68a4..5a70788 100755 --- a/README.md +++ b/README.md @@ -75,6 +75,18 @@ npx @modelcontextprotocol/inspector Open http://localhost:3000 and connect to `http://localhost:3000/mcp` using "Streamable HTTP" transport. Pass `Authorization: Bearer your-secret-key` header. +## Install with your AI Agent + +Copy this prompt into your AI coding agent (Claude Code, Cursor, etc.): + +`Set up poke-mail (https://github.com/kacperkwapisz/poke-mail) for me — clone the repo, create a Python virtualenv named .venv, install requirements.txt, copy config.example.yml to config.yml, then help me configure config.yml — you can guide me on which IMAP/SMTP host and port to use for my email provider (iCloud, Gmail, Outlook, etc.) and what username format to use, but do NOT type or suggest passwords or API keys, tell me to enter those myself outside of this terminal and confirm when done — then generate a random 32+ character MCP_API_KEY, save it to a .env file as MCP_API_KEY=, install the poke npm package globally, run poke login so I can authenticate, and run start.sh to start the server and tunnel it to Poke.` + +To start the server again later: + +```bash +./start.sh +``` + ## Authentication Set `MCP_API_KEY` to secure the server. All requests must include `Authorization: Bearer `. @@ -105,6 +117,15 @@ docker run -d \ ghcr.io/kacperkwapisz/poke-mail:main ``` +### Resource Limits + +The server is mostly idle (IMAP IDLE + lightweight HTTP). Recommended limits for container orchestrators: + +| Resource | Reservation | Limit | +|----------|-------------|-------| +| Memory | 128 MB | 256 MB | +| CPU | 0.25 | 0.5 | + ## MCP Tools | Tool | Description | diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..81898b7 --- /dev/null +++ b/start.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")" + +# Load .env if present +if [ -f .env ]; then + set -a + source .env + set +a +fi + +# Activate virtualenv +source .venv/bin/activate + +: "${MCP_API_KEY:?MCP_API_KEY is not set — add it to .env or export it}" + +# Start poke-mail server in background +echo "Starting poke-mail server..." +python src/server.py & +SERVER_PID=$! +trap "kill $SERVER_PID 2>/dev/null" EXIT + +# Wait for server to be ready +sleep 2 + +# Tunnel to Poke +echo "Starting tunnel to Poke..." +poke tunnel http://localhost:3000/mcp --name "poke-mail"