MCP server for reading and writing xlsx files on Google Drive
Project description
xlsx-drive-mcp
An MCP server that lets AI agents (Claude and others) read and write .xlsx files
stored on Google Drive. Fills the gap between Excel MCP servers (local files only)
and Google Drive MCP servers (native Google Sheets only).
Features
- Read/write cell values, formulas, formatting, charts
- Full sheet management (create, delete, rename, copy)
- Google Drive authentication with zero extra setup for existing workspace-mcp users
- Conflict detection on concurrent edits
Installation
pip install xlsx-drive-mcp
Requires Python 3.10+.
Authentication
Option A: Existing workspace-mcp users (zero extra setup)
If you already use workspace-mcp, credentials are reused automatically. Skip to Claude Config below.
Option B: Standalone setup
- Go to Google Cloud Console
- Create a project (or use an existing one)
- Enable the Google Drive API
- Create credentials: OAuth client ID → Desktop app
- Download the client ID and secret, then:
export GOOGLE_CLIENT_ID=your_client_id
export GOOGLE_CLIENT_SECRET=your_client_secret
xlsx-drive-mcp auth --user you@example.com
This opens a browser, completes the OAuth flow, and stores credentials at
~/.xlsx-drive-mcp/credentials/you@example.com.json.
Add to your global .gitignore:
~/.xlsx-drive-mcp/
Claude Config
{
"mcpServers": {
"xlsx-drive": {
"command": "xlsx-drive-mcp",
"args": ["--user", "your-actual-email@example.com"]
}
}
}
Replace your-actual-email@example.com with the email you authenticated with.
If you have only one credential file, --user can be omitted.
Scope note
- workspace-mcp users inherit workspace-mcp's scope, which is typically full Drive access.
- Standalone users get
drive.filescope -- access only to files this app created or opened. Withdrive.filescope,list_xlsx_filesonly returns files you've previously opened with this tool. To search all Drive files, use fulldrivescope or the workspace-mcp path.
Finding a folder_id
Open any Drive folder in your browser. The URL looks like:
https://drive.google.com/drive/folders/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74
The folder_id is the last segment: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74.
Important warnings
write_rangeover formula cells replaces formulas with static values.read_rangewithdata_only=true(default) returns cached values, not live formula results. Usedata_only=falseto get formula strings instead.copy_sheetsilently drops charts and images from the copied sheet (openpyxl limitation).delete_xlsxmoves the file to trash. The user has 30 days to recover it from Drive UI.
Tool reference
| Tool | Description |
|---|---|
list_xlsx_files |
Search Drive for xlsx files |
get_xlsx_info |
Sheet names, data dimensions, named ranges |
create_xlsx |
Create a new blank xlsx on Drive |
delete_xlsx |
Move an xlsx to trash |
list_sheets |
List all sheets |
create_sheet |
Add a new sheet |
delete_sheet |
Remove a sheet |
rename_sheet |
Rename a sheet |
copy_sheet |
Duplicate a sheet (drops charts/images) |
read_range |
Read cell values |
write_range |
Write cell values |
append_rows |
Append rows below last data |
clear_range |
Clear values, preserve formatting |
read_format |
Read cell formatting (colors, bold, borders) |
format_range |
Apply formatting to a range |
set_column_width |
Set column widths |
set_row_height |
Set row heights |
merge_cells |
Merge a cell range |
unmerge_cells |
Unmerge a cell range |
create_chart |
Create a bar, line, pie, or scatter chart |
write_formula |
Write a formula to a single cell |
Troubleshooting
MCP server won't start / tool not found: Claude Desktop launches MCP servers as background processes with no visible output. To see server logs, run the server manually:
xlsx-drive-mcp --user your@email.com
Any errors will appear in the terminal.
list_xlsx_files returns no results:
With drive.file scope, only files this app created or previously opened are visible.
Use get_xlsx_info(file_id) directly with a known file_id from the Drive URL instead.
Shared Drive / Team Drive: Not officially tested in v1. May work; not supported. Open an issue if you test it.
Service accounts: Not supported in v1. Tracked as a roadmap item.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xlsx_drive_mcp-0.1.1.tar.gz.
File metadata
- Download URL: xlsx_drive_mcp-0.1.1.tar.gz
- Upload date:
- Size: 58.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
425a88987a991124f077853706ea9c99d6c3a03ceb2a4412f30c50d9bc0a5157
|
|
| MD5 |
454f4e1bb77c49fcfe4d4aad09adcd02
|
|
| BLAKE2b-256 |
b86356d1af84fd8c0ce710a8cdcdde5c9e5494d28af37b227dcde12d49b7de43
|
Provenance
The following attestation bundles were made for xlsx_drive_mcp-0.1.1.tar.gz:
Publisher:
publish.yml on azhang4216/xlsx-drive-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xlsx_drive_mcp-0.1.1.tar.gz -
Subject digest:
425a88987a991124f077853706ea9c99d6c3a03ceb2a4412f30c50d9bc0a5157 - Sigstore transparency entry: 2195402928
- Sigstore integration time:
-
Permalink:
azhang4216/xlsx-drive-mcp@c49675e47049e5f6f14a6ac85fda5e4f0776245a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/azhang4216
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49675e47049e5f6f14a6ac85fda5e4f0776245a -
Trigger Event:
push
-
Statement type:
File details
Details for the file xlsx_drive_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xlsx_drive_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a4e03feece59d1882729c10df0fc1827e39bc56b544480657e0311cd2b3187f
|
|
| MD5 |
c9bcf445e9ea49d335841aaf90498634
|
|
| BLAKE2b-256 |
7890bf374f5fe17c42abcb4626159198caaabb7e136665553f0c180b25241532
|
Provenance
The following attestation bundles were made for xlsx_drive_mcp-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on azhang4216/xlsx-drive-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xlsx_drive_mcp-0.1.1-py3-none-any.whl -
Subject digest:
9a4e03feece59d1882729c10df0fc1827e39bc56b544480657e0311cd2b3187f - Sigstore transparency entry: 2195402935
- Sigstore integration time:
-
Permalink:
azhang4216/xlsx-drive-mcp@c49675e47049e5f6f14a6ac85fda5e4f0776245a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/azhang4216
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49675e47049e5f6f14a6ac85fda5e4f0776245a -
Trigger Event:
push
-
Statement type: