Skip to main content

A Model Context Protocol server for safe Microsoft Excel automation

Project description

ExcelTamer

ExcelTamer is a Model Context Protocol (MCP) server for safe, structured automation of Microsoft Excel. It exposes workbook lifecycle, reading, writing, search, checkpoint, resource, and prompt capabilities to any MCP-compatible client.

New to ExcelTamer? Follow the quick start below or read the complete MCP usage guide.

Building or contributing? Read the developer guide.

Quick start: use ExcelTamer with an MCP client

1. Install ExcelTamer

ExcelTamer requires Windows with Microsoft Excel installed and Python 3.11 or newer.

pip install ExcelTamer

2. Add ExcelTamer to your MCP client

Choose either stdio or SSE, depending on the transports supported by your MCP client.

Stdio

For the default stdio transport, add this server definition to your MCP client's configuration, replacing the allowed root with the directory containing your workbooks:

{
  "mcpServers": {
    "exceltamer": {
      "command": "exceltamer-mcp",
      "env": {
        "EXCELTAMER_MCP_ALLOWED_ROOTS": "C:\\Users\\you\\Documents\\Excel"
      }
    }
  }
}

EXCELTAMER_MCP_ALLOWED_ROOTS limits which workbook paths the server may access. The server defaults to read-only workbook mode and records write operations in an audit log.

SSE

To use SSE, start ExcelTamer separately in PowerShell. Set server environment variables in the same shell:

$env:EXCELTAMER_MCP_ALLOWED_ROOTS = "C:\Users\you\Documents\Excel"
exceltamer-mcp --port 8123

Then configure an SSE-capable MCP client to connect to the stream endpoint:

{
  "mcpServers": {
    "exceltamer": {
      "url": "http://127.0.0.1:8123/sse"
    }
  }
}

Client configuration field names can vary; use http://127.0.0.1:8123/sse as the server URL. ExcelTamer receives client messages at http://127.0.0.1:8123/messages/.

3. Restart the client and ask it to use Excel

For inspection, try:

Open C:\Users\you\Documents\Excel\budget.xlsx in read-only mode. List the
worksheets, preview the first 10 rows of the first sheet, summarize what the
workbook contains, and close it when finished.

For a safe edit, try:

Open C:\Users\you\Documents\Excel\budget.xlsx in read-write mode. Create a
checkpoint, update cell B4 on Sheet1 to 120, read the cell back to verify the
change, save the workbook, and close it. If verification fails, roll back to
the checkpoint.

Your MCP client handles the excel.* tool calls and carries the returned workbook_id through the workflow.

If the workbook is already open in Excel, focus its Excel window and try:

List the workbooks currently open in Excel, attach the active workbook,
describe its worksheets and used ranges, and then detach from it without
closing the workbook or Excel.

That follows the list → attach → operate → detach workflow:

  1. excel.list_open_workbooks discovers workbooks in all visible Excel applications.
  2. excel.attach_workbook registers the active workbook and returns its workbook_id.
  3. Read, write, checkpoint, and save tools operate on that identifier.
  4. excel.close removes an attached workbook from the MCP session but leaves both the workbook and Excel open.

Security warning: Discovery and attachment deliberately bypass EXCELTAMER_MCP_ALLOWED_ROOTS. They can expose every workbook open in the same Windows user session, including unsaved workbooks and files outside the configured roots. Use these tools only with a trusted local MCP client. Checkpoint creation is supported for attached workbooks, but checkpoint rollback is rejected because rollback would have to close and reopen the user's workbook.

Run the server manually

Start the default stdio transport:

exceltamer-mcp

The module form remains available:

python -m ExcelTamer.mcp.main

For SSE transport:

exceltamer-mcp --port 8123

Command-line options

exceltamer-mcp [-h] [--port PORT]
Option Description
-h, --help Show the command help and exit
--port PORT Run the SSE transport on the specified integer port

When --port is omitted, the server uses stdio transport. The module form accepts the same options:

python -m ExcelTamer.mcp.main --port 8123

Environment variables

ExcelTamer reads these variables when the server process starts. Restart the server or MCP client after changing them.

Variable Default Effect
EXCELTAMER_MCP_ALLOWED_ROOTS Current working directory Comma-separated directory roots from which workbook paths may be opened
EXCELTAMER_MCP_DEFAULT_MODE ro Default workbook mode: ro for read-only or rw for read-write
EXCELTAMER_MCP_MAX_CELLS_READ 20000 Maximum number of cells considered by one read operation
EXCELTAMER_MCP_MAX_CELLS_WRITE 5000 Maximum number of cells accepted by one write operation
EXCELTAMER_MCP_AUDIT_LOG_DIR ./.exceltamer_mcp_logs Directory in which write audit records are stored as audit.jsonl

Set these values in the MCP client configuration's env object, as shown in the quick start, or in the shell before starting exceltamer-mcp.

Capabilities

  • Discover all open Excel workbooks and attach the active one without reopening or taking ownership of it
  • Open, inspect, save, save-as, close, and detach workbooks
  • Read cells, ranges, sheet previews, and workbook structure
  • Write cells, batches, and rectangular ranges
  • Search workbook values with exact, contains, or regex matching
  • Create and roll back checkpoints
  • Inspect recent write history
  • Discover workbook resources and MCP-native workflow prompts

ExcelTamer 0.3.0 exposes 17 MCP tools, one resource, and two prompts.

Validation

Run the automated MCP smoke tests:

python -m unittest discover -s test -p "test_*.py" -v

Run the standalone protocol client:

python test/mcp_client.py

Pass --file path\to\workbook.xlsx to additionally validate opening, inspecting, and closing a real workbook.

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

exceltamer-0.3.0.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

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

exceltamer-0.3.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file exceltamer-0.3.0.tar.gz.

File metadata

  • Download URL: exceltamer-0.3.0.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for exceltamer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9d95cad749a0caaa0104ee3c3eacc7d29c54af5b74f8d2d8b8d7b2011481327d
MD5 5a00e628398bde89b41acf6f4edf3199
BLAKE2b-256 258af0668aab04a5640c08e8364f4bc38fecda6f8ccb1a703dad24b82fe51cff

See more details on using hashes here.

File details

Details for the file exceltamer-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: exceltamer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for exceltamer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 944d3c24256e55cd98cae727f5e05e9bede3301229a91f5ae4067f360b821032
MD5 37a0d0a504115cd4d7fbfe7a58cae987
BLAKE2b-256 64f4ac59493c12afb6caf50d30e24f5a39b65bf165651441aae67bd294858621

See more details on using hashes here.

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