iflow-mcp-jenstangen1-pptx-xlsx-mcp-v2 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.
@@ -0,0 +1,34 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ .venv/
8
+ venv/
9
+ ENV/
10
+ env/
11
+ *.log
12
+
13
+ # Node
14
+ node_modules/
15
+ npm-debug.log*
16
+ yarn-debug.log*
17
+ yarn-error.log*
18
+
19
+ # IDE
20
+ .vscode/
21
+ .idea/
22
+ *.swp
23
+ *.swo
24
+
25
+ # OS
26
+ .DS_Store
27
+ Thumbs.db
28
+
29
+ # Project specific
30
+ presentations/
31
+ llms-full-mcp.txt
32
+ README-mcp.md
33
+ Proff\ API\ documentation.json
34
+ PRD.md
@@ -0,0 +1,359 @@
1
+ Metadata-Version: 2.4
2
+ Name: iflow-mcp-jenstangen1-pptx-xlsx-mcp-v2
3
+ Version: 0.1.0
4
+ Summary: MCP servers for interacting with Microsoft Office applications through AI assistance
5
+ Requires-Python: >=3.7
6
+ Requires-Dist: fastapi==0.109.2
7
+ Requires-Dist: mcp>=0.9.0
8
+ Requires-Dist: numpy==1.26.4
9
+ Requires-Dist: opencv-python==4.9.0.80
10
+ Requires-Dist: pillow>=10.0.0
11
+ Requires-Dist: python-pptx==0.6.21
12
+ Requires-Dist: requests==2.31.0
13
+ Requires-Dist: uvicorn==0.27.1
14
+ Description-Content-Type: text/markdown
15
+
16
+ # Microsoft Office MCP Servers
17
+
18
+ This repository contains Model Context Protocol (MCP) servers for interacting with Microsoft Office applications through AI assistance. Currently supported applications:
19
+ - PowerPoint: Create and manipulate presentations
20
+ - Excel: Interact with workbooks and spreadsheets
21
+
22
+ Both servers use `pywin32` for COM automation, allowing direct interaction with running Office applications.
23
+
24
+ ## Prerequisites
25
+
26
+ - Windows operating system
27
+ - Microsoft Office installed (PowerPoint and/or Excel)
28
+ - Python 3.7+
29
+ - `pywin32` package
30
+
31
+ ## Installation
32
+
33
+ 1. Clone the repository:
34
+ ```bash
35
+ git clone https://github.com/jenstangen1/mcp-pptx.git
36
+ cd mcp-pptx
37
+ ```
38
+
39
+ 2. Install dependencies using `uv`:
40
+ ```bash
41
+ uv pip install pywin32
42
+ ```
43
+
44
+ 3. Run the `pywin32` post-install script with administrator privileges:
45
+ ```bash
46
+ python C:\path\to\your\env\Scripts\pywin32_postinstall.py -install
47
+ ```
48
+
49
+ ## Setting up with Claude
50
+
51
+ To integrate these MCP servers with Claude, add the following configuration to your Claude Desktop app settings:
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "powerpoint_mcp_win32": {
57
+ "command": "uv",
58
+ "args": [
59
+ "run",
60
+ "mcp_powerpoint_server_win32.py"
61
+ ],
62
+ "cwd": "C:\\path\\to\\your\\workspace"
63
+ },
64
+ "excel_mcp_win32": {
65
+ "command": "uv",
66
+ "args": [
67
+ "run",
68
+ "mcp_excel_server_win32.py"
69
+ ],
70
+ "cwd": "C:\\path\\to\\your\\workspace"
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ Note: Replace `C:\\path\\to\\your\\workspace` with your actual workspace path.
77
+
78
+ # PowerPoint MCP Server
79
+
80
+ The PowerPoint server provides a comprehensive API for AI models to interact with PowerPoint presentations, supporting advanced formatting, financial charts, and data integration.
81
+
82
+ ## Features
83
+
84
+ ### Presentation Management
85
+ - Create and modify PowerPoint presentations
86
+ - Add, delete, and modify slides
87
+ - Save and load presentations from workspace
88
+ - Template management system
89
+
90
+ ### Element Operations
91
+ - Fine-grained control over slide elements (text, shapes, images, charts)
92
+ - Advanced shape creation and styling
93
+ - Element positioning and grouping
94
+ - Connector lines between shapes
95
+
96
+ ### Financial Integration
97
+ - Create financial charts (line, bar, column, pie, waterfall, etc.)
98
+ - Generate comparison tables
99
+ - Support for various financial metrics:
100
+ - Revenue
101
+ - EBITDA
102
+ - Profit
103
+ - Assets
104
+ - Equity
105
+ - Growth rates
106
+ - Margins
107
+ - Currently uses dummy data, with plans to integrate Proff API for Norwegian company data
108
+ - Adaptable to other financial data providers through API customization
109
+
110
+ ### Styling and Formatting
111
+ - Rich text formatting
112
+ - Shape styling (fills, gradients, outlines)
113
+ - Chart customization
114
+ - Background colors and effects
115
+
116
+ Note: You may need to modify the directory path to match your installation location.
117
+
118
+ ## Available MCP Tools
119
+
120
+ ### Presentation Management
121
+ - `list_presentations`: List all PowerPoint files in the workspace
122
+ - `upload_presentation`: Upload a new presentation to the workspace
123
+ - `save_presentation`: Save the current presentation
124
+
125
+ ### Slide Operations
126
+ - `add_slide`: Add a new slide to the presentation
127
+ - `delete_slide`: Delete a slide from the presentation
128
+ - `get_slide_count`: Get the total number of slides in the presentation
129
+ - `analyze_slide`: Analyze the content of a slide
130
+ - `set_background_color`: Set the background color of a slide
131
+
132
+ ### Element Operations
133
+ - `add_text`: Add text to a slide
134
+ - `add_shape`: Add a shape to a slide
135
+ - `edit_element`: Edit an element's properties
136
+ - `style_element`: Apply styling to an element
137
+ - `connect_shapes`: Connect two shapes with a connector
138
+ - `find_element`: Find elements on a slide based on criteria
139
+
140
+ ### Financial Tools
141
+ - `get_company_financials`: Get financial data for a company (currently returns dummy data)
142
+ - `create_financial_chart`: Create a financial chart on a slide
143
+ - `create_comparison_table`: Create a comparison table for companies
144
+
145
+ **Note:** The financial tools currently use dummy data. Future versions plan to integrate with the Proff API for automatic fetching of Norwegian company data. Users can modify the code to connect with local or preferred financial data providers.
146
+
147
+ ### Template Operations
148
+ - `list_templates`: List all available templates
149
+ - `apply_template`: Apply a template to a presentation
150
+ - `create_slide_from_template`: Create a new slide from a template
151
+ - `save_as_template`: Save a slide as a template
152
+
153
+ ### Debug Tools
154
+ - `debug_element_mappings`: Debug tool to inspect element mappings for a slide
155
+
156
+ ## Usage
157
+
158
+ ### Interacting with Claude
159
+
160
+ Once you've configured the MCP servers in your Claude Desktop app, you can interact with PowerPoint and Excel through natural language commands. Here are some examples:
161
+
162
+ #### PowerPoint Examples
163
+
164
+ ```
165
+ You: Create a new slide with a title "Market Analysis" and add a bar chart showing revenue growth.
166
+
167
+ Claude: I'll help you create that slide with the title and chart. I'll:
168
+ 1. Add a new slide
169
+ 2. Add the title text
170
+ 3. Create a revenue chart
171
+
172
+ [Claude will then use the MCP tools in sequence:
173
+ - add_slide
174
+ - add_text
175
+ - create_financial_chart]
176
+
177
+ You: Make the title bigger and change its color to blue.
178
+
179
+ Claude: I'll modify the title's formatting.
180
+ [Claude will use:
181
+ - find_element (to locate the title)
182
+ - edit_element (to update the formatting)]
183
+
184
+ You: Add a comparison table below the chart comparing three companies.
185
+
186
+ Claude: I'll add a comparison table below the existing chart.
187
+ [Claude will use:
188
+ - create_comparison_table]
189
+ ```
190
+
191
+ #### Excel Examples
192
+
193
+ ```
194
+ You: Open the Q4 report and show me the revenue numbers from cells B2 to B5.
195
+
196
+ Claude: I'll help you retrieve those revenue figures.
197
+ [Claude will use:
198
+ - list_open_workbooks (to find the workbook)
199
+ - get_range_values (to read the specified cells)]
200
+
201
+ You: Calculate the sum of these numbers and put it in cell B6.
202
+
203
+ Claude: I'll calculate the sum and write it to B6.
204
+ [Claude will use:
205
+ - get_range_values (to get the numbers)
206
+ - set_cell_value (to write the sum)]
207
+
208
+ You: Create a new sheet called "Summary" and copy these values there.
209
+
210
+ Claude: I'll create a new sheet and copy the data.
211
+ [Claude will use:
212
+ - add_worksheet
213
+ - get_range_values (from source)
214
+ - set_range_values (to destination)]
215
+ ```
216
+
217
+ ### How It Works
218
+
219
+ 1. **Natural Language Understanding**
220
+ - Claude interprets your requests and breaks them down into specific actions
221
+ - It understands context from previous interactions
222
+ - It can handle complex, multi-step operations
223
+
224
+ 2. **Tool Selection**
225
+ - Claude automatically selects the appropriate MCP tools for each task
226
+ - It can chain multiple tools together for complex operations
227
+ - It handles error cases and provides feedback
228
+
229
+ 3. **Context Management**
230
+ - Claude maintains context about:
231
+ - Currently open files
232
+ - Recent operations
233
+ - Selected elements
234
+ - User preferences
235
+
236
+ 4. **Error Handling**
237
+ - If an operation fails, Claude will:
238
+ - Explain what went wrong
239
+ - Suggest alternatives
240
+ - Help troubleshoot common issues
241
+
242
+ ### Best Practices
243
+
244
+ 1. **Be Specific**
245
+ - Mention slide numbers when relevant
246
+ - Specify exact cell ranges in Excel
247
+ - Describe desired formatting clearly
248
+
249
+ 2. **Complex Operations**
250
+ - Break down complex requests into steps
251
+ - Confirm intermediate results
252
+ - Ask for adjustments as needed
253
+
254
+ 3. **Troubleshooting**
255
+ - Ensure PowerPoint/Excel is running
256
+ - Check file permissions
257
+ - Verify COM automation is working
258
+ - Run pywin32_postinstall.py if needed
259
+
260
+ ### Example Workflows
261
+
262
+ #### Creating a Financial Presentation
263
+
264
+ ```
265
+ You: Create a new presentation about Q4 financial results.
266
+ Claude: I'll create a new presentation with a title slide.
267
+
268
+ You: Add revenue charts for the last 4 quarters.
269
+ Claude: I'll create a new slide with a chart showing quarterly revenue.
270
+
271
+ You: Now add a comparison with our competitors.
272
+ Claude: I'll add a comparison table with key metrics for you and competitors.
273
+ ```
274
+
275
+ #### Analyzing Excel Data
276
+
277
+ ```
278
+ You: Show me all sheets in the Q4 analysis workbook.
279
+ Claude: I'll list all worksheets in that workbook.
280
+
281
+ You: Find the highest revenue value in column B.
282
+ Claude: I'll scan column B and find the maximum value.
283
+
284
+ You: Create a summary of the top 5 values.
285
+ Claude: I'll create a new sheet with the top 5 revenue figures.
286
+ ```
287
+
288
+ ## Directory Structure
289
+
290
+ ```
291
+ pptx-mcp/
292
+ ├── mcp_powerpoint_server.py # Main server implementation
293
+ ├── requirements.txt # Python dependencies
294
+ ├── presentations/ # Workspace for presentations
295
+ │ └── templates/ # Template storage
296
+ └── README.md # This file
297
+ ```
298
+
299
+ ## Dependencies
300
+
301
+ - python-pptx: PowerPoint file manipulation
302
+ - Pillow: Image processing
303
+ - numpy: Numerical operations
304
+ - MCP SDK: Model Context Protocol implementation
305
+
306
+ ## Contributing
307
+
308
+ Contributions are welcome! Please feel free to submit a Pull Request.
309
+
310
+ ## License
311
+
312
+ This project is licensed under the MIT License - see the LICENSE file for details.
313
+
314
+ # Excel MCP Server
315
+
316
+ The Excel server provides tools for interacting with Excel workbooks, worksheets, and cell data through AI assistance.
317
+
318
+ ## Features
319
+
320
+ ### Workbook Management
321
+ - Connect to running Excel instances
322
+ - List open workbooks
323
+ - Save workbooks with various formats (.xlsx, .xlsm, .xlsb, .xls)
324
+
325
+ ### Worksheet Operations
326
+ - List worksheets in a workbook
327
+ - Add new worksheets
328
+ - Access worksheets by name or index
329
+
330
+ ### Cell and Range Operations
331
+ - Read and write individual cell values
332
+ - Get and set values for cell ranges
333
+ - Handle various data types (text, numbers, dates, currency)
334
+ - Automatic type conversion for dates and currency values
335
+
336
+ ## Available MCP Tools
337
+
338
+ ### Workbook Management
339
+ - `list_open_workbooks`: List all currently open Excel workbooks
340
+ - `save_workbook`: Save a workbook to disk with optional format selection
341
+
342
+ ### Worksheet Operations
343
+ - `list_worksheets`: List all worksheets in a workbook
344
+ - `add_worksheet`: Add a new worksheet to a workbook
345
+ - `get_worksheet`: Get a worksheet by name or index
346
+
347
+ ### Cell and Range Operations
348
+ - `get_cell_value`: Read a single cell's value
349
+ - `set_cell_value`: Set a single cell's value
350
+ - `get_range_values`: Read values from a range of cells
351
+ - `set_range_values`: Set values for a range of cells
352
+
353
+
354
+ ## Notes
355
+
356
+ - Both servers require Windows and their respective Microsoft Office applications installed
357
+ - The servers interact with *running* instances of the applications
358
+ - COM automation requires proper initialization; run the post-install script if you encounter COM-related errors
359
+ - For better constant handling, consider using `makepy` to generate Office constants