Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Automating Google Sheets with Claude | Spreadsheets, Budgets & Reports
Agentisk KI for Automatisering av Daglige Kontoroppgaver

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.
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 1

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain the steps to prepare the Google Cloud Console?

What should I update in the config file?

How do I test the Google Sheets MCP?

Awesome!

Completion rate improved to 8.33

bookAutomating Google Sheets with Claude

Sveip for å vise menyen

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.
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 1
some-alt