Skip to main content
MindStudio
Pricing
Blog About
My Workspace

How to Build an AI Newsletter Digest Skill with Claude Code and Gmail MCP

Use Claude Code Ultra Code mode and Gmail MCP to build a skill that scouts your inbox, scores AI news, and drafts LinkedIn posts automatically every morning.

MindStudio Team RSS
How to Build an AI Newsletter Digest Skill with Claude Code and Gmail MCP

Why Your Morning Reading Habit Needs an Upgrade

If you subscribe to more than a handful of AI newsletters, you already know the problem. By 9 AM, your inbox holds 15 emails from Superhuman AI, The Rundown, TLDR, Import AI, and a dozen others — each one competing for the same 20 minutes of your morning. You read some, skip others, and by the time you actually sit down to write something worth posting on LinkedIn, the moment’s gone.

Claude Code’s Ultra mode, paired with the Gmail MCP (Model Context Protocol) server, gives you a practical way to fix this. You can build a skill that reads your inbox, scores each story by relevance, generates a ranked digest, and drafts LinkedIn-ready posts — all before you finish your first cup of coffee.

This guide walks through the full build, from setting up Gmail MCP to wiring up the scoring logic and post generation. No fluff, just the steps.


What You’re Actually Building

Before jumping into setup, it helps to be clear about what “skill” means in this context.

In Claude Code, a skill is a reusable instruction set — essentially a prompt-driven workflow you can invoke with a single command. Unlike a one-off conversation, a skill remembers its job, uses tools consistently, and can be called on a schedule or triggered manually whenever you want a fresh digest.

The skill you’re building here does four things:

  1. Reads your inbox via Gmail MCP, filtering for newsletter senders you care about.
  2. Scores each item against criteria you define (relevance to AI, product news, research, etc.).
  3. Summarizes the top stories in a clean digest format.
  4. Drafts 2–3 LinkedIn posts based on the highest-scoring content.

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.

200+
AI MODELS
GPT · Claude · Gemini · Llama
1,000+
INTEGRATIONS
Slack · Stripe · Notion · HubSpot
MANAGED DB
AUTH
PAYMENTS
CRONS

Remy ships with all of it from MindStudio — so every cycle goes into the app you actually want.

The output is a Markdown file dropped into a folder of your choice — ready to review, edit, and post.


Prerequisites

You’ll need a few things in place before starting:

  • Claude Code installed and authenticated. You’ll want Ultra mode enabled for longer context windows, which matters when processing a full inbox.
  • A Gmail account (or Google Workspace account) you’re willing to grant API access.
  • Node.js 18+ installed locally.
  • The Gmail MCP server — this is the bridge between Claude Code and your Gmail data.
  • Basic familiarity with running terminal commands. You don’t need to write code, but you’ll be copying and editing config files.

If you haven’t used MCP servers with Claude Code before, the short version is this: MCP (Model Context Protocol) is an open standard that lets AI models connect to external tools and data sources through a standardized interface. Anthropic built it to make Claude more extensible, and the Gmail MCP server is one of many community-built connectors that implement it.


Set Up the Gmail MCP Server

Create a Google Cloud Project and Enable the Gmail API

Start at the Google Cloud Console. Create a new project — call it something like claude-newsletter-digest.

Once inside the project:

  1. Navigate to APIs & Services > Library.
  2. Search for “Gmail API” and click Enable.
  3. Go to APIs & Services > OAuth consent screen.
  4. Choose External (unless you’re on Google Workspace), fill in the required fields, and save.
  5. Under Scopes, add https://www.googleapis.com/auth/gmail.readonly. Read-only is all you need — no reason to grant write access.
  6. Go to APIs & Services > Credentials > Create Credentials > OAuth 2.0 Client ID.
  7. Choose Desktop App as the application type.
  8. Download the resulting JSON file. Rename it credentials.json and keep it somewhere accessible.

Install the Gmail MCP Server

The most widely used Gmail MCP implementation is the gmail-mcp-server package. Install it globally:

npm install -g @gptscript-ai/gmail-mcp-server

Or if you’re using the Anthropic-maintained MCP servers repo, clone it and install the Gmail server:

git clone https://github.com/modelcontextprotocol/servers.git
cd servers/src/gmail
npm install

Place your credentials.json in the server directory.

Authenticate with OAuth

Run the authentication flow:

node auth.js

This opens a browser window asking you to grant access to the Gmail account you’re connecting. After you approve, it saves an access token locally. You won’t need to repeat this step unless the token expires or you revoke access.

