google-drive-mcp
Google Drive MCP Server
Servidor MCP local em Python para ler/escrever Google Sheets, Slides e Drive a partir de sessões do Claude Code.
Como funciona
O servidor usa OAuth 2.0 Desktop App do GCP. No primeiro uso, abre o navegador para o fluxo de consentimento. Após aprovado, salva um token.json local. Nas execuções seguintes, reutiliza o token e o renova automaticamente quando expira — sem precisar abrir o navegador novamente.
Arquivos de autenticação:
Arquivo | O que é |
| Credenciais do app OAuth baixadas do GCP Console |
| Token de acesso gerado após o primeiro login (renovado automaticamente) |
Related MCP server: google-workspace-mcp-with-script
Configuração inicial (primeira vez)
1. Credenciais GCP
Acesse GCP Console → APIs & Services → Credentials
Crie um OAuth 2.0 Client ID (tipo: Desktop App)
Baixe o JSON e salve como
credentials.jsonnesta pastaHabilite as APIs no projeto GCP:
Google Sheets API
Google Slides API
Google Drive API
2. Instalar dependências
Windows (PowerShell):
cd "C:\Users\<usuario>\Documents\MCP_Servers\googleDrive"
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtmacOS / Linux:
cd ~/Documents/MCP_Servers/googleDrive
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt3. Primeiro login (OAuth)
Execute manualmente para abrir o navegador e autorizar:
Windows:
.venv\Scripts\activate
python main.pymacOS / Linux:
source .venv/bin/activate
python main.pyApós aprovar no navegador, token.json é criado e o servidor sobe. Pode encerrar com Ctrl+C — o token fica salvo para os próximos usos.
Registrar no Claude Code
Há duas formas de registrar o servidor MCP:
Opção A — Por projeto (.mcp.json)
Cria um arquivo .mcp.json na raiz do projeto. O MCP fica ativo apenas naquele projeto.
Windows:
{
"mcpServers": {
"google-drive": {
"type": "stdio",
"command": "C:\\Users\\<usuario>\\Documents\\MCP_Servers\\googleDrive\\.venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\<usuario>\\Documents\\MCP_Servers\\googleDrive\\main.py"
]
}
}
}macOS / Linux:
{
"mcpServers": {
"google-drive": {
"type": "stdio",
"command": "/Users/<usuario>/Documents/MCP_Servers/googleDrive/.venv/bin/python",
"args": [
"/Users/<usuario>/Documents/MCP_Servers/googleDrive/main.py"
]
}
}
}Opção B — Global para o usuário (~/.claude/settings.json)
Adiciona o MCP nas configurações globais do Claude Code — fica disponível em todos os projetos.
Edite ~/.claude/settings.json (Windows: C:\Users\<usuario>\.claude\settings.json) e adicione a chave mcpServers:
Windows:
{
"mcpServers": {
"google-drive": {
"type": "stdio",
"command": "C:\\Users\\<usuario>\\Documents\\MCP_Servers\\googleDrive\\.venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\<usuario>\\Documents\\MCP_Servers\\googleDrive\\main.py"
]
}
}
}macOS / Linux:
{
"mcpServers": {
"google-drive": {
"type": "stdio",
"command": "/Users/<usuario>/Documents/MCP_Servers/googleDrive/.venv/bin/python",
"args": [
"/Users/<usuario>/Documents/MCP_Servers/googleDrive/main.py"
]
}
}
}Use a Opção A quando o MCP é específico de um projeto. Use a Opção B quando quiser acesso em qualquer projeto.
Variáveis de ambiente (opcional)
Por padrão, o servidor procura credentials.json e token.json na própria pasta. Para mudar os caminhos, crie um .env baseado no .env.example:
GOOGLE_CREDENTIALS_PATH=credentials.json
GOOGLE_TOKEN_PATH=token.jsonFerramentas disponíveis (17 tools)
Google Sheets (7)
Tool | Descrição |
| Lê valores de um intervalo de células |
| Escreve valores em um intervalo |
| Adiciona linhas ao final dos dados |
| Escreve em múltiplos intervalos de uma vez |
| Retorna metadados (título, abas) |
| Cria nova planilha |
| Adiciona uma aba à planilha |
Google Slides (7)
Tool | Descrição |
| Retorna estrutura e títulos dos slides |
| Retorna textos e formas de um slide |
| Adiciona novo slide |
| Insere texto em uma forma |
| Localiza e substitui texto |
| Remove um slide |
| Executa batch raw da API |
Google Drive (3)
Tool | Descrição |
| Lista/filtra arquivos (por tipo, query) |
| Busca arquivos por nome |
| Retorna metadados detalhados de um arquivo |
Todos os tools aceitam ID direto ou URL completa do Google:
1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upmshttps://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms/edit
Troubleshooting
invalid_grant / token expirado sem auto-renovar
Delete o token.json e rode python main.py novamente para refazer o fluxo OAuth.
Windows:
Remove-Item ".\token.json"
python main.pymacOS / Linux:
rm token.json
python main.pyAPI não habilitada
Verifique se as três APIs estão ativas no GCP Console: Google Sheets API, Google Slides API, Google Drive API.
MCP não aparece no Claude Code
Verifique se o caminho do executável Python está correto:
Windows:
.venv\Scripts\python.exemacOS/Linux:
.venv/bin/python
Use o caminho absoluto no .mcp.json ou settings.json — caminhos relativos não funcionam.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceMCP server that enables Claude to interact with Google Workspace services including Drive, Docs, Sheets, Slides, Calendar, Gmail, and Contacts.43438MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Claude Code CLI that integrates with Google Workspace, enabling management of Docs, Sheets, Drive, Gmail, Calendar, and Apps Script.92MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Google Drive, Docs, and Sheets — built for Claude Code. Gives Claude Code direct read/write access to Google Sheets (cell-level edits, formatting, structure), Google Docs (insert, replace, append), and Drive (search).521MIT
- AlicenseNot gradedqualityBmaintenanceA local MCP server that lets Claude read and write Google Sheets through the Google Sheets API v4, using OAuth2 authentication with your own Google account.261MIT
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JovemDaniel/google-drive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server