Skip to main content
MindStudio
Pricing
Blog About
My Workspace

How to Use MCP Servers to Connect Claude Code to Notion, Gmail, and More

Model Context Protocol servers let Claude Code read and write data in your actual apps. Learn how to connect Notion, Gmail, and other tools in minutes.

MindStudio Team RSS
How to Use MCP Servers to Connect Claude Code to Notion, Gmail, and More

What MCP Servers Actually Do for Claude Code

Claude Code is a capable AI agent on its own. But on its own, it only knows what you tell it in a prompt or what it can read from your local filesystem. It has no access to your Notion workspace, your Gmail inbox, your CRM, or anything else that lives outside your terminal.

MCP servers fix that. The Model Context Protocol is an open standard that lets Claude Code connect to external services and interact with them in real time — reading data, writing updates, triggering actions. Think of each MCP server as a bridge: one end plugs into Claude Code, the other end plugs into a specific app or API.

If you’re new to the concept, what MCP servers are and how they work is worth reading before you go further. This article assumes basic familiarity and focuses on the practical setup.

Once you have a Notion MCP server running, you can ask Claude Code to “read my project tracker database and summarize what’s overdue.” Once you have a Gmail MCP server running, you can ask it to “find all emails from contractors this month and extract the invoice totals.” These aren’t hypothetical. They work today.

Here’s how to set it up.


Prerequisites Before You Start

You don’t need to be a developer to get this working, but you do need a few things in place.

Required:

  • Claude Code installed (available via Anthropic’s CLI)
  • Node.js 18 or higher on your machine
  • A terminal you’re comfortable using
  • API keys or OAuth credentials for the services you want to connect

Helpful to understand:

  • MCP servers run as local processes on your machine. Claude Code talks to them over a standard interface (usually stdio). The server handles the actual API calls to the external service.
  • Most MCP servers are open source and installable via npm or by cloning a GitHub repo.
  • Each server gets declared in a config file that Claude Code reads at startup.

If you want a deeper technical understanding of the read/write data flow, how to use MCP servers with Claude Code covers the architecture in detail.


Step 1: Set Up Your Claude Code MCP Config File

Claude Code looks for MCP server configurations in a file called claude_desktop_config.json. On macOS, this lives at:

~/Library/Application Support/Claude/claude_desktop_config.json

On Windows, it’s at:

%APPDATA%\Claude\claude_desktop_config.json

If the file doesn’t exist yet, create it. The basic structure looks like this:

{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["/path/to/mcp-server/index.js"],
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}

You’ll add one entry per MCP server you want to connect. The command tells Claude Code how to start the server process. The env block passes credentials without hardcoding them into your prompts.

After editing the config, restart Claude Code completely. It reads the config at startup, so changes don’t take effect until you do.


Step 2: Connect Notion to Claude Code

Notion has an officially maintained MCP server. Here’s how to get it running.

Get a Notion Integration Token

  1. Go to notion.so/my-integrations and create a new integration.
  2. Give it a name (e.g., “Claude Code”), select your workspace, and set the appropriate capabilities (read content, update content, insert content — depending on what you want Claude to do).
  3. Copy the Internal Integration Token. This is your API key.

Share Pages with Your Integration

Notion uses a permission model where integrations can only access pages explicitly shared with them. For each page or database you want Claude Code to reach:

  1. Open the page in Notion.
  2. Click ”…” in the top right → “Add connections.”
  3. Select your integration.

If you skip this step, the MCP server will authenticate fine but return empty results. This trips up a lot of people.

Install and Configure the Notion MCP Server

Install the official Notion MCP server:

npm install -g @notionhq/notion-mcp-server

Then add it to your config:

{
  "mcpServers": {
    "notion": {
      "command": "notion-mcp-server",
      "env": {
        "NOTION_API_KEY": "secret_your_token_here"
      }
    }
  }
}

Restart Claude Code and test it with a simple prompt: “List all databases in my Notion workspace.”

What You Can Do Once Connected

With the Notion MCP server active, Claude Code can:

  • Query databases with filters (e.g., “show all tasks assigned to me with status In Progress”)
  • Create new pages or database entries
  • Update existing page content or properties
  • Search across your entire workspace
  • Read page content and summarize it

A practical example: ask Claude Code to “pull all project database entries where deadline is this week, and create a markdown summary sorted by priority.” It’ll fetch the data, process it, and output exactly that.


Step 3: Connect Gmail to Claude Code

Gmail access requires OAuth 2.0, which is a bit more involved than a simple API key. There are a few routes here depending on your comfort level.

Option A: Use the Google Workspace MCP Server

The most comprehensive option is the Google Workspace MCP server, which covers Gmail, Google Calendar, Google Drive, and Docs in one setup. If you’re connecting more than just Gmail, this is the better choice.

