Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Automating Google Sheets with Claude | Spreadsheets, Budgets & Reports
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Agentic AI for Automating Daily Office Tasks with Anthropic Claude

bookAutomating Google Sheets with Claude

Let's set up the Google Sheets MCP.

Prepare Google Cloud Console

Create a New Project
expand arrow
  1. Open Google Cloud Console;
  2. Click current project name to access project selector (top left button);
  3. Select "New Project" and provide descriptive name (e.g., "sheets mcp agent");
  4. Pick your organisation. If you're using a personal Gmail, this field can have the value "No Organisation";
  5. Click Create;
  6. Wait for project creation and switch to new project.
API Activation
expand arrow
  1. From the left menu, go to APIs & Services β†’ Library;
  2. In the search field, type Google Sheets API, select the corresponding API, and click the Enable button;
  3. Then, go to Library in left menu, search for Google Drive API, select the corresponding API and enable it.
Configure OAuth Consent Screen
expand arrow
  1. Navigate to the "Credentials" tab;
  2. If prompted, click "Configure consent screen";
  3. Click "Get started";
  4. Enter application name (e.g., "gsheet agent");
  5. Input your email address;
  6. Select "External Audience" for user type, if you use general Gmail account;
  7. Re-enter your email address when prompted;
  8. Accept the user data policy;
  9. Click Continue and Create.
Create OAuth Credentials
expand arrow
  1. Click "Create OAuth Client";
  2. Select "Desktop App" for local AI agents and scripts;
  3. Accept suggested naming or customize as needed;
  4. Download the JSON file and save it as credentials.json in your project directory;
  5. Now you need to move the file with credentials to the folder with the AI agent (/google_sheet_mcp). You can do that manually by moving the file icon to the opened folder in the file explorer;
  6. Use Claude with the Desktop MCP agent to move file:
Move the credentials.json file from Desktop into the new
Documents/projects/google_sheet_mcp folder

Confirm successful file transfer and remove from original location.

Update Config File

Update via Prompt
expand arrow

In Claude write:

Update config file with google_sheets_mcp server uvx mcp-google-sheet@latest.
Add environment variables CREDENTIALS_PATH and TOKEN_PATH
(same as CREDENTIALS_PATH, but pointing to token.json)
Restart Claude
expand arrow
  • Fully exit Claude Desktop. (Mac: Cmd + Q; Windows: Alt + F4);
  • Reopen Claude to finish the MCP launch.

Test the Google Sheets MCP

Test the MCP
expand arrow
  • Reopen Claude;
  • Now you can test the new Google Sheets AI agent. Here is the CSV file used in the video, along with a prompt example:
Create a new Google Sheet, build a pivot table that groups the data
by the product column, summarise the total quantity and the total
revenue for each product. Use the most recent
/Downloads/sales_dataset_large.csv file.
Use Python libraries to analyse this file.
  • Claude will analyze the file and generate a new Google Sheet in your Drive.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain what the Google Sheets MCP Server does in simple terms?

What are the main steps to set up the Google Sheets MCP Server?

How do I know if the setup was successful?

bookAutomating Google Sheets with Claude

Swipe to show menu

Let's set up the Google Sheets MCP.

Prepare Google Cloud Console

Create a New Project
expand arrow
  1. Open Google Cloud Console;
  2. Click current project name to access project selector (top left button);
  3. Select "New Project" and provide descriptive name (e.g., "sheets mcp agent");
  4. Pick your organisation. If you're using a personal Gmail, this field can have the value "No Organisation";
  5. Click Create;
  6. Wait for project creation and switch to new project.
API Activation
expand arrow
  1. From the left menu, go to APIs & Services β†’ Library;
  2. In the search field, type Google Sheets API, select the corresponding API, and click the Enable button;
  3. Then, go to Library in left menu, search for Google Drive API, select the corresponding API and enable it.
Configure OAuth Consent Screen
expand arrow
  1. Navigate to the "Credentials" tab;
  2. If prompted, click "Configure consent screen";
  3. Click "Get started";
  4. Enter application name (e.g., "gsheet agent");
  5. Input your email address;
  6. Select "External Audience" for user type, if you use general Gmail account;
  7. Re-enter your email address when prompted;
  8. Accept the user data policy;
  9. Click Continue and Create.
Create OAuth Credentials
expand arrow
  1. Click "Create OAuth Client";
  2. Select "Desktop App" for local AI agents and scripts;
  3. Accept suggested naming or customize as needed;
  4. Download the JSON file and save it as credentials.json in your project directory;
  5. Now you need to move the file with credentials to the folder with the AI agent (/google_sheet_mcp). You can do that manually by moving the file icon to the opened folder in the file explorer;
  6. Use Claude with the Desktop MCP agent to move file:
Move the credentials.json file from Desktop into the new
Documents/projects/google_sheet_mcp folder

Confirm successful file transfer and remove from original location.

Update Config File

Update via Prompt
expand arrow

In Claude write:

Update config file with google_sheets_mcp server uvx mcp-google-sheet@latest.
Add environment variables CREDENTIALS_PATH and TOKEN_PATH
(same as CREDENTIALS_PATH, but pointing to token.json)
Restart Claude
expand arrow
  • Fully exit Claude Desktop. (Mac: Cmd + Q; Windows: Alt + F4);
  • Reopen Claude to finish the MCP launch.

Test the Google Sheets MCP

Test the MCP
expand arrow
  • Reopen Claude;
  • Now you can test the new Google Sheets AI agent. Here is the CSV file used in the video, along with a prompt example:
Create a new Google Sheet, build a pivot table that groups the data
by the product column, summarise the total quantity and the total
revenue for each product. Use the most recent
/Downloads/sales_dataset_large.csv file.
Use Python libraries to analyse this file.
  • Claude will analyze the file and generate a new Google Sheet in your Drive.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 1
some-alt