Enables loading datasets from Google Drive files and exporting analysis reports back to Drive folders with support for various file formats and permissions management
Allows direct loading and analysis of data from Google Sheets spreadsheets using spreadsheet IDs with configurable header options
Provides comprehensive data analysis capabilities including schema inference, missing data reports, statistical profiling, correlation analysis, outlier detection, and groupby operations on datasets
dataframe-analyst-mcp
Servidor MCP (y CLI) para analizar datasets (CSV/XLS/XLSX/Google Sheets/Google Drive) y exportar reportes (md/json/html) a local o Google Drive.
Características
- Carga desde: local (
path
), Drive (fileId
), Sheets (spreadsheetId
). - Herramientas:
infer_schema
,missing_report
,profile
(conp25/p50/p75
),correlation
,detect_outliers
,groupby
. - Exporta reportes a local o Drive (
folderId
).
Requisitos
- Python 3.11 (recomendado)
- Dependencias:
pandas
,openpyxl
,xlrd==1.2.0
,gspread
,google-auth
,google-auth-oauthlib
,google-api-python-client
,pydrive2
.
Credenciales
Service Account (SA) – lectura y acceso a Sheets/Drive
- Crea una Service Account en Google Cloud, habilita Drive API y Sheets API.
- Descarga la key JSON en
secrets/sa.json
(no subir a git). - Exporta la variable:
- Comparte tu Sheet y carpeta de Drive con el correo de la SA (con
@
).
OAuth Desktop (fallback para subir a Mi unidad)
Las SA no tienen cuota en Mi unidad. Para subir, el servidor usa fallback OAuth:
- En OAuth consent screen: tipo External y agrega tu correo en Test users.
- Crea OAuth Client ID tipo Desktop y guarda
secrets/client_secret.json
. - (Opcional)
La primera subida abrirá el navegador y guardará
token.json
.
Uso rápido (CLI)
Ejemplos de comandos:
Modo MCP (STDIO)
Configura tu host/cliente MCP para lanzar el server por stdio:
Solución de problemas
- 403 insufficientPermissions → Comparte Sheet/carpeta con el correo de la SA.
- 404 notFound → Revisa
fileId
/folderId
/spreadsheetId
y permisos. - 403 storageQuotaExceeded (SA) → Sube con OAuth Desktop (ya soportado como fallback) o usa Unidad compartida.
- App no verificada / access_denied (OAuth) → En OAuth consent screen usa External, agrega tu correo como Test user y añade scopes (
drive.file
odrive
). - Worksheet not found (XLSX) → Usa
"sheet":0
o el nombre exacto de la hoja.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables analysis of datasets from CSV/Excel files, Google Sheets, and Google Drive with comprehensive data profiling tools including schema inference, missing value reports, correlation analysis, and outlier detection. Supports exporting analytical reports in multiple formats to local storage or Google Drive.