I asked Claude to write a review of the process, hope this do not count as cheating 🤣
Building a Daily AI News Digest with Trigger.dev, Tavily & Resend — and the MCP rabbit hole I fell into I spent a session building a fully automated daily news digest that searches the web for Claude Code community news in Serbia and the Balkans, formats it into a clean HTML email, and delivers it to my inbox every morning at 7:00 AM CET. Here's what I built, what broke, and how I fixed it.
What I built
A scheduled TypeScript task running on Trigger.dev that: - Fires every day at 07:00 CET (Europe/Belgrade timezone, DST-aware)
- Runs 5 parallel web searches via the Tavily API — queries like "Claude Code Serbia community events", "Anthropic Claude AI Serbia", "Claude Code meetup Balkans"
- Deduplicates results, sorts by relevance score, and trims to the top articles
- Formats everything into a clean HTML email and sends it via Resend
The whole thing is about 100 lines of TypeScript. No Python, no shell scripts, no cron job on a VPS — it runs entirely serverless on Trigger.dev's infrastructure. The tech stack
- Trigger.dev v4 — scheduled tasks with native cron + timezone support
- Tavily (@tavily/core) — AI-optimized search API, free tier is generous enough for this use case
- Resend — transactional email, sandbox sender while I'm without a custom domain
- TypeScript + native fetch — no axios, no extra HTTP libraries needed
Problems I ran into
1. trigger.config.ts missing maxDuration
Trigger.dev v4.4.6 requires a maxDuration field (minimum 5s) in the config file. The deploy failed silently-ish until I added maxDuration: 60. Easy fix once you know, but not obvious from the error. 2. Angle brackets in the project ref
I copy-pasted <proj_pfuotwujnjgkcyrtyoho> including the angle brackets into the config. The CLI accepted it without complaint, then failed at deploy time. Lesson: strip the angle brackets.
3. The MCP server rabbit hole (this one took a while)
This is the interesting one. I'm using Claude Code inside VS Code and wanted the Trigger.dev MCP tools (mcp__trigger__deploy, mcp__trigger__trigger_task, etc.) to work natively — so I could deploy and test without dropping to the terminal. Here's what I tried that didn't work:
- Adding mcpServers to ~/.claude/settings.json — turns out mcpServers is not a valid key in Claude Code's settings schema. It gets silently ignored.
- Adding claudeCode.mcpServers to VS Code's settings.json — also not a real setting.
- Creating mcp.json (no dot prefix) at the project root — Claude Code requires .mcp.json with a dot prefix.
Here's what actually worked:
- Created .mcp.json (dot-prefixed) at the project root with the Trigger.dev MCP server config
- Used a shell wrapper instead of hardcoding the API key — the command sources .env first so secrets never touch the config file:{
- "mcpServers": {
- "trigger": {
- "command": "sh",
- "args": ["-c", "set -a && . '/path/to/.env' && set +a && exec npx trigger.dev@4.4.6 mcp"]
- }
- }
- }
- Added "enableAllProjectMcpServers": true to ~/.claude/settings.json — this is the key that actually approves the project-level MCP server
- Reloaded the VS Code window
After the reload, all the MCP tools appeared natively. No more CLI workarounds.
Deployment & test results
Once the MCP tools were working, the full deploy-and-test workflow ran entirely inside Claude Code without touching a terminal:
- Dev test (mcp__trigger__start_dev_server → trigger_task in dev environment): completed in ~2 seconds, 24 articles found, email delivered
- Deploy to prod (mcp__trigger__deploy): version 20260531.2 built and promoted in under 2 minutes
- Prod test (trigger_task in prod environment): completed in 5 seconds, 24 articles, email delivered — run_cmptyqjky45b70jn75y80euzx
Three successful runs across two environments, all 24 articles each time. The automation is live and the cron is registered — first real delivery hits tomorrow at 07:00 CET.
Lessons
- Trigger.dev v4 is genuinely great for this kind of thing — the timezone-aware cron alone saved me from DST headaches
- Tavily's search quality for niche regional queries is surprisingly good
- Claude Code's MCP server support is powerful but the .mcp.json + enableAllProjectMcpServers combo is not well-documented yet — hopefully this saves someone the same debugging loop
- Keep secrets out of config files even for local tooling — the shell wrapper pattern is clean and works everywhere
- Once MCP is wired up correctly, the whole loop (build → test locally → deploy → verify prod) runs without ever leaving the editor