Configure Claude Code to Use the MCP Server

In your Claude Code configuration file (usually ~/.claude/config.json or similar depending on your version), add the Gmail MCP server as a tool source:

{
  "mcpServers": {
    "gmail": {
      "command": "node",
      "args": ["/path/to/gmail-mcp-server/index.js"],
      "env": {
        "CREDENTIALS_PATH": "/path/to/credentials.json"
      }
    }
  }
}

Restart Claude Code. If everything’s connected correctly, you’ll see Gmail listed as an available tool when you open a new session.


Build the Newsletter Digest Skill

Create the Skill File

Claude Code skills live as Markdown files with embedded instructions. Create a new file called newsletter-digest.md in your Claude Code skills directory (check your Claude Code docs for the exact path — it varies slightly by OS and version).

One coffee. One working app.

You bring the idea. Remy manages the project.

WHILE YOU WERE AWAY
Designed the data model
Picked an auth scheme — sessions + RBAC
Wired up Stripe checkout
Deployed to production
Live at yourapp.msagent.ai

Here’s the full skill structure:

# Newsletter Digest Skill

## Instructions

You are an AI newsletter curator. Every time this skill runs, you will:

1. Use the Gmail tool to fetch emails from the last 24 hours.
2. Filter for known newsletter senders (see the sender list below).
3. Score each story on a scale of 1–10 using the scoring criteria below.
4. Summarize the top 5 stories.
5. Draft 2–3 LinkedIn posts based on the top stories.
6. Output everything as a Markdown file named `digest-YYYY-MM-DD.md`.

## Sender List

Filter emails from these senders (adjust to your actual subscriptions):

- The Rundown AI
- TLDR AI
- Import AI (Jack Clark)
- Superhuman AI
- Ben's Bites
- The Batch (deeplearning.ai)
- AI Breakfast
- Mindstream

If an email is not from one of these senders, skip it.

## Scoring Criteria

Score each story from 1–10 based on these factors:

- **Relevance** (0–3): Is this directly about AI models, tools, research, or industry moves?
- **Novelty** (0–3): Is this new information, or a rehash of something from last week?
- **Practical value** (0–2): Does this change how someone might build with AI or run an AI-related business?
- **Engagement potential** (0–2): Would a LinkedIn audience of AI practitioners and founders find this worth discussing?

Stories scoring 7 or above go into the digest. Stories below 4 are dropped entirely.

## Digest Format

For each top story, output:

**[Score/10] Story headline**
Source: [newsletter name]
Summary: 2–3 sentences in plain English. No jargon unless necessary.
Why it matters: 1 sentence.

---

## LinkedIn Post Drafts

After the digest, generate 2–3 LinkedIn post drafts. Each post should:

- Open with a specific claim or observation, not a question.
- Be 150–250 words.
- Reference the source story naturally.
- End with a single clear takeaway or call to action.
- Use line breaks between paragraphs. No bullet points.

Do not use hashtags unless the post would clearly benefit from one or two specific ones.

Test the Skill Manually

With Claude Code open, invoke the skill:

/skills run newsletter-digest

The first run will take a minute or two. Claude Code will call the Gmail MCP tool, pull recent emails, and work through the scoring and summarization steps. Watch the tool calls in the output pane — you should see Gmail API calls being made in real time.

If it stalls or errors, the most common culprits are:

  • OAuth token expired — re-run node auth.js to refresh it.
  • Sender names don’t match exactly — check the actual “From” field in your emails and update the sender list accordingly. Some newsletters send from addresses like noreply@rundown.ai rather than a display name.
  • Too many emails in the window — if you have a very full inbox, try narrowing the time window to 12 hours first.

Tune the Scoring and Output

The default scoring criteria work reasonably well, but you’ll probably want to adjust after a few runs. Here’s how to think about it:

Adjust for Your Use Case

Cursor
ChatGPT
Figma
Linear
GitHub
Vercel
Supabase
goremy.ai

Seven tools to build an app. Or just Remy.

Editor, preview, AI agents, deploy — all in one tab. Nothing to install.

If you’re building this for personal use and you care mostly about model releases and research papers, weight “Novelty” and “Relevance” higher. If you’re a founder using this to stay competitive, “Practical value” should dominate.

You can also add explicit exclusions. For example:

Skip any story that is primarily about:
- Funding rounds under $10M
- Hardware releases from non-AI companies
- Opinion pieces with no new factual content

Adding exclusions is often more effective than tweaking scores, because it removes the noise before scoring even starts.

Control LinkedIn Post Tone

