{"id":37798042,"url":"https://github.com/fast-gateway-protocol/gmail","last_synced_at":"2026-01-16T15:22:41.444Z","repository":{"id":332305492,"uuid":"1133327219","full_name":"fast-gateway-protocol/gmail","owner":"fast-gateway-protocol","description":"Fast Gmail integration for AI coding agents via FGP","archived":false,"fork":false,"pushed_at":"2026-01-15T05:01:52.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T08:44:21.086Z","etag":null,"topics":["ai-agents","daemon","fast-gateway-protocol","fgp","gmail","google-api","mcp-alternative","rust","unix-socket"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fast-gateway-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T07:40:00.000Z","updated_at":"2026-01-15T05:01:17.000Z","dependencies_parsed_at":"2026-01-13T11:00:53.877Z","dependency_job_id":null,"html_url":"https://github.com/fast-gateway-protocol/gmail","commit_stats":null,"previous_names":["wolfiesch/fgp-gmail","fast-gateway-protocol/gmail"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fast-gateway-protocol/gmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast-gateway-protocol%2Fgmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast-gateway-protocol%2Fgmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast-gateway-protocol%2Fgmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast-gateway-protocol%2Fgmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fast-gateway-protocol","download_url":"https://codeload.github.com/fast-gateway-protocol/gmail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast-gateway-protocol%2Fgmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","daemon","fast-gateway-protocol","fgp","gmail","google-api","mcp-alternative","rust","unix-socket"],"created_at":"2026-01-16T15:22:38.798Z","updated_at":"2026-01-16T15:22:41.433Z","avatar_url":"https://github.com/fast-gateway-protocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fgp-gmail\n\nFast Gmail integration for AI coding agents via the Fast Gateway Protocol (FGP).\n\n## Features\n\n- **10x faster** than MCP-based Gmail tools (10-30ms vs 200-500ms)\n- **Multi-agent support**: Works with Claude Code, Cursor, Windsurf\n- **One install**: `fgp install gmail` configures all your AI agents\n- **OAuth2**: Secure authentication with Google\n\n## Installation\n\n```bash\nfgp install gmail\n```\n\nThis will:\n1. Install the Gmail daemon to `~/.fgp/services/gmail/`\n2. Detect your installed AI agents\n3. Copy skill files to each agent's config directory\n4. Configure OAuth (first run prompts for authorization)\n\n## Manual Setup\n\n### Prerequisites\n\n- Python 3.8+\n- Google Cloud project with Gmail API enabled\n- OAuth2 credentials (Desktop app type)\n\n### Steps\n\n1. **Get OAuth credentials**:\n   - Go to [Google Cloud Console](https://console.cloud.google.com/)\n   - Create a project and enable Gmail API\n   - Create OAuth 2.0 credentials (Desktop application)\n   - Download `credentials.json`\n\n2. **Place credentials**:\n   ```bash\n   mkdir -p ~/.fgp/auth/google\n   mv credentials.json ~/.fgp/auth/google/\n   ```\n\n3. **Build and run**:\n   ```bash\n   cargo build --release\n   ./target/release/fgp-gmail\n   ```\n\n4. **Authorize** (first run only):\n   - Browser opens for Google OAuth\n   - Grant permissions\n   - Token saved to `~/.fgp/auth/google/gmail_token.pickle`\n\n## Usage\n\n### Check Inbox\n\n```bash\nfgp call gmail.inbox -p '{\"limit\": 10}'\n```\n\n### Get Unread Count\n\n```bash\nfgp call gmail.unread\n```\n\n### Search Emails\n\n```bash\nfgp call gmail.search -p '{\"query\": \"from:newsletter\", \"limit\": 5}'\n```\n\nGmail search syntax supported:\n- `from:sender@example.com`\n- `to:recipient@example.com`\n- `subject:keyword`\n- `is:unread`\n- `after:2025/01/01`\n- `has:attachment`\n\n### Send Email\n\n```bash\nfgp call gmail.send -p '{\"to\": \"user@example.com\", \"subject\": \"Hello\", \"body\": \"Message body\"}'\n```\n\n### Get Thread\n\n```bash\nfgp call gmail.thread -p '{\"thread_id\": \"abc123\"}'\n```\n\n## Response Format\n\nAll methods return JSON:\n\n```json\n{\n  \"emails\": [\n    {\n      \"id\": \"18abc123\",\n      \"thread_id\": \"18abc123\",\n      \"from\": \"sender@example.com\",\n      \"subject\": \"Meeting tomorrow\",\n      \"date\": \"Mon, 13 Jan 2026 10:00:00 -0800\",\n      \"snippet\": \"Just a reminder about our meeting...\"\n    }\n  ],\n  \"count\": 10\n}\n```\n\n## Performance\n\n| Metric | fgp-gmail | Traditional MCP |\n|--------|-----------|-----------------|\n| Cold start | ~50ms | ~300-500ms |\n| Warm call | ~10-30ms | N/A (always cold) |\n| Batch support | Yes | No |\n\n## Architecture\n\n```\n┌─────────────────────────────────────┐\n│       fgp-gmail (Rust daemon)       │\n│  • UNIX socket server               │\n│  • NDJSON protocol                  │\n│  • Method routing                   │\n└─────────────────────────────────────┘\n                │\n                ▼\n┌─────────────────────────────────────┐\n│       gmail-cli.py (Python)         │\n│  • Gmail API calls                  │\n│  • OAuth2 token management          │\n│  • JSON response formatting         │\n└─────────────────────────────────────┘\n                │\n                ▼\n┌─────────────────────────────────────┐\n│         Gmail API (Google)          │\n└─────────────────────────────────────┘\n```\n\n## Development\n\n### Build\n\n```bash\ncargo build --release\n```\n\n### Run Tests\n\n```bash\ncargo test\n```\n\n### Run Daemon\n\n```bash\ncargo run --release\n```\n\n## Troubleshooting\n\n### OAuth Authorization Failed\n\n**Symptom:** Browser opens but authorization fails or redirects to error page.\n\n**Solutions:**\n1. Ensure your Google Cloud project has Gmail API enabled\n2. Check that OAuth credentials are \"Desktop application\" type\n3. Verify `credentials.json` is in `~/.fgp/auth/google/`\n4. Try deleting `~/.fgp/auth/google/gmail_token.pickle` and re-authorizing\n\n### Token Expired / Invalid Grant\n\n**Symptom:** Requests fail with \"invalid_grant\" or \"Token has been expired or revoked\"\n\n**Solution:**\n```bash\nrm ~/.fgp/auth/google/gmail_token.pickle\nfgp restart gmail\n# Re-authorize when browser opens\n```\n\n### Daemon Not Starting\n\n**Symptom:** `fgp start gmail` fails or daemon exits immediately\n\n**Check:**\n1. Socket permissions: `ls -la ~/.fgp/services/gmail/`\n2. Python available: `which python3`\n3. Logs: `cat ~/.fgp/logs/gmail.log`\n\n### Rate Limiting (429 Error)\n\n**Symptom:** Requests fail with \"Quota exceeded\" or 429 status\n\n**Solutions:**\n1. Gmail API has daily limits (~1B quota units/day for free)\n2. Reduce request frequency\n3. Use batch operations where possible\n4. Check quota at [Google Cloud Console](https://console.cloud.google.com/apis/api/gmail.googleapis.com/quotas)\n\n### Empty Results\n\n**Symptom:** Queries return empty results when emails exist\n\n**Check:**\n1. Search syntax is correct (Gmail search operators)\n2. Account has the expected emails\n3. Try simpler query first: `fgp call gmail.inbox`\n\n### Connection Refused\n\n**Symptom:** \"Connection refused\" when calling daemon\n\n**Solution:**\n```bash\n# Check if daemon is running\npgrep -f fgp-gmail\n\n# Restart daemon\nfgp stop gmail\nfgp start gmail\n\n# Check socket exists\nls ~/.fgp/services/gmail/daemon.sock\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Related\n\n- [protocol](https://github.com/fast-gateway-protocol/protocol) - Protocol specification\n- [daemon](https://github.com/fast-gateway-protocol/daemon) - Rust SDK for building daemons\n- [cli](https://github.com/fast-gateway-protocol/cli) - Command-line interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast-gateway-protocol%2Fgmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffast-gateway-protocol%2Fgmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast-gateway-protocol%2Fgmail/lists"}