ExcelTamer 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ExcelTamer/__init__.py +1 -0
- ExcelTamer/mcp/__init__.py +0 -0
- ExcelTamer/mcp/audit.py +37 -0
- ExcelTamer/mcp/config.py +25 -0
- ExcelTamer/mcp/engine/__init__.py +0 -0
- ExcelTamer/mcp/engine/diff.py +131 -0
- ExcelTamer/mcp/engine/read.py +109 -0
- ExcelTamer/mcp/engine/search.py +101 -0
- ExcelTamer/mcp/engine/workbook.py +63 -0
- ExcelTamer/mcp/engine/write.py +97 -0
- ExcelTamer/mcp/excel.py +110 -0
- ExcelTamer/mcp/main.py +18 -0
- ExcelTamer/mcp/prompts/README.md +0 -0
- ExcelTamer/mcp/prompts/financial_metric_extract.md +23 -0
- ExcelTamer/mcp/prompts/safe_edit.md +26 -0
- ExcelTamer/mcp/safety.py +39 -0
- ExcelTamer/mcp/schemas/__init__.py +0 -0
- ExcelTamer/mcp/server.py +541 -0
- ExcelTamer/mcp/sessions.py +35 -0
- exceltamer-0.2.0.dist-info/METADATA +170 -0
- exceltamer-0.2.0.dist-info/RECORD +25 -0
- exceltamer-0.2.0.dist-info/WHEEL +5 -0
- exceltamer-0.2.0.dist-info/entry_points.txt +2 -0
- exceltamer-0.2.0.dist-info/licenses/LICENSE +674 -0
- exceltamer-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ExcelTamer
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A Model Context Protocol server for safe Microsoft Excel automation
|
|
5
|
+
Author: Shamit
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
Project-URL: Homepage, https://github.com/shamitv/ExcelTamer
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/shamitv/ExcelTamer/issues
|
|
9
|
+
Project-URL: Documentation, https://github.com/shamitv/ExcelTamer/blob/main/docs/mcp_server.md
|
|
10
|
+
Project-URL: Repository, https://github.com/shamitv/ExcelTamer
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: xlwings~=0.36.10
|
|
21
|
+
Requires-Dist: pandas~=3.0.5
|
|
22
|
+
Requires-Dist: mcp~=1.28.1
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# ExcelTamer
|
|
26
|
+
|
|
27
|
+
ExcelTamer is a Model Context Protocol (MCP) server for safe, structured
|
|
28
|
+
automation of Microsoft Excel. It exposes workbook lifecycle, reading, writing,
|
|
29
|
+
search, checkpoint, resource, and prompt capabilities to any MCP-compatible
|
|
30
|
+
client.
|
|
31
|
+
|
|
32
|
+
**New to ExcelTamer?** Follow the [quick start](#quick-start-use-exceltamer-with-an-mcp-client)
|
|
33
|
+
below or read the
|
|
34
|
+
[complete MCP usage guide](https://github.com/shamitv/ExcelTamer/blob/main/docs/mcp_server.md).
|
|
35
|
+
|
|
36
|
+
## Quick start: use ExcelTamer with an MCP client
|
|
37
|
+
|
|
38
|
+
### 1. Install ExcelTamer
|
|
39
|
+
|
|
40
|
+
ExcelTamer requires Windows with Microsoft Excel installed and Python 3.11 or
|
|
41
|
+
newer.
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
pip install .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. Add ExcelTamer to your MCP client
|
|
48
|
+
|
|
49
|
+
Add this client-neutral server definition to your MCP client's configuration,
|
|
50
|
+
replacing the allowed root with the directory containing your workbooks:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"exceltamer": {
|
|
56
|
+
"command": "exceltamer-mcp",
|
|
57
|
+
"env": {
|
|
58
|
+
"EXCELTAMER_MCP_ALLOWED_ROOTS": "C:\\Users\\you\\Documents\\Excel"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`EXCELTAMER_MCP_ALLOWED_ROOTS` limits which workbook paths the server may
|
|
66
|
+
access. The server defaults to read-only workbook mode and records write
|
|
67
|
+
operations in an audit log.
|
|
68
|
+
|
|
69
|
+
### 3. Restart the client and ask it to use Excel
|
|
70
|
+
|
|
71
|
+
For inspection, try:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
Open C:\Users\you\Documents\Excel\budget.xlsx in read-only mode. List the
|
|
75
|
+
worksheets, preview the first 10 rows of the first sheet, summarize what the
|
|
76
|
+
workbook contains, and close it when finished.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For a safe edit, try:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
Open C:\Users\you\Documents\Excel\budget.xlsx in read-write mode. Create a
|
|
83
|
+
checkpoint, update cell B4 on Sheet1 to 120, read the cell back to verify the
|
|
84
|
+
change, save the workbook, and close it. If verification fails, roll back to
|
|
85
|
+
the checkpoint.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Your MCP client handles the `excel.*` tool calls and carries the returned
|
|
89
|
+
`workbook_id` through the workflow.
|
|
90
|
+
|
|
91
|
+
## Run the server manually
|
|
92
|
+
|
|
93
|
+
Start the default stdio transport:
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
exceltamer-mcp
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The module form remains available:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
python -m ExcelTamer.mcp.main
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For SSE transport:
|
|
106
|
+
|
|
107
|
+
```powershell
|
|
108
|
+
exceltamer-mcp --port 8123
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Command-line options
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
exceltamer-mcp [-h] [--port PORT]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Option | Description |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `-h`, `--help` | Show the command help and exit |
|
|
120
|
+
| `--port PORT` | Run the SSE transport on the specified integer port |
|
|
121
|
+
|
|
122
|
+
When `--port` is omitted, the server uses stdio transport. The module form
|
|
123
|
+
accepts the same options:
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
python -m ExcelTamer.mcp.main --port 8123
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Environment variables
|
|
130
|
+
|
|
131
|
+
ExcelTamer reads these variables when the server process starts. Restart the
|
|
132
|
+
server or MCP client after changing them.
|
|
133
|
+
|
|
134
|
+
| Variable | Default | Effect |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| `EXCELTAMER_MCP_ALLOWED_ROOTS` | Current working directory | Comma-separated directory roots from which workbook paths may be opened |
|
|
137
|
+
| `EXCELTAMER_MCP_DEFAULT_MODE` | `ro` | Default workbook mode: `ro` for read-only or `rw` for read-write |
|
|
138
|
+
| `EXCELTAMER_MCP_MAX_CELLS_READ` | `20000` | Maximum number of cells considered by one read operation |
|
|
139
|
+
| `EXCELTAMER_MCP_MAX_CELLS_WRITE` | `5000` | Maximum number of cells accepted by one write operation |
|
|
140
|
+
| `EXCELTAMER_MCP_AUDIT_LOG_DIR` | `./.exceltamer_mcp_logs` | Directory in which write audit records are stored as `audit.jsonl` |
|
|
141
|
+
|
|
142
|
+
Set these values in the MCP client configuration's `env` object, as shown in
|
|
143
|
+
the quick start, or in the shell before starting `exceltamer-mcp`.
|
|
144
|
+
|
|
145
|
+
## Capabilities
|
|
146
|
+
|
|
147
|
+
- Open, inspect, save, save-as, and close workbooks
|
|
148
|
+
- Read cells, ranges, sheet previews, and workbook structure
|
|
149
|
+
- Write cells, batches, and rectangular ranges
|
|
150
|
+
- Search workbook values with exact, contains, or regex matching
|
|
151
|
+
- Create and roll back checkpoints
|
|
152
|
+
- Inspect recent write history
|
|
153
|
+
- Discover workbook resources and MCP-native workflow prompts
|
|
154
|
+
|
|
155
|
+
## Validation
|
|
156
|
+
|
|
157
|
+
Run the automated MCP smoke tests:
|
|
158
|
+
|
|
159
|
+
```powershell
|
|
160
|
+
python -m unittest discover -s test -p "test_*.py" -v
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Run the standalone protocol client:
|
|
164
|
+
|
|
165
|
+
```powershell
|
|
166
|
+
python test/mcp_client.py
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Pass `--file path\to\workbook.xlsx` to additionally validate opening,
|
|
170
|
+
inspecting, and closing a real workbook.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
ExcelTamer/__init__.py,sha256=8qU_pcwHowLrWWjYas-X1nQCgKH17WCzjzRJgXlehPQ,37
|
|
2
|
+
ExcelTamer/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
ExcelTamer/mcp/audit.py,sha256=jYf7bSxcONODhmoBFB5AEI67YX3Etey0nn3SkoWjCUU,1183
|
|
4
|
+
ExcelTamer/mcp/config.py,sha256=OFaPhy8gZU4wLC6vcen8qV8L3R8fQ8KCFZnC-KyDpf0,838
|
|
5
|
+
ExcelTamer/mcp/excel.py,sha256=Vay6lMcqSriRLzs3Ze3OlPet6W--y3CB_YBuw3TBiYA,3842
|
|
6
|
+
ExcelTamer/mcp/main.py,sha256=SKlDjeWr0HT7C4OvxAZSwf0j5sNoT2RzCwyZy54byKg,451
|
|
7
|
+
ExcelTamer/mcp/safety.py,sha256=49bPfqZ2ZZ6G5kYXVw2uMjdNpNi0haxqoBMDG7-oYT8,1250
|
|
8
|
+
ExcelTamer/mcp/server.py,sha256=t4BPV50ot32SLhR5UManYgN6XdH9CU8WoeFLtglkSoM,21020
|
|
9
|
+
ExcelTamer/mcp/sessions.py,sha256=pu_I5dyANF4VQE2V_AsLfFh4nv6JWJd8uwH9vARdbew,983
|
|
10
|
+
ExcelTamer/mcp/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
ExcelTamer/mcp/engine/diff.py,sha256=VlrslvIMyQyHe24BMCQ2SzArg2jv2_ZSIvlE4hWMjtA,4810
|
|
12
|
+
ExcelTamer/mcp/engine/read.py,sha256=UJz6FF8womugGePJ0rPyNcftg51ZL_0FoHjUeHLjJqI,4224
|
|
13
|
+
ExcelTamer/mcp/engine/search.py,sha256=IWH-s8UygImJiHavZFHmx2XktOmpLiNkegye8MVB7_8,4135
|
|
14
|
+
ExcelTamer/mcp/engine/workbook.py,sha256=5JvfJ5N7kqNalgwyc_IlLM7x9lXd2A90ACnQeCChWxE,2101
|
|
15
|
+
ExcelTamer/mcp/engine/write.py,sha256=ueRHDjn-VXsm_uVghav4vNutEV957f5K_oD0J5tnjGo,3275
|
|
16
|
+
ExcelTamer/mcp/prompts/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
ExcelTamer/mcp/prompts/financial_metric_extract.md,sha256=QuvwgTU42Z9gdLsfyraxRcbzH4hq5mwZA7bcO5zhJ1Y,1011
|
|
18
|
+
ExcelTamer/mcp/prompts/safe_edit.md,sha256=VMZ8ugoJuKWGTu0CcI_c2o_qOs3xppHcAidDfhZDhPc,1142
|
|
19
|
+
ExcelTamer/mcp/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
exceltamer-0.2.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
21
|
+
exceltamer-0.2.0.dist-info/METADATA,sha256=xHvlcJrYIkC6ei-IsgXOeuc2DtVInZvPDWURpV8ZaqU,5313
|
|
22
|
+
exceltamer-0.2.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
23
|
+
exceltamer-0.2.0.dist-info/entry_points.txt,sha256=ddNwWBE1QS-ijYbhKNP9cZFWMLTHJE_LsSEkaQd8Ztk,60
|
|
24
|
+
exceltamer-0.2.0.dist-info/top_level.txt,sha256=vy92OVLvfH2ddH0I9HV-NJZU0YJY6o_yyr0uHrNohyY,11
|
|
25
|
+
exceltamer-0.2.0.dist-info/RECORD,,
|