The default prompt produces professional, measured posts. If you want something more opinionated, add a tone instruction:

Write LinkedIn posts from the perspective of a skeptical practitioner who values 
concrete results over hype. Be willing to push back on inflated claims.

Or if you prefer a more educational style:

Write LinkedIn posts that explain the story's significance to someone who 
follows AI news but doesn't have a technical background.

The skill will honor these instructions on every run.


Schedule It to Run Every Morning

A digest you have to remember to trigger isn’t much better than reading the newsletters yourself. The goal is to have this waiting for you at a set time.

Option 1: Cron Job (macOS/Linux)

Open your crontab:

crontab -e

Add a line that runs the skill at 7 AM daily:

0 7 * * * /usr/local/bin/claude-code skills run newsletter-digest >> ~/logs/newsletter-digest.log 2>&1

Adjust the path to your Claude Code binary as needed.

Option 2: GitHub Actions (Cloud)

If you want this running even when your laptop is closed, push your skill file to a private GitHub repo and set up a GitHub Actions workflow:

name: Daily Newsletter Digest

on:
  schedule:
    - cron: '0 7 * * *'

jobs:
  run-digest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run newsletter digest skill
        env:
          CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
          GMAIL_CREDENTIALS: ${{ secrets.GMAIL_CREDENTIALS }}
        run: |
          npm install -g @anthropic-ai/claude-code
          claude-code skills run newsletter-digest

You’d need to store your Gmail credentials as a GitHub secret, which requires serializing the JSON. It’s a bit more setup, but it means the digest runs in the cloud on a reliable schedule.

Option 3: Push Output to Notion or Slack

If a local Markdown file isn’t convenient, you can extend the skill to push output elsewhere. Claude Code supports additional MCP servers — there are community-built ones for Notion, Slack, and other tools. Add the relevant server to your config and update the skill instructions to call it:

After generating the digest, use the Notion tool to create a new page 
in the "Morning Digest" database with today's content.

Where MindStudio Fits

If you want to skip the Gmail MCP configuration entirely — or you want a version of this workflow that non-technical teammates can also use — MindStudio’s no-code automation platform is worth a look.

Hermes, walked through line by line — free 1-hour workshop
The free Hermes Agent crash courseReserve your spot

MindStudio has native Google Workspace integrations, which means you can connect Gmail without setting up OAuth flows or running local servers. You build the same logic — filter newsletters, score stories, draft posts — inside a visual workflow editor. The average build takes under an hour, and the result runs as a scheduled background agent that anyone on your team can trigger.

The Agent Skills Plugin is also relevant here: if you’re building Claude Code agents that need to call out to external services (send email summaries, post to Slack, write to a CRM), you can use MindStudio’s typed SDK to handle those integrations as simple method calls rather than managing the authentication and retry logic yourself.

For teams that want the newsletter digest workflow without the local setup, MindStudio is a faster path. You can try it free at mindstudio.ai.


Common Mistakes and How to Fix Them

The Skill Reads Too Many Emails

If Claude Code is trying to process hundreds of emails, it’ll either time out or burn through context. Add a hard cap in the skill instructions:

Fetch no more than 50 emails. If more than 50 match the sender filter, 
prioritize the most recent ones.

LinkedIn Posts Sound Generic

The most common cause is that the scoring step is passing too many mediocre stories to the post generation step. Raise the minimum score threshold from 7 to 8, and you’ll find the posts improve significantly — they’re working from better raw material.

Scores Feel Random

Scoring will vary between runs unless you give the model more structure. Add example scores to your criteria:

Example: A story announcing GPT-5's release would score 9/10.
A story about a $5M seed round for an AI startup would score 3/10.
A research paper on new reasoning techniques from a major lab would score 7/10.

Anchoring the scale with concrete examples produces much more consistent results.

The Digest Includes Duplicate Stories

Multiple newsletters often cover the same story. Add a deduplication instruction:

If two or more stories cover the same event or announcement, merge them 
into a single digest entry. Note which newsletters covered it.

FAQ

What is Gmail MCP and how does it work with Claude?

MCP stands for Model Context Protocol — an open standard developed by Anthropic that lets AI models connect to external tools and data sources through a consistent interface. The Gmail MCP server implements this protocol for Gmail, giving Claude Code read (or read/write) access to your inbox via the Gmail API. When Claude Code runs a skill that calls Gmail, it’s making authenticated API calls through the MCP server, which handles the OAuth flow and formats the data for the model to read.

Do I need Claude Code Ultra mode specifically?

