SheetForge MCP for reading, writing, and reshaping Excel workbooks
Project description
SheetForge MCP
SheetForge MCP exposes .xlsx workbook operations over the Model Context Protocol. It uses openpyxl under the hood, so MCP clients can inspect and modify Excel files without launching Microsoft Excel or LibreOffice.
Package name: sheetforge-mcp
CLI command: sheetforge-mcp
What This Project Covers
- workbook creation and metadata
- worksheet creation, renaming, copying, and deletion
- structured reads, compact table reads, and cell search
- row, column, and range mutations
- formulas and validation checks
- formatting, merges, and conditional formatting
- native Excel tables, charts, and pivot summaries
stdio,streamable-http, and deprecatedssetransports
Requirements
- Python
3.10+ .xlsxworkbooks- either
uvxor a local package install
Quick Start
Stdio
Use stdio when the MCP client starts the server locally.
uvx sheetforge-mcp stdio
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": ["sheetforge-mcp", "stdio"]
}
}
}
Streamable HTTP
Use streamable-http when you want a long-running local or remote server process.
EXCEL_FILES_PATH=/path/to/excel-files uvx sheetforge-mcp streamable-http
Default endpoint:
http://127.0.0.1:8017/mcp
Example client config:
{
"mcpServers": {
"excel": {
"url": "http://127.0.0.1:8017/mcp"
}
}
}
SSE
SSE is kept for compatibility, but new integrations should prefer streamable-http.
EXCEL_FILES_PATH=/path/to/excel-files uvx sheetforge-mcp sse
Default endpoint:
http://127.0.0.1:8017/sse
File Path Rules
- In
stdiomode,filepathvalues must be absolute paths. - In
streamable-httpandssemode, relative paths are resolved underEXCEL_FILES_PATH. - Absolute paths are accepted in every transport.
- In
streamable-httpandssemode, the server createsEXCEL_FILES_PATHautomatically if it does not exist.
Environment Variables
| Variable | Default | Used by | Purpose |
|---|---|---|---|
FASTMCP_HOST |
127.0.0.1 |
HTTP and SSE | Bind address for the server process |
FASTMCP_PORT |
8017 |
HTTP and SSE | Port for the server process |
EXCEL_FILES_PATH |
./excel_files |
HTTP and SSE | Base directory for relative workbook paths |
Tooling Overview
The server currently registers 30 MCP tools across these groups:
- workbook overview:
create_workbook,create_worksheet,get_workbook_metadata,list_all_sheets - data access:
read_data_from_excel,read_excel_as_table,search_in_sheet,write_data_to_excel,append_table_rows,update_rows_by_key - worksheet and range changes:
copy_worksheet,delete_worksheet,rename_worksheet,copy_range,delete_range,insert_rows,insert_columns,delete_sheet_rows,delete_sheet_columns - formatting and layout:
format_range,merge_cells,unmerge_cells,get_merged_cells - formulas and validation:
apply_formula,validate_formula_syntax,validate_excel_range,get_data_validation_info - analysis and structure:
create_table,create_chart,create_pivot_table
The three most agent-friendly read tools are:
list_all_sheets: quick workbook inventory with sheet sizes and emptiness flagsread_excel_as_table: compactheaders + rowsoutput for structured datasetssearch_in_sheet: exact or partial value search across a worksheet
See TOOLS.md for the full reference.
Response Format
Every tool now returns a JSON envelope with a consistent top-level shape:
{
"ok": true,
"operation": "read_excel_as_table",
"message": "read_excel_as_table completed",
"data": {}
}
Error responses follow the same contract:
{
"ok": false,
"operation": "write_data_to_excel",
"error": {
"type": "DataError",
"message": "No data provided to write"
}
}
For destructive tools that support preview mode, the envelope may also include dry_run and changes.
Development
Install dependencies:
uv sync --extra dev
Run tests:
uv run --extra dev pytest -q
Run the package locally:
uv run sheetforge-mcp stdio
Release Flow
- GitHub releases run a build verification workflow only.
- PyPI publishing is a separate manual workflow, so releases do not create a failing deployment before Trusted Publisher is configured for the package.
Repository Layout
src/excel_mcp/server.py: MCP server, transport setup, and tool registrationsrc/excel_mcp/workbook.py: workbook lifecycle helpers and workbook metadatasrc/excel_mcp/data.py: read, write, table, and search helperssrc/excel_mcp/sheet.py: worksheet and range mutationstests/: regression tests for workbook handling and public behaviormanifest.json: packaged MCP bundle metadatadocs/index.html: static project landing page
Notes For Integrators
stdiomode is careful not to write non-protocol text tostdout.- All tools return structured JSON envelopes, which makes client-side parsing predictable.
read_data_from_excel(..., preview_only=True)limits the response to the first 10 rows in the selected range and marks the payload as truncated when applicable.- Core mutation tools support
dry_run=Trueso clients can preview changes before saving a workbook.
License
MIT. See LICENSE.
Project details
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 sheetforge_mcp-0.3.0.tar.gz.
File metadata
- Download URL: sheetforge_mcp-0.3.0.tar.gz
- Upload date:
- Size: 28.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 |
b0b6c928596c00e31a1df0eb7f0f0bfa1b3e715cfeba54f985b0208675b35dbc
|
|
| MD5 |
5fdb8b7c578a47bbb8ad2c3c629b217b
|
|
| BLAKE2b-256 |
b924f07d53fc47dbdc1ebb62329350667b4c96dae4531da45a7f11d49bc99255
|
Provenance
The following attestation bundles were made for sheetforge_mcp-0.3.0.tar.gz:
Publisher:
publish.yml on iHeldan/sheetforge-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sheetforge_mcp-0.3.0.tar.gz -
Subject digest:
b0b6c928596c00e31a1df0eb7f0f0bfa1b3e715cfeba54f985b0208675b35dbc - Sigstore transparency entry: 1249018397
- Sigstore integration time:
-
Permalink:
iHeldan/sheetforge-mcp@9c7a78737b4a7ea563df6a1295c46f1fe6e99eba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iHeldan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c7a78737b4a7ea563df6a1295c46f1fe6e99eba -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sheetforge_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: sheetforge_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 36.4 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 |
1d70dc08a0f0df93907f299b44dfb132f315e3771a38f05d41ca22c3d75374a0
|
|
| MD5 |
f3f16d531c5bc793bea8398e42acd755
|
|
| BLAKE2b-256 |
453c4937bf15e1c68887b073ed0853cb4d8bfc21f2bcbf0dda0ea15bb270a41d
|
Provenance
The following attestation bundles were made for sheetforge_mcp-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on iHeldan/sheetforge-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sheetforge_mcp-0.3.0-py3-none-any.whl -
Subject digest:
1d70dc08a0f0df93907f299b44dfb132f315e3771a38f05d41ca22c3d75374a0 - Sigstore transparency entry: 1249018865
- Sigstore integration time:
-
Permalink:
iHeldan/sheetforge-mcp@9c7a78737b4a7ea563df6a1295c46f1fe6e99eba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iHeldan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c7a78737b4a7ea563df6a1295c46f1fe6e99eba -
Trigger Event:
workflow_dispatch
-
Statement type: