mcp-sk2gdrive
Enables Google Drive file operations (list, search, read, create) via MCP using OAuth2 authentication with token persistence.
README
Google Drive MCP Server (Python + SQLite)
Servidor MCP (Model Context Protocol) em Python para integração com o Google Drive API. Possui persistência local de credenciais OAuth 2.0 em banco SQLite e renovação automática de tokens.
Propósito e Isenção de Responsabilidade (Disclaimer)
- Propósito: Este projeto foi desenvolvido exclusivamente para fins educacionais, de pesquisa, prototipagem e auxílio a Desenvolvedores de Software, Engenheiros de Software e Engenheiros de IA na criação de PoCs (Prova de Conceito) e integrações locais com agentes de IA.
- Isenção de Responsabilidade: O autor não se responsabiliza pelo mau uso, vazamento de credenciais feito por terceiros, perda de dados ou utilização indevida das APIs. Cada desenvolvedor é inteiramente responsável por suas próprias credenciais OAuth e pelo cumprimento dos Termos de Serviço da Google API.
- Vínculo: Este projeto é um utilitário open-source independente e não possui qualquer vínculo, afiliação ou endosso oficial por parte do Google LLC ou da Anthropic.
Arquitetura
- Engine: FastMCP (
mcp.server.fastmcp) - API Target: Google Drive API (
googleapiclient) - Storage: SQLite (
auth.db) para credenciais OAuth (access token, refresh token, expiry) - Transport: Standard IO (stdio)
Requisitos
- Python 3.10+
- Credencial de aplicativo no Google Cloud Console (OAuth 2.0 Client ID do tipo Desktop App)
Instalação
python -m venv venv
# Windows:
.\venv\Scripts\Activate.ps1
# Linux/macOS:
source venv/bin/activate
pip install -r requirements.txt
Autenticação
Execute o fluxo de autenticação via CLI:
python auth_flow.py
O script solicita o Client ID e Client Secret, abre o servidor local na porta 8080 para o consentimento OAuth no navegador e persiste as credenciais no arquivo auth.db.
Configuração do Cliente MCP
Adicione o servidor no arquivo de configuração do seu cliente (ex: claude_desktop_config.json):
{
"mcpServers": {
"gdrive": {
"command": "C:/caminho/para/seu/projeto/venv/Scripts/python.exe",
"args": [
"C:/caminho/para/seu/projeto/server.py"
]
}
}
}
Nota: Substitua
C:/caminho/para/seu/projeto/pelo caminho absoluto da pasta do projeto em seu sistema.
Tools Disponíveis
check_auth_status: Retorna o status da autenticação e informações da conta conectada.list_files(folder_id="root", page_size=20, query=""): Lista arquivos e subpastas.search_files(query_string="", page_size=20): Executa busca por nome de arquivo.get_file_metadata(file_id): Retorna metadados detalhados de um arquivo em formato JSON.read_text_file(file_id): Obtém o conteúdo de texto de um arquivo ou exporta Google Docs para texto plano.create_file(name, content, folder_id="root", mime_type="text/plain"): Cria um novo arquivo no Drive.logout(): Remove as credenciais salvas no banco SQLite.
Testes
Para validar a execução de todas as ferramentas localmente:
python test_tools.py
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.