excel-tools-mcp 0.1.0__tar.gz
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.
- excel_tools_mcp-0.1.0/PKG-INFO +322 -0
- excel_tools_mcp-0.1.0/README.md +302 -0
- excel_tools_mcp-0.1.0/excel_tools/__init__.py +0 -0
- excel_tools_mcp-0.1.0/excel_tools/core_utils.py +113 -0
- excel_tools_mcp-0.1.0/excel_tools/exceptions.py +60 -0
- excel_tools_mcp-0.1.0/excel_tools/inspect_excel.py +91 -0
- excel_tools_mcp-0.1.0/excel_tools/mcp_instance.py +5 -0
- excel_tools_mcp-0.1.0/excel_tools/profile_structure.py +195 -0
- excel_tools_mcp-0.1.0/excel_tools/read_excel.py +62 -0
- excel_tools_mcp-0.1.0/excel_tools/server.py +20 -0
- excel_tools_mcp-0.1.0/excel_tools/unmerged_cells.py +113 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/PKG-INFO +322 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/SOURCES.txt +17 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/dependency_links.txt +1 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/entry_points.txt +2 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/requires.txt +4 -0
- excel_tools_mcp-0.1.0/excel_tools_mcp.egg-info/top_level.txt +1 -0
- excel_tools_mcp-0.1.0/pyproject.toml +34 -0
- excel_tools_mcp-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: excel-tools-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A standalone MCP server for inspecting and editing Excel .xlsx files.
|
|
5
|
+
Author: wasziyang
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: excel,xlsx,mcp,model-context-protocol
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: mcp>=1.27.0
|
|
17
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
|
19
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
20
|
+
|
|
21
|
+
# Excel Tools MCP
|
|
22
|
+
|
|
23
|
+
A standalone MCP server for inspecting and editing `.xlsx` files.
|
|
24
|
+
|
|
25
|
+
## Tools
|
|
26
|
+
|
|
27
|
+
- `excel_inspect`: inspect workbook metadata and sheet dimensions.
|
|
28
|
+
- `excel_read_range`: read a rectangular cell range.
|
|
29
|
+
- `excel_profile_structure`: summarize row structure patterns.
|
|
30
|
+
- `excel_unmerge_cells`: unmerge intersecting merged cells and optionally fill values.
|
|
31
|
+
|
|
32
|
+
Only local file paths are supported. The old `fileId` server-side download flow has been removed.
|
|
33
|
+
|
|
34
|
+
## Run With npx
|
|
35
|
+
|
|
36
|
+
MCP client config:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"excel-tools-mcp": {
|
|
42
|
+
"type": "stdio",
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The npm package is a launcher. On first run it creates a Python virtual environment under
|
|
51
|
+
the user's cache directory, installs the bundled Python MCP server, and starts it over stdio.
|
|
52
|
+
|
|
53
|
+
Requirements:
|
|
54
|
+
|
|
55
|
+
- Node.js 20+
|
|
56
|
+
- Python 3.10+
|
|
57
|
+
|
|
58
|
+
Test from a terminal:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The command may appear to do nothing. That is normal for an MCP stdio server: it waits for the MCP
|
|
65
|
+
host to send JSON-RPC messages over stdin.
|
|
66
|
+
|
|
67
|
+
### Custom Python Path
|
|
68
|
+
|
|
69
|
+
By default, the launcher searches for `python3`, then `python`.
|
|
70
|
+
|
|
71
|
+
Only set `EXCEL_TOOLS_MCP_PYTHON` when Python is installed somewhere unusual. Do not copy
|
|
72
|
+
`/path/to/python` literally.
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"excel-tools-mcp": {
|
|
78
|
+
"type": "stdio",
|
|
79
|
+
"command": "npx",
|
|
80
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"],
|
|
81
|
+
"env": {
|
|
82
|
+
"EXCEL_TOOLS_MCP_PYTHON": "/absolute/path/to/python"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Examples:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
EXCEL_TOOLS_MCP_PYTHON=/usr/bin/python3 npx --yes @wasziyang/excel-tools-mcp
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
$env:EXCEL_TOOLS_MCP_PYTHON = "C:\Users\Alice\AppData\Local\Programs\Python\Python312\python.exe"
|
|
97
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Windows, WSL, and VS Code
|
|
101
|
+
|
|
102
|
+
If your `mcp.json` lives under a Windows path such as:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
C:\Users\<you>\AppData\Roaming\Code\User\mcp.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
VS Code usually starts the MCP server from Windows, not from WSL. In that case Windows must have
|
|
109
|
+
Node.js and Python installed, and Excel file paths should be Windows paths:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"excel-tools-mcp": {
|
|
115
|
+
"type": "stdio",
|
|
116
|
+
"command": "npx",
|
|
117
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Example tool argument:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"file_path": "C:\\Users\\Alice\\Documents\\report.xlsx",
|
|
128
|
+
"sheet": "Sheet1",
|
|
129
|
+
"start_cell": "A1",
|
|
130
|
+
"end_cell": "D20"
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If you want VS Code on Windows to run the server inside WSL, call `wsl` explicitly:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"excel-tools-mcp": {
|
|
140
|
+
"type": "stdio",
|
|
141
|
+
"command": "wsl",
|
|
142
|
+
"args": [
|
|
143
|
+
"bash",
|
|
144
|
+
"-lc",
|
|
145
|
+
"npx --yes @wasziyang/excel-tools-mcp"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
When the server runs in WSL, use Linux/WSL paths:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"file_path": "/mnt/c/Users/Alice/Documents/report.xlsx",
|
|
157
|
+
"sheet": "Sheet1",
|
|
158
|
+
"start_cell": "A1",
|
|
159
|
+
"end_cell": "D20"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Avoid setting `cwd` until the minimal config works. If you do set it, make sure it is valid in the
|
|
164
|
+
same environment that runs the server.
|
|
165
|
+
|
|
166
|
+
## Run With uvx
|
|
167
|
+
|
|
168
|
+
This project can also be distributed as a Python package on PyPI. After it is published to PyPI,
|
|
169
|
+
users who have `uv` installed can run it with `uvx`:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"mcpServers": {
|
|
174
|
+
"excel-tools-mcp": {
|
|
175
|
+
"type": "stdio",
|
|
176
|
+
"command": "uvx",
|
|
177
|
+
"args": [
|
|
178
|
+
"--from",
|
|
179
|
+
"excel-tools-mcp",
|
|
180
|
+
"excel-tools-mcp"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Terminal test:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
uvx --from excel-tools-mcp excel-tools-mcp
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`uvx` downloads the package from PyPI, creates an isolated cached environment, and runs the
|
|
194
|
+
`excel-tools-mcp` console command declared in `pyproject.toml`.
|
|
195
|
+
|
|
196
|
+
Requirements:
|
|
197
|
+
|
|
198
|
+
- `uv`
|
|
199
|
+
- Python compatible with this package, currently Python 3.10+
|
|
200
|
+
|
|
201
|
+
The npm and uvx routes are equivalent at runtime: both eventually start the same Python MCP server.
|
|
202
|
+
The difference is only the distribution layer:
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
npx -> npm package -> Node launcher -> Python MCP server
|
|
206
|
+
uvx -> PyPI package -> Python MCP server
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Run With Docker
|
|
210
|
+
|
|
211
|
+
Build locally:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
docker build -t excel-tools-mcp .
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
MCP client config example:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"command": "docker",
|
|
222
|
+
"args": [
|
|
223
|
+
"run",
|
|
224
|
+
"-i",
|
|
225
|
+
"--rm",
|
|
226
|
+
"-v",
|
|
227
|
+
"/absolute/path/to/excel/files:/workspace",
|
|
228
|
+
"excel-tools-mcp"
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Inside Docker, pass file paths under `/workspace`, for example `/workspace/report.xlsx`.
|
|
234
|
+
|
|
235
|
+
Docker images are not published yet. The npm launcher is the recommended installation path for now.
|
|
236
|
+
|
|
237
|
+
## Run As Python
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
pip install .
|
|
241
|
+
excel-tools-mcp
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Or:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
python3 -m excel_tools.server
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Publishing To npm
|
|
251
|
+
|
|
252
|
+
To make `npx --yes @wasziyang/excel-tools-mcp` work for other users, the package name must exist on the npm registry.
|
|
253
|
+
|
|
254
|
+
Basic flow for this scoped public package:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npm login
|
|
258
|
+
npm publish --access public
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Before publishing, check the current registry state:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
npm view @wasziyang/excel-tools-mcp
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
If npm returns package metadata, the package already exists. If npm returns `404`, publish it with
|
|
268
|
+
`npm publish --access public`.
|
|
269
|
+
|
|
270
|
+
Publishing a new version requires a new semver value. npm does not allow overwriting an already
|
|
271
|
+
published version:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
npm version patch
|
|
275
|
+
npm publish --access public
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Users who do not specify a version get the npm `latest` dist-tag:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
That normally resolves to the newest published version tagged as `latest`.
|
|
285
|
+
|
|
286
|
+
## Publishing To PyPI
|
|
287
|
+
|
|
288
|
+
Publish to PyPI if you want users to run:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
uvx --from excel-tools-mcp excel-tools-mcp
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Build and upload:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
python3 -m pip install --upgrade build twine
|
|
298
|
+
python3 -m build
|
|
299
|
+
python3 -m twine upload dist/*
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
PyPI also does not allow overwriting an already published version. Before uploading a new release,
|
|
303
|
+
update the version in `pyproject.toml`, for example:
|
|
304
|
+
|
|
305
|
+
```toml
|
|
306
|
+
version = "0.1.1"
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
If you publish both npm and PyPI packages, keep `package.json` and `pyproject.toml` versions aligned
|
|
310
|
+
unless you intentionally release one distribution channel ahead of the other.
|
|
311
|
+
|
|
312
|
+
### Docker Cache Pre-Warm
|
|
313
|
+
|
|
314
|
+
If a Docker image uses `uvx` to launch the PyPI package, you can pre-warm the uv cache at image build
|
|
315
|
+
time so the container starts faster:
|
|
316
|
+
|
|
317
|
+
```dockerfile
|
|
318
|
+
RUN uvx --from excel-tools-mcp excel-tools-mcp --help >/dev/null 2>&1 || true
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
That command downloads and installs the PyPI package into uv's cache during `docker build`. The
|
|
322
|
+
`|| true` keeps the build from failing if the command exits after printing help.
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Excel Tools MCP
|
|
2
|
+
|
|
3
|
+
A standalone MCP server for inspecting and editing `.xlsx` files.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
- `excel_inspect`: inspect workbook metadata and sheet dimensions.
|
|
8
|
+
- `excel_read_range`: read a rectangular cell range.
|
|
9
|
+
- `excel_profile_structure`: summarize row structure patterns.
|
|
10
|
+
- `excel_unmerge_cells`: unmerge intersecting merged cells and optionally fill values.
|
|
11
|
+
|
|
12
|
+
Only local file paths are supported. The old `fileId` server-side download flow has been removed.
|
|
13
|
+
|
|
14
|
+
## Run With npx
|
|
15
|
+
|
|
16
|
+
MCP client config:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"mcpServers": {
|
|
21
|
+
"excel-tools-mcp": {
|
|
22
|
+
"type": "stdio",
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The npm package is a launcher. On first run it creates a Python virtual environment under
|
|
31
|
+
the user's cache directory, installs the bundled Python MCP server, and starts it over stdio.
|
|
32
|
+
|
|
33
|
+
Requirements:
|
|
34
|
+
|
|
35
|
+
- Node.js 20+
|
|
36
|
+
- Python 3.10+
|
|
37
|
+
|
|
38
|
+
Test from a terminal:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The command may appear to do nothing. That is normal for an MCP stdio server: it waits for the MCP
|
|
45
|
+
host to send JSON-RPC messages over stdin.
|
|
46
|
+
|
|
47
|
+
### Custom Python Path
|
|
48
|
+
|
|
49
|
+
By default, the launcher searches for `python3`, then `python`.
|
|
50
|
+
|
|
51
|
+
Only set `EXCEL_TOOLS_MCP_PYTHON` when Python is installed somewhere unusual. Do not copy
|
|
52
|
+
`/path/to/python` literally.
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"excel-tools-mcp": {
|
|
58
|
+
"type": "stdio",
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"],
|
|
61
|
+
"env": {
|
|
62
|
+
"EXCEL_TOOLS_MCP_PYTHON": "/absolute/path/to/python"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Examples:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
EXCEL_TOOLS_MCP_PYTHON=/usr/bin/python3 npx --yes @wasziyang/excel-tools-mcp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```powershell
|
|
76
|
+
$env:EXCEL_TOOLS_MCP_PYTHON = "C:\Users\Alice\AppData\Local\Programs\Python\Python312\python.exe"
|
|
77
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Windows, WSL, and VS Code
|
|
81
|
+
|
|
82
|
+
If your `mcp.json` lives under a Windows path such as:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
C:\Users\<you>\AppData\Roaming\Code\User\mcp.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
VS Code usually starts the MCP server from Windows, not from WSL. In that case Windows must have
|
|
89
|
+
Node.js and Python installed, and Excel file paths should be Windows paths:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"mcpServers": {
|
|
94
|
+
"excel-tools-mcp": {
|
|
95
|
+
"type": "stdio",
|
|
96
|
+
"command": "npx",
|
|
97
|
+
"args": ["--yes", "@wasziyang/excel-tools-mcp"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Example tool argument:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"file_path": "C:\\Users\\Alice\\Documents\\report.xlsx",
|
|
108
|
+
"sheet": "Sheet1",
|
|
109
|
+
"start_cell": "A1",
|
|
110
|
+
"end_cell": "D20"
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you want VS Code on Windows to run the server inside WSL, call `wsl` explicitly:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"mcpServers": {
|
|
119
|
+
"excel-tools-mcp": {
|
|
120
|
+
"type": "stdio",
|
|
121
|
+
"command": "wsl",
|
|
122
|
+
"args": [
|
|
123
|
+
"bash",
|
|
124
|
+
"-lc",
|
|
125
|
+
"npx --yes @wasziyang/excel-tools-mcp"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
When the server runs in WSL, use Linux/WSL paths:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"file_path": "/mnt/c/Users/Alice/Documents/report.xlsx",
|
|
137
|
+
"sheet": "Sheet1",
|
|
138
|
+
"start_cell": "A1",
|
|
139
|
+
"end_cell": "D20"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Avoid setting `cwd` until the minimal config works. If you do set it, make sure it is valid in the
|
|
144
|
+
same environment that runs the server.
|
|
145
|
+
|
|
146
|
+
## Run With uvx
|
|
147
|
+
|
|
148
|
+
This project can also be distributed as a Python package on PyPI. After it is published to PyPI,
|
|
149
|
+
users who have `uv` installed can run it with `uvx`:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"mcpServers": {
|
|
154
|
+
"excel-tools-mcp": {
|
|
155
|
+
"type": "stdio",
|
|
156
|
+
"command": "uvx",
|
|
157
|
+
"args": [
|
|
158
|
+
"--from",
|
|
159
|
+
"excel-tools-mcp",
|
|
160
|
+
"excel-tools-mcp"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Terminal test:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
uvx --from excel-tools-mcp excel-tools-mcp
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`uvx` downloads the package from PyPI, creates an isolated cached environment, and runs the
|
|
174
|
+
`excel-tools-mcp` console command declared in `pyproject.toml`.
|
|
175
|
+
|
|
176
|
+
Requirements:
|
|
177
|
+
|
|
178
|
+
- `uv`
|
|
179
|
+
- Python compatible with this package, currently Python 3.10+
|
|
180
|
+
|
|
181
|
+
The npm and uvx routes are equivalent at runtime: both eventually start the same Python MCP server.
|
|
182
|
+
The difference is only the distribution layer:
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
npx -> npm package -> Node launcher -> Python MCP server
|
|
186
|
+
uvx -> PyPI package -> Python MCP server
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Run With Docker
|
|
190
|
+
|
|
191
|
+
Build locally:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
docker build -t excel-tools-mcp .
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
MCP client config example:
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"command": "docker",
|
|
202
|
+
"args": [
|
|
203
|
+
"run",
|
|
204
|
+
"-i",
|
|
205
|
+
"--rm",
|
|
206
|
+
"-v",
|
|
207
|
+
"/absolute/path/to/excel/files:/workspace",
|
|
208
|
+
"excel-tools-mcp"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Inside Docker, pass file paths under `/workspace`, for example `/workspace/report.xlsx`.
|
|
214
|
+
|
|
215
|
+
Docker images are not published yet. The npm launcher is the recommended installation path for now.
|
|
216
|
+
|
|
217
|
+
## Run As Python
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
pip install .
|
|
221
|
+
excel-tools-mcp
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Or:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
python3 -m excel_tools.server
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Publishing To npm
|
|
231
|
+
|
|
232
|
+
To make `npx --yes @wasziyang/excel-tools-mcp` work for other users, the package name must exist on the npm registry.
|
|
233
|
+
|
|
234
|
+
Basic flow for this scoped public package:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
npm login
|
|
238
|
+
npm publish --access public
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Before publishing, check the current registry state:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
npm view @wasziyang/excel-tools-mcp
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
If npm returns package metadata, the package already exists. If npm returns `404`, publish it with
|
|
248
|
+
`npm publish --access public`.
|
|
249
|
+
|
|
250
|
+
Publishing a new version requires a new semver value. npm does not allow overwriting an already
|
|
251
|
+
published version:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npm version patch
|
|
255
|
+
npm publish --access public
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Users who do not specify a version get the npm `latest` dist-tag:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
npx --yes @wasziyang/excel-tools-mcp
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
That normally resolves to the newest published version tagged as `latest`.
|
|
265
|
+
|
|
266
|
+
## Publishing To PyPI
|
|
267
|
+
|
|
268
|
+
Publish to PyPI if you want users to run:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
uvx --from excel-tools-mcp excel-tools-mcp
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Build and upload:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
python3 -m pip install --upgrade build twine
|
|
278
|
+
python3 -m build
|
|
279
|
+
python3 -m twine upload dist/*
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
PyPI also does not allow overwriting an already published version. Before uploading a new release,
|
|
283
|
+
update the version in `pyproject.toml`, for example:
|
|
284
|
+
|
|
285
|
+
```toml
|
|
286
|
+
version = "0.1.1"
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
If you publish both npm and PyPI packages, keep `package.json` and `pyproject.toml` versions aligned
|
|
290
|
+
unless you intentionally release one distribution channel ahead of the other.
|
|
291
|
+
|
|
292
|
+
### Docker Cache Pre-Warm
|
|
293
|
+
|
|
294
|
+
If a Docker image uses `uvx` to launch the PyPI package, you can pre-warm the uv cache at image build
|
|
295
|
+
time so the container starts faster:
|
|
296
|
+
|
|
297
|
+
```dockerfile
|
|
298
|
+
RUN uvx --from excel-tools-mcp excel-tools-mcp --help >/dev/null 2>&1 || true
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
That command downloads and installs the PyPI package into uv's cache during `docker build`. The
|
|
302
|
+
`|| true` keeps the build from failing if the command exits after printing help.
|
|
File without changes
|