The setup process involves creating a Google Cloud project, enabling the Gmail API, creating OAuth credentials, and running an authorization flow. The full walkthrough is covered in using the Google Workspace CLI with Claude Code for workspace automation.

Option B: Use a Dedicated Gmail MCP Server

For Gmail only, there are community-maintained MCP servers that handle the OAuth flow more simply. The gmail-mcp-server package (available on npm) walks you through a one-time browser-based auth flow and stores credentials locally.

npm install -g gmail-mcp-server
npx gmail-mcp-server auth

The auth command opens a browser window, asks you to sign in with Google, and saves the refresh token to your local config. After that, add it to your Claude Code config:

{
  "mcpServers": {
    "gmail": {
      "command": "gmail-mcp-server",
      "env": {
        "GMAIL_CREDENTIALS_PATH": "/path/to/credentials.json"
      }
    }
  }
}

What You Can Do Once Connected

With Gmail connected, Claude Code can:

  • Search your inbox using Gmail’s query syntax
  • Read full email threads
  • Extract structured data from email content
  • Draft and send emails (if write permissions are granted)
  • Label and archive messages
  • Monitor specific senders or subjects

The AI email parsing and data extraction use case is particularly powerful here. You can tell Claude Code to “scan emails from our invoicing address this week, extract vendor name, amount, and due date from each one, and output a CSV.” It reads the emails, parses them with Claude’s natural language understanding, and formats the output.


Step 4: Connect Other Common Tools

Notion and Gmail are good starting points, but the MCP ecosystem covers a wide range of tools. Here’s a quick reference for other popular integrations.

GitHub

The official GitHub MCP server lets Claude Code interact with repositories, issues, pull requests, and actions directly. Useful for querying “all open PRs older than 7 days” or automatically creating issues from a list.

"github": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
  }
}

Slack

Slack’s MCP integration lets Claude Code read channel messages, post to channels, and search conversations. Slack’s own MCP client has expanded what’s possible here. Combined with Claude Code, you can do things like “summarize the last 48 hours of #product-updates and draft a status email.”

Airtable

Airtable’s MCP server exposes your bases and tables as queryable data sources. Claude Code can read records, create new entries, and update fields. This is particularly useful for connecting AI agents to Airtable for automated data workflows where you want Claude to both process data and write results back.

Linear, Jira, and ClickUp

Task management tools have active MCP server communities. These let Claude Code read project boards, create tasks from natural language, and update ticket statuses. For a concrete use case, building an AI company research agent with Claude Code and ClickUp shows how this works end to end.

Google Sheets

The Google Workspace MCP server includes Sheets access. You can ask Claude Code to read a spreadsheet, perform analysis, and write results back — all in one session. See automating Google Sheets with AI-powered workflows for workflow ideas.


Step 5: Run Multiple MCP Servers Together

The real usefulness appears when you chain multiple MCP servers in a single Claude Code session. Your config can have as many server entries as you need:

{
  "mcpServers": {
    "notion": { ... },
    "gmail": { ... },
    "github": { ... },
    "slack": { ... }
  }
}

With all four running, a prompt like this becomes possible: “Check Gmail for any emails from our design agency this week, pull the related project from Notion, create a GitHub issue for any action items mentioned, and post a summary to #design in Slack.”

Claude Code will orchestrate across all four services in sequence, calling the right MCP tools at each step. You’re describing a workflow in plain language and Claude handles the execution.

This is the foundation of what agentic business operating systems built on Claude Code are built on — multiple tool connections working together under a single agent.


Token Overhead: What to Watch

Running multiple MCP servers means Claude Code has access to more tools. That’s good for capability. But every tool definition gets added to Claude’s context window, and that has real cost implications.

Each MCP server exposes a list of “tools” — callable functions with names, descriptions, and parameter schemas. When you start a Claude Code session with several servers active, all those tool definitions get loaded into context. A single server might add 2,000–8,000 tokens depending on how many tools it exposes.

With five or six servers running, you can easily add 20,000+ tokens of overhead before you’ve written a single prompt. This matters for:

  • Cost — More tokens in context means higher API costs per session.
  • Speed — Larger context windows take longer to process.
  • Performance — Too many tools can confuse the model about which one to use.

The practical approach: only activate the MCP servers you actually need for a given task. You can have a “full” config and a “lightweight” config, switching between them depending on what you’re doing. Claude Code MCP servers and token overhead covers this in detail with specific numbers.


Common Problems and How to Fix Them

Claude says a tool isn’t available. Either the MCP server isn’t running (check your config file syntax — JSON is unforgiving about trailing commas), or you forgot to restart Claude Code after editing the config.

