{
  "markdown": "# mcp-server-xlwings\n\nMCP server for Excel automation via xlwings COM. Works with DRM-protected files.\n\n[![PyPI](https://img.shields.io/pypi/v/mcp-server-xlwings.svg)](https://pypi.org/project/mcp-server-xlwings/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)\n\n## Why xlwings?\n\nLibraries like `openpyxl` or `pandas` read `.xlsx` files directly from disk. This fails when:\n\n- **DRM / file-level encryption** is applied (common in enterprise environments)\n- You need to interact with a **live Excel session** (formulas, macros, add-ins)\n- Files are locked by another process\n\n`mcp-server-xlwings` uses **COM automation** to talk to the running Excel process, so it can read and write any file that Excel itself can open -- including DRM-protected documents.\n\n### xlwings-exclusive capabilities\n\nThese features are **impossible** with file-based libraries like openpyxl:\n\n- **Read the user's current selection** -- see exactly what the user is looking at\n- **Get the active workbook** -- no need to specify a file path\n- **Run VBA macros** -- execute existing macros and get their return values\n- **Live formula results** -- set a formula and get the calculated value immediately\n- **Force recalculation** -- trigger Excel to recalculate all formulas\n\n## Installation\n\n### With uvx (recommended)\n\n```bash\nuvx mcp-server-xlwings\n```\n\n### With pip\n\n```bash\npip install mcp-server-xlwings\n```\n\n## Configuration\n\n### Claude Desktop\n\nAdd to `%APPDATA%\\Claude\\claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"xlwings\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-xlwings\"]\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add xlwings -- uvx mcp-server-xlwings\n```\n\n### Roo Code (VS Code)\n\nAdd to Roo Code MCP settings or create `<project-root>/.roo/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"xlwings\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-xlwings\"]\n    }\n  }\n}\n```\n\n### Cursor\n\nAdd to `%USERPROFILE%\\.cursor\\mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"xlwings\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-xlwings\"]\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd to `%USERPROFILE%\\.codeium\\windsurf\\mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"xlwings\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-xlwings\"]\n    }\n  }\n}\n```\n\n### Continue (VS Code)\n\nAdd to `~/.continue/config.yaml`:\n\n```yaml\nmcpServers:\n  - name: xlwings\n    command: uvx\n    args:\n      - mcp-server-xlwings\n```\n\n## Available Tools (11)\n\nAll tools default to the **active workbook** when `workbook` is omitted.\n\n| Tool | Description |\n|------|-------------|\n| `get_active_workbook` | Get active workbook info, sheets, and current selection with data |\n| `manage_workbooks` | List, open, save, close, or recalculate workbooks |\n| `read_data` | Read a range with `merge_info`, `header_row`, `sheet=\"*\"` batch read, and `detail` mode |\n| `write_data` | Write a 2D array (`data`) or a single-cell formula (`formula`) |\n| `manage_sheets` | List, add, delete, rename, copy, activate sheets. Insert/delete rows and columns |\n| `find_replace` | Search for text, optionally replace it |\n| `format_range` | Apply formatting (bold, italic, color, borders, alignment, number format, etc.) |\n| `run_macro` | Execute a VBA macro and get its return value |\n| `get_formulas` | Get all formulas in a range with optional calculated values |\n| `get_cell_styles` | Get formatting/style info (bold, colors, borders, etc.) for cells in a range |\n| `get_objects` | List charts, images, and shapes on a sheet |\n\n## Examples\n\n### See what the user is working on\n\n> \"What's in the spreadsheet I have open?\"\n\nThe agent calls `get_active_workbook()` to get the workbook name, sheets, and selection data, then `read_data()` to fetch the full sheet.\n\n### Summarize selected data\n\n> \"Summarize the data I've selected\"\n\nThe agent calls `get_active_workbook()` -- the response includes the selection data directly.\n\n### Run a macro\n\n> \"Run the UpdateReport macro\"\n\nThe agent calls `run_macro(macro_name=\"UpdateReport\")` and returns the result.\n\n### Build a summary row\n\n> \"Add a SUM formula in C10 that totals C2:C9\"\n\nThe agent calls `write_data(start_cell=\"C10\", formula=\"=SUM(C2:C9)\")` and gets back the calculated value.\n\n### Format a header row\n\n> \"Make row 1 bold and centered with a yellow background\"\n\nThe agent calls `format_range(cell_range=\"A1:D1\", bold=true, alignment=\"center\", bg_color=\"#FFFF00\")`.\n\n### Read all sheets at once\n\n> \"Give me a summary of every sheet\"\n\nThe agent calls `read_data(sheet=\"*\")` -- returns all sheet summaries in a single call.\n\n### Read merged cells properly\n\n> \"Read B6:C20 and fill in merged cell values\"\n\nThe agent calls `read_data(cell_range=\"B6:C20\", merge_info=true)`. Merged cells return the parent value instead of null.\n\n### Find all formulas\n\n> \"Show me all formulas in this sheet\"\n\nThe agent calls `get_formulas(cell_range=\"A1:Z100\", values_too=true)` and gets every formula with its calculated value.\n\n### Insert rows\n\n> \"Insert 3 blank rows at row 5\"\n\nThe agent calls `manage_sheets(action=\"insert_rows\", position=5, count=3)`.\n\n## Requirements\n\n- **Windows** (Excel COM automation is Windows-only)\n- **Microsoft Excel** installed\n- **Python 3.10+**\n\n## License\n\nMIT\n\n<!-- mcp-name: io.github.geniuskey/mcp-server-xlwings -->\n",
  "bytes": 5424,
  "sha": "ca3b0466ef786468e923dc4f7c4f702efc8f81ffb399c9d8b87d663be2abb307",
  "repo_slug": "geniuskey/mcp-server-xlwings",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_geniuskey_mcp_server_xlwings_b61609ce/readme"
}