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, 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 28 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
  • 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 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.

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.
  • Most read-oriented tools return JSON strings, but a few older tools still return plain string representations for compatibility.
  • 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.

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.2.1.tar.gz (25.5 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.2.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sheetforge_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 25.5 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.2.1.tar.gz
Algorithm Hash digest
SHA256 6c22a208d66be6db0975d455267d239bd328dcac47e586f9e8414e47bd6ddf9f
MD5 16b414f354f752fab7016df3f4538d81
BLAKE2b-256 a2b1f636c1b5d3c2cc976799a3fe335d0bf14ac8419940f405c625fd5746a26a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sheetforge_mcp-0.2.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.2.1-py3-none-any.whl.

File metadata

  • Download URL: sheetforge_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 32.9 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97b02c15fcbccf2fd57c108012ea6759fea56b73feea48733c572605dc9091f6
MD5 bd95884a988b694dcec4a75689fa1021
BLAKE2b-256 704e40f0b0c527ac94cb1af3ab36a97881fb8858e142f706093a7f04e0496e17

See more details on using hashes here.

Provenance

The following attestation bundles were made for sheetforge_mcp-0.2.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