Use Claude Code skills, Gmail MCP, and the /goal command to automatically scan your inbox for AI news, score stories, and draft LinkedIn posts every morning.
Stop Reading Your Inbox. Let It Read Itself. #
If you work in AI, you know the problem. Every morning you wake up to a flood of newsletters, blog posts, Reddit threads, and LinkedIn updates. There’s too much to read and not enough time to figure out what actually matters. Most people either skim badly or ignore it all.
This guide shows you how to build an AI newsletter digest workflow that reads your Gmail inbox for you, scores each story by relevance, and drafts a LinkedIn post — all before you finish your coffee. You’ll use Claude Code, the Gmail MCP server, and the /goal
command to wire it together into a repeatable morning automation.
No manual curation. No missed stories. No staring at your inbox at 7am.
What You’re Actually Building #
Before jumping into steps, here’s the shape of the final workflow:
Gmail MCP gives Claude Code read access to your inbox so it can pull emails from overnight.Claude Code scans those emails, extracts story headlines and summaries, and scores each one on a 1–10 relevance scale against your defined interests.- The
/goal
command keeps the agent on task across multi-step reasoning — filtering noise, ranking stories, and generating output — without losing context. - The final output is a short markdown digest of the top 5 stories, plus a ready-to-post LinkedIn draft.
You run this once each morning. Or you schedule it. Either way, you’re getting a distilled view of what matters without touching your inbox.
This is a developer-oriented workflow. You’ll need basic familiarity with running Claude Code in your terminal, some comfort with MCP configuration files, and a Gmail account. Everything else is explained step by step.
Prerequisites: What You Need Before Starting #
Set these up before you write a single line of configuration.
Claude Code
Claude Code is Anthropic’s agentic coding environment that runs in your terminal. Install it via npm:
npm install -g @anthropic-ai/claude-code
You’ll need an Anthropic API key. Set it as an environment variable:
export ANTHROPIC_API_KEY=your_key_here
Claude Code supports MCP (Model Context Protocol), which is the key integration layer for this workflow. MCP lets Claude connect to external tools — like Gmail — as if they were native capabilities.
Gmail API Access
You need a Google Cloud project with the Gmail API enabled and OAuth 2.0 credentials. Here’s what to do:
- Go to the Google Cloud Consoleand create a new project. - Enable the Gmail API under “APIs & Services.”
- Create OAuth 2.0 credentials. Choose “Desktop app” as the application type.
- Download the
credentials.json
file and save it to a known location on your machine.
You’ll reference this path in your MCP configuration.
Node.js and the Gmail MCP Server
The Gmail MCP server is a community-maintained Node.js package. Install it globally:
npm install -g @gptscript-ai/gmail-mcp-server
Alternatively, you can use the @modelcontextprotocol/server-gmail
package — either works. Check the package documentation for the exact tool names it exposes, since these vary slightly between implementations.
Configure Gmail MCP in Claude Code #
Claude Code reads MCP server configurations from a JSON file. You’ll add Gmail as a server so Claude can call it directly.
Open or create the MCP config file at:
~/.claude/mcp_settings.json
Add the Gmail server entry:
{
"mcpServers": {
"gmail": {
"command": "node",
"args": [
"/usr/local/lib/node_modules/@gptscript-ai/gmail-mcp-server/dist/index.js"
],
"env": {
"GMAIL_CREDENTIALS_PATH": "/path/to/your/credentials.json",
"GMAIL_TOKEN_PATH": "/path/to/your/token.json"
}
}
}
}
Update the paths to match where you saved your credentials. The token.json
file is created automatically after the first OAuth login — just point it somewhere writable.
Authenticate on First Run
The first time you run this workflow, Gmail MCP will prompt you to authorize access via browser. Run a quick test:
claude --mcp-config ~/.claude/mcp_settings.json "List my 5 most recent emails"
Follow the OAuth flow in your browser. Once authorized, the token file is saved and subsequent runs won’t require manual login.
Write the /goal Prompt #
This is where the workflow comes to life. The /goal
command in Claude Code lets you define a high-level objective and have Claude reason through the steps autonomously rather than waiting for you to guide each move.
Create a file called digest.md
with your goal prompt:
/goal
You are an AI news curator. Your job is to read my Gmail inbox for emails received in the last 24 hours, extract AI-related news stories, score them by relevance, and produce two outputs: a ranked digest and a LinkedIn draft post.
## Step 1: Fetch Emails
Use the Gmail MCP tool to search for emails from the last 24 hours. Use query: "newer_than:1d". Retrieve the full text of each email, not just subject lines.
## Step 2: Extract Stories
From each email, extract individual news items. Each item should include:
- Headline
- 1–2 sentence summary
- Source (publication or newsletter name)
- URL if present
Ignore promotional emails, newsletters about non-AI topics, and email threads that are clearly personal.
## Step 3: Score Each Story
Score each story from 1–10 based on these criteria:
- Relevance to applied AI, LLMs, or AI agents: up to 4 points
- Novelty (new research, product launch, policy change): up to 3 points
- Practical applicability for an AI developer or builder: up to 3 points
Discard stories scoring below 5.
## Step 4: Produce the Digest
Output a markdown digest with the top 5 stories, sorted by score. Format:
### [Headline] — Score: X/10
**Source:** [Name]
**Summary:** [1–2 sentences]
**Link:** [URL or "Not available"]
## Step 5: Draft LinkedIn Post
Write a LinkedIn post (250–300 words) based on the top 3 stories. Tone: informative, not hype-y. Lead with a specific insight, not "here's what happened in AI this week." Include a call to action asking followers what they found most interesting.
Output the digest first, then the LinkedIn draft below a horizontal rule.
Remy doesn't build the plumbing. It inherits it. #
Other agents wire up auth, databases, models, and integrations from scratch every time you ask them to build something.
Remy ships with all of it from MindStudio — so every cycle goes into the app you actually want.
Save this file. It’s your reusable morning automation script.
Run the Workflow #
With the config and goal file in place, run the workflow from your terminal:
claude --mcp-config ~/.claude/mcp_settings.json < digest.md
Claude Code will:
- Connect to Gmail MCP and authenticate
- Execute the search query against your inbox
- Pull full email bodies
- Reason through extraction, scoring, and ranking
- Output the digest and LinkedIn draft in your terminal
The whole process typically takes 60–120 seconds depending on inbox volume.
You can pipe the output to a file for later use:
claude --mcp-config ~/.claude/mcp_settings.json < digest.md > ~/digest-output.md
Or copy just the LinkedIn draft section using something like grep
and awk
if you want to automate posting further down the line.
Tune the Scoring Criteria #
The default scoring rubric works well for a general AI audience, but you should adjust it to match your actual interests and content strategy.
Adjusting for Niche Topics
If you write primarily about AI in healthcare, legal tech, or enterprise software, update the Step 3 criteria to reflect that. For example:
Score each story from 1–10 based on:
- Relevance to AI applications in healthcare or clinical workflows: up to 5 points
- Regulatory or compliance implications: up to 3 points
- Practical applicability for a healthcare IT team: up to 2 points
The more specific your scoring rubric, the better the filtering gets.
Adjusting the Minimum Score Threshold
If you’re getting too few stories after filtering, lower the discard threshold from 5 to 4. If you’re still getting too many, raise it to 6. Tune over a few days until the output feels right.
Adding Newsletter Sources as Context
Claude performs better when it knows which newsletters you subscribe to. Add a line to Step 2:
My primary AI newsletters include: The Rundown AI, Import AI, Last Week in AI, The Batch, and Ben's Bites. Prioritize stories from these sources when multiple sources cover the same story.
This reduces duplicate story extraction and helps Claude understand your information diet.
Schedule It as a Daily Cron Job #
Running this manually each morning is fine, but automating it completely is better. Add a cron job to run the workflow at 7am:
crontab -e
Add this line:
0 7 * * * /usr/local/bin/claude --mcp-config /home/user/.claude/mcp_settings.json < /home/user/digest.md > /home/user/digest-$(date +\%Y-\%m-\%d).md 2>&1
Adjust paths to match your system. This runs the workflow every day at 7am and saves dated output files so you have a searchable archive.
If you want an email notification when the digest is ready, pipe the output to a simple mail script or use a tool like mailutils
:
claude --mcp-config ~/.claude/mcp_settings.json < digest.md | mail -s "AI Digest $(date +%Y-%m-%d)" you@youremail.com
Common Problems and Fixes #
Gmail MCP Can’t Authenticate
This usually means your OAuth token expired or the credentials path is wrong. Delete token.json
and re-run the auth flow manually:
claude --mcp-config ~/.claude/mcp_settings.json "List my 5 most recent emails"
Complete the browser OAuth flow again. If credentials.json isn’t found, double-check the path in mcp_settings.json
— it must be an absolute path.
Claude Keeps Asking for Clarification
The /goal
command works best when your prompt is unambiguous. If Claude keeps pausing to ask questions, your goal file probably has gaps. Common culprits:
- Ambiguous output format — specify exactly what you want
- Unclear filtering instructions — spell out what to exclude, not just what to include
- Missing context about what “AI-related” means to you — add a brief definition
Output Is Too Long or Too Short
The digest length is controlled by the top N stories you ask for and how verbose the summaries are. If output is too long, reduce from top 5 to top 3. If it’s too short or feels thin, increase the summary instruction from “1–2 sentences” to “2–3 sentences” and add a “Key implication” field to each story entry.
Emails Are Missing from the Search
Gmail MCP’s search uses Gmail’s native query syntax. The query newer_than:1d
covers emails from the last 24 hours, but if you run this at 7am, you might miss newsletters that arrived the night before from different time zones. Try newer_than:2d
to cast a wider net and rely on the scoring step to filter duplicates.
Where MindStudio Fits If You Want to Go Further #
The Claude Code workflow above is powerful, but it runs in your terminal. If you want to share this with a team, trigger it from a web interface, or connect the output to Notion, Slack, or a CMS, you’ll need more infrastructure.
That’s where MindStudio makes sense. MindStudio is a no-code platform for building AI agents that connect to tools like Gmail, Google Docs, Slack, and HubSpot — without writing infrastructure code. You can replicate the exact same digest logic (inbox scan → score → draft) as a visual workflow that any teammate can run or schedule from a browser.
The MindStudio Agent Skills Plugin is especially relevant here. If you’re building a more complex agentic pipeline on top of Claude Code — say, scoring stories against a database of topics your team covers, then routing high-value stories to different Slack channels — the Skills Plugin lets your Claude-based agent call MindStudio’s 120+ typed capabilities as simple method calls. Things like agent.sendEmail()
, agent.searchGoogle()
, or agent.runWorkflow()
handle the infrastructure layer so your agent focuses on reasoning.
And if you want a no-code version of this whole digest workflow — no terminal required — MindStudio’s built-in email-triggered agent type can do exactly this: watch an inbox, process incoming content, score it, and post a summary to Slack or generate a draft in Google Docs. You can try it free at mindstudio.ai.
FAQ #
What is Gmail MCP and how does it work with Claude?
MCP (Model Context Protocol) is an open standard that lets AI models connect to external tools and data sources. Gmail MCP is a server that implements this protocol for Gmail — it exposes Gmail’s search, read, and compose functions as tools that Claude can call directly during a conversation or agentic run. When you configure Gmail MCP in Claude Code, Claude can read your inbox, search for specific emails, and retrieve full message content without you needing to copy and paste anything.
Do I need to give Claude access to my entire Gmail account?
No. Gmail OAuth scopes let you limit access. For a read-only digest workflow, request only the gmail.readonly
scope. This means Claude (via the MCP server) can read emails but cannot send, delete, or modify anything. Review the scopes your MCP server requests during OAuth setup and remove any that aren’t needed.
What does the /goal command actually do differently from a regular Claude prompt?
A regular Claude prompt is a single turn — you ask, Claude responds, done. The /goal
command signals to Claude Code that this is an objective requiring multi-step autonomous reasoning. Claude will plan steps, execute tool calls sequentially, evaluate its own progress, and loop back if needed — all without you prompting each step. For workflows like this one (fetch → extract → score → write), /goal
keeps the agent on track across what would otherwise be 4–5 separate prompts.
How accurate is the story scoring?
Reasonably accurate for filtering noise, but not perfect. Claude’s scoring reflects its training data and the rubric you define — it’ll consistently surface genuinely newsworthy stories and filter out promotional content. The weak spot is scoring nuance between a 6 and a 7 for borderline stories. For most use cases this doesn’t matter much. If accuracy is critical, add a human review step: output the full scored list (not just top 5) and let a person confirm the final selection.
Can I use this with email clients other than Gmail?
Yes, with different MCP servers. There are MCP implementations for Outlook, Fastmail, and any IMAP-compatible inbox. The workflow logic in your digest.md
goal file stays identical — you just swap the MCP server configuration and adjust the search query syntax. Outlook uses Microsoft Graph API with its own OAuth flow. IMAP-based solutions use server address and credentials.
Will this work if I receive newsletters in languages other than English?
Claude handles multilingual input well, but your LinkedIn draft output will default to English unless you specify otherwise. If you receive French or Spanish newsletters, Claude will extract and score stories correctly. Add a line to your Step 5 instructions if you want the LinkedIn draft in a specific language: “Write the LinkedIn post in [language].”
Key Takeaways #
- An AI newsletter digest workflow built with Claude Code, Gmail MCP, and
/goal
can replace 20–30 minutes of manual inbox reading with a 2-minute automated output. - Gmail MCP requires a Google Cloud project with OAuth credentials — set this up once and it handles authentication automatically on subsequent runs.
- The
/goal
command enables multi-step autonomous reasoning: Claude plans, fetches, scores, and drafts without needing you to prompt each step. - Custom scoring rubrics are the most important tuning lever — time spent sharpening your criteria pays off in noticeably better output quality.
- For teams or non-terminal deployments, MindStudio can replicate this same workflow as a shareable, schedulable agent with connectors to Slack, Notion, and Google Docs.
Built like a system. Not vibe-coded.
Remy manages the project — every layer architected, not stitched together at the last second.
The tools for automating your information workflow exist and work well today. The only thing left is to set it up.