carrot-mcp-office
Carrot MCP Office Server — Excel and Word automation via MCP.
Features
- Auto-backup: All modifications are automatically versioned to
%APPDATA%/carrot-mcp/office/ - Legacy format support: Automatically converts
.doc→.docxand.xls→.xlsxvia win32com (Windows) - Version history: Track and restore file versions
Tools
| Tool | Description |
|---|---|
version |
Get server version info and backup configuration |
Excel Tools
| Tool | Description |
|---|---|
workbook_metadata |
Get workbook metadata (sheet names, properties) |
workbook_grep |
Search for exact substring in cell values across all sheets (or specific sheet). Case-insensitive by default, or regex. |
create_sheet |
Create a new sheet |
rename_sheet |
Rename a sheet |
delete_sheet |
Delete a sheet |
insert_rows |
Insert rows into a sheet |
delete_rows |
Delete rows from a sheet |
insert_columns |
Insert columns into a sheet |
delete_columns |
Delete columns from a sheet |
read_range |
Read cell values from a range as Markdown table (format="markdown", default) or 2D array (format="json") |
write_range |
Write a 2D array to a range (supports formulas) |
copy_range |
Copy a range to another location |
delete_range |
Clear cell contents in a range |
read_chart |
Read chart information from a sheet |
write_chart |
Create a chart (bar, line, pie, scatter) |
format_range |
Format cells (font, color, alignment, merge/unmerge) |
All Excel tools accept .xls/.xlsx files (.xls auto-converted on Windows).
Word Tools
| Tool | Description |
|---|---|
inspect |
Inspect document structure (paragraph count, table count and dimensions, image count, styles used). |
get_table |
Read table content as Markdown table (default) or 2D array (format="json"). Supports row_range slicing. |
insert_para |
Insert paragraph(s) with multi-line (\n) or string list support |
modify_para |
Modify paragraph text |
format_para |
Format a paragraph (style, alignment, font) |
delete_para |
Delete a paragraph |
insert_table |
Insert a table with optional data |
modify_table |
Modify a table cell |
format_table |
Apply a table style |
delete_table |
Delete a table |
insert_image |
Insert an image |
delete_image |
Delete an inline image |
get_outline |
Get document outline as tree + flat list via OpenXML w:outlineLvl and bilingual heading recognition. Use flat array indices with get_content. |
get_content |
Get paragraphs, tables, and images by heading, section, or paragraph. Returns clean Markdown (format="markdown", default) or structured metadata for precision editing (format="json"). |
grep |
Search for exact substring or regex across paragraphs and table cells. Returns matches with heading path hierarchy, table header, and row data. |
All Word tools accept .doc/.docx files (.doc auto-converted on Windows).
Backup Tools
| Tool | Description |
|---|---|
backup_history |
List all backup versions of a file |
backup_restore |
Restore a file to a specific backup version |
Backup System
Backups are stored in %APPDATA%/carrot-mcp/office/ with mirrored directory structure:
%APPDATA%/carrot-mcp/office/
├── _last_modified.txt
├── D/
│ └── docs/
│ └── reports/
│ ├── _versions.json
│ ├── file_v001.xlsx
│ ├── file_v002.xlsx
│ └── ...
- Auto-versioning: Every modification creates a new version
- 100 version limit: Old versions are pruned when exceeded
- 14-day expiry: Versions older than 14 days are automatically deleted
- Version numbers: Each mutation returns a
versionnumber in the result for LLM context
Configuration
| Environment Variable | Default | Description |
|---|---|---|
CARROT_MCP_BACKUP_MAX_VERSIONS |
100 |
Max versions to keep per file |
CARROT_MCP_BACKUP_MAX_AGE_DAYS |
14 |
Days before auto-deletion |
CARROT_MCP_BACKUP_ROOT |
%APPDATA%/carrot-mcp/office/ |
Override backup root directory |
Legacy Format Conversion
When you pass a .doc or .xls file path, the server automatically:
- Detects the legacy format
- If a
.docx/.xlsxwith the same name already exists in the same directory, reuses it directly (skips conversion) - Otherwise converts via win32com (preserves original file)
- Operates on the
.docx/.xlsxformat
Requires pywin32 on Windows. Returns error on other platforms.
Usage
# Standalone
uv run carrot-mcp office
# Via main CLI
uv run carrot-mcp office
Metadata
Release files for carrot-mcp-office 0.2.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| carrot_mcp_office-0.2.11.tar.gz | 18.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| carrot_mcp_office-0.2.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.2 kB
Release files / carrot_mcp_office-0.2.11.tar.gz
| Download URL | carrot_mcp_office-0.2.11.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b5142fc26c29f3aef452ea66d37b3da2c659efe4ef82b3460939b8b1d053cb1
|
|
BLAKE2b-256 checksum How to use checksums |
7dbfca69f910b6763cca1654b8f34143be4a951712dba3d4857e92e312d51598
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / carrot_mcp_office-0.2.11-py3-none-any.whl
| Download URL | carrot_mcp_office-0.2.11-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ab89ef956b8251d9d9e2ac3ab249838c00f1b65bc8cebc927b912cd30c26e22
|
|
BLAKE2b-256 checksum How to use checksums |
d985f790399aebe25af2fc037cc5f609542fe4bf3a74d8d40c974a480e1fa2a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for carrot-mcp-office 0.2.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.