Skip to main content

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, freezes, autofilters, merges, and conditional formatting
  • native Excel tables, charts, and pivot summaries
  • stdio, streamable-http, and deprecated sse transports

Requirements

  • Python 3.10+
  • .xlsx workbooks
  • either uvx or 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 stdio mode, filepath values must be absolute paths.
  • In streamable-http and sse mode, relative paths are resolved under EXCEL_FILES_PATH.
  • Absolute paths are accepted in every transport.
  • In streamable-http and sse mode, the server creates EXCEL_FILES_PATH automatically 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 33 MCP tools across these groups:

  • workbook overview: create_workbook, create_worksheet, get_workbook_metadata, list_named_ranges, 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, freeze_panes, set_autofilter, 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 flags
  • read_excel_as_table: compact headers + rows output for structured datasets
  • search_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 registration
  • src/excel_mcp/workbook.py: workbook lifecycle helpers and workbook metadata
  • src/excel_mcp/data.py: read, write, table, and search helpers
  • src/excel_mcp/sheet.py: worksheet and range mutations
  • tests/: regression tests for workbook handling and public behavior
  • manifest.json: packaged MCP bundle metadata
  • docs/index.html: static project landing page

Notes For Integrators

  • stdio mode is careful not to write non-protocol text to stdout.
  • 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=True so 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

sheetforge_mcp-0.3.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sheetforge_mcp-0.3.1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file sheetforge_mcp-0.3.1.tar.gz.

File metadata

  • Download URL: sheetforge_mcp-0.3.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sheetforge_mcp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0dfe450c2acf9daf008c793deec3cb0e4452a948b5e9073e2b36298bfdfe3df8
MD5 f5c2da0966095c591e5bfdaebf5749ea
BLAKE2b-256 a3fd2aa43c2b80d378b81a3fe3260029208e2728e78e592127572ae0c58a94f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sheetforge_mcp-0.3.1.tar.gz:

Publisher: publish.yml on iHeldan/sheetforge-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sheetforge_mcp-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: sheetforge_mcp-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sheetforge_mcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6597a7d494f5894f05fc28af31a71cd7e6f99aefa8bdbc16fed1bc0e6db609b7
MD5 9cb9a075ccf093020f380bf1dec04a08
BLAKE2b-256 6264ec76a62de0e8f458af3763e5c1d29622d6509c3c6ab68f3fca46eea44505

See more details on using hashes here.

Provenance

The following attestation bundles were made for sheetforge_mcp-0.3.1-py3-none-any.whl:

Publisher: publish.yml on iHeldan/sheetforge-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page