Ultra mode isn’t strictly required, but it’s recommended for this use case. The main reason is context window size. If you’re processing 30–50 newsletter emails in a single run, each with full body text, you’ll quickly exceed the context limits of smaller models. Ultra mode’s extended context handles a full morning inbox without truncation. If you’re on a tighter budget, you can work around this by limiting the email fetch to subject lines and first paragraphs only — that fits in a smaller context and still gives Claude enough to score and summarize.

Is it safe to give Claude access to my Gmail?

Catch up on Hermes — free 60-minute live workshop
The free Hermes Agent crash courseReserve your spot

The setup described here uses OAuth 2.0 with a read-only scope (gmail.readonly). Claude Code can read your emails but cannot send, delete, or modify anything. Your credentials are stored locally, not transmitted to any third-party server. That said, you’re still granting an AI model access to your inbox contents — use judgment about whether that’s appropriate for the account you choose. Many people use a dedicated email account just for newsletters, which sidesteps the concern entirely.

Can I use this with newsletters that arrive as RSS feeds instead of email?

Yes, with a small modification. There are MCP servers for RSS as well. You’d replace the Gmail MCP calls with RSS MCP calls and point them at your feed URLs. The scoring and post generation logic stays exactly the same. If you subscribe to newsletters via both email and RSS, you can run both MCP servers in parallel and merge the results before scoring.

How do I stop the skill from drafting posts about stories I’ve already written about?

Add a memory layer. The simplest approach is to have the skill write a log file listing story headlines it’s processed. On each run, it reads the log first and skips any story whose headline appears there. Claude Code can read and write local files natively, so this doesn’t require any additional tools. For a more robust solution, you could store the log in a database or Notion page and query it at the start of each run.

Can I adapt this workflow to monitor competitor announcements instead of newsletters?

Absolutely. Swap the Gmail filter from newsletter senders to sender domains (e.g., @openai.com, @anthropic.com, press release distribution services like PR Newswire). The scoring criteria would shift too — you’d weight “Competitive relevance” over “LinkedIn engagement potential.” The same Claude Code + Gmail MCP infrastructure handles it with just instruction changes.


Key Takeaways

  • Claude Code’s Ultra mode combined with Gmail MCP gives you programmatic access to your inbox for filtering, scoring, and summarizing newsletter content on a schedule.
  • The skill architecture is straightforward: a Markdown instruction file that calls Gmail MCP tools, scores stories against defined criteria, and outputs a digest plus LinkedIn post drafts.
  • Sender filtering and deduplication are the two most important quality controls — get those right and the rest of the output improves significantly.
  • Scheduling via cron or GitHub Actions makes the digest genuinely hands-off.
  • If you want the same workflow without local server configuration, MindStudio’s visual automation builder connects to Gmail natively and runs the same kind of agent logic as a scheduled background task.

The underlying pattern here — read from a source, score against criteria, draft content — applies well beyond newsletters. Once you have the infrastructure working, adapting it to monitor Reddit threads, Hacker News, or industry forums is mostly a matter of swapping the data source and adjusting the scoring weights.

Related Articles

How to Build an AI Video Production Workflow with Claude Code and HeyGen MCP

Use Claude Code with HeyGen's MCP to automate script writing, voice cloning, avatar rendering, and video editing in a single agentic workflow.

Claude Workflows Automation

How to Build a Team Agentic Operating System with Claude Code and Notion

Build a shared AI operating system for your team using Claude Code, Notion, and GitHub with role-based access control and shared memory.

Claude Workflows Integrations

How to Build a Voice Agent with 11 Labs and Cal.com Booking Using Claude Code: 45-Minute Walkthrough

No API docs, no dashboard configuration. Claude Code reads the 11 Labs docs autonomously and builds a working voice booking agent in under an hour.

Claude Automation Integrations

Build a Voice Agent That Books Appointments in Under 1 Hour Using Claude Code and ElevenLabs

No API docs required. Claude Code reads the ElevenLabs docs, configures the agent, adds Cal.com booking tools, and embeds the widget for you.

Claude Automation Integrations

How to Build an Agentic Coding Workflow with Claude Code and Jira: A Full Walkthrough

Learn the complete agentic coding workflow: ideation, PRD creation, Jira ticket generation, PIV loop implementation, and system evolution using Claude Code.

Workflows Automation Claude

10 AI Agents for Healthcare Administration

AI agents for healthcare admin teams. Automate scheduling, documentation, and patient communications.

Workflows Automation Integrations

Presented by MindStudio

No spam. Unsubscribe anytime.