Authentication errors. For Notion, double-check that you’ve shared the specific pages with your integration. For Gmail/Google, refresh tokens expire if you don’t use them for six months — re-run the auth flow.

Empty results from Notion. Integration permissions need to be set per-page, not workspace-wide. You need to manually share each database you want Claude to access.

MCP server crashes on startup. Check your Node.js version (node --version). Most MCP servers require Node 18+. Also verify that environment variables in your config are correctly quoted.

Claude using the wrong tool. If you have overlapping capabilities across servers (e.g., both a Notion server and a generic “create document” tool), Claude might pick the wrong one. Be specific in your prompts: “Using the Notion MCP server, create a new page in my Projects database.”


Where Remy Fits in This Picture

MCP servers solve the connectivity problem. They give Claude Code real-time access to your tools. But they don’t solve the application layer problem: once you’ve connected to Notion and Gmail, what do you actually build with that access?

If you want to turn a Claude Code + MCP setup into a real deployable application — something with a UI, a database, authentication, and consistent behavior — that’s where Remy comes in.

Remy compiles a spec (annotated markdown describing what your app does) into a full-stack application: backend, database, auth, frontend, deployment. You describe the application behavior in plain language with annotations, and Remy produces the working code.

For example: instead of manually triggering Claude Code every morning to check your Gmail and update Notion, you could describe that workflow as a spec and let Remy build a scheduled application that runs it automatically, logs results to a database, and shows a dashboard. The MCP connections are part of the backend methods. The spec describes the business logic. The code is compiled output you don’t have to maintain by hand.

It’s a different level of abstraction — from “run this agent on demand” to “build an application that does this on a schedule with a real UI and data layer.” You can try Remy at mindstudio.ai/remy.


Frequently Asked Questions

What is an MCP server and why does Claude Code need one?

An MCP server is a small program that implements the Model Context Protocol — an open standard for connecting AI agents to external services. Claude Code needs MCP servers because it has no built-in access to third-party apps. Without a server, Claude can only work with data you paste into the prompt or files on your local machine. An MCP server gives it live read/write access to apps like Notion, Gmail, GitHub, or Slack.

Is it safe to give Claude Code access to my Gmail or Notion?

The MCP server runs locally on your machine. Your credentials (API keys, OAuth tokens) stay on your device — they’re not sent to Anthropic. Claude Code uses the MCP server to make API calls to the external service on your behalf. This is roughly equivalent to giving a browser extension access to your Gmail: the data flows through your machine, not through a third party. That said, always review what permissions you’re granting when setting up OAuth flows.

Do I need to know how to code to set up MCP servers?

You need to be comfortable in a terminal — installing npm packages, creating JSON config files, and running auth commands. You don’t need to write any code. Most MCP servers are installed with one command and configured with a few lines of JSON. If you can follow a README, you can set these up.

How many MCP servers can I run at once?

As many as you want, but performance degrades with too many active at once. Each server adds tool definitions to Claude’s context window, which increases token usage and can slow down responses. A practical limit is 4–6 servers for general use. Beyond that, be selective about which ones you activate for a given session. You can maintain multiple config profiles and switch between them.

What’s the difference between an MCP server and a regular API integration?

A regular API integration requires you to write code that calls the API and handles the response. An MCP server wraps that API in a standard interface that Claude Code understands natively. The server exposes “tools” (callable functions) that Claude can invoke directly — no custom code required on your end. The trade-off is that MCP servers need to be maintained and updated when APIs change, and not every service has a high-quality MCP server available yet. For more on the architectural differences, the MCP server trap and agent-readable data is a useful read.

Can Claude Code write data back to Notion and Gmail, or just read?

Both, depending on the permissions you grant. The Notion MCP server supports creating pages, updating database properties, and adding content to existing pages. The Gmail MCP server (with write permissions enabled) can draft emails, send messages, apply labels, and archive threads. Always start with read-only permissions while testing, then add write access once you’re confident in what the agent will do.


Key Takeaways

  • MCP servers give Claude Code live read/write access to external apps like Notion, Gmail, GitHub, and Slack — without you writing any integration code.
  • Setup involves installing an MCP server package, adding credentials to a JSON config file, and restarting Claude Code.
  • Notion requires sharing specific pages with your integration; Gmail requires a one-time OAuth authorization flow.
  • Multiple MCP servers can run simultaneously, enabling Claude Code to orchestrate workflows across several tools in a single session.
  • Token overhead is real — each active server adds tool definitions to context, so only activate what you need for a given task.
  • For turning MCP-connected Claude Code workflows into deployable applications with a UI, database, and scheduled execution, Remy handles the full application layer from a spec.

Presented by MindStudio

No spam. Unsubscribe anytime.