-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Feature Request: Excel Tables + Tool Naming Refactoring (v1.1.0)
Problem
Currently, ExcelMcp does not support creating Excel Tables programmatically. When building Excel files via automation, we need to:
- Create worksheets
- Populate data
- Create Excel Tables from those ranges
Without this, users must manually create tables in Excel Desktop or use unreliable workarounds.
Additionally, MCP tool names have redundant excel_ prefix that can be simplified.
📋 Implementation Plan (v1.1.0)
Phase 1: Tool Naming Refactoring (6-8 hours) - PR #1
Remove redundant excel_ prefix from all 9 MCP tools:
Tools to rename:
excel_file→fileexcel_powerquery→powerqueryexcel_worksheet→worksheetexcel_parameter→parameterexcel_cell→cellexcel_vba→vbaexcel_datamodel→datamodelexcel_connection→connectionexcel_version→version
Phase 2: Excel Tables Implementation (32-39 hours) - PR #2
Complete Excel Tables feature with security built-in:
Core Operations (CRUD):
List()- List all tables in workbookCreate()- Convert range to tableRename()- Rename existing tableDelete()- Convert table back to rangeGetInfo()- Get table details (columns, rows, style)
CLI Commands:
table-listtable-createtable-renametable-deletetable-info
MCP Tool:
- Tool name:
table(clean, no prefix) - Actions:
list,create,rename,delete,info
Security Built-In:
- ✅ PathValidator for all file operations
- ✅ Table name validation (no spaces, reserved names, invalid chars)
- ✅ Range validation (prevent DOS attacks)
- ✅ Null-safe HeaderRowRange/DataBodyRange access
- ✅ Proper COM cleanup after Unlist()
🎯 Use Cases
Power Query Integration
// Power Query references tables by name
let
Source = Excel.CurrentWorkbook(){[Name="DiscountsTable"]}[Content],
FilteredRows = Table.SelectRows(Source, each [Active] = "Yes")
in
FilteredRows
PivotTable Data Sources
Excel Tables auto-expand and provide named references for PivotTables.
Structured References
// Instead of: =VLOOKUP(A2, $B$2:$D$100, 3, FALSE)
// Use: =VLOOKUP([@CustomerID], CustomersTable, 3, FALSE)
🔧 Technical Implementation
Example Usage
CLI:
# Create table
excelcli table-create "sales.xlsx" "Data" "SalesTable" "A1:F100"
# List tables
excelcli table-list "sales.xlsx"
# Get table info
excelcli table-info "sales.xlsx" "SalesTable"MCP Server:
table({
action: "create",
excelPath: "sales.xlsx",
sheetName: "Data",
tableName: "SalesTable",
range: "A1:F100"
})COM Interop Pattern
// With security built-in
filePath = PathValidator.ValidateExistingFile(filePath, nameof(filePath));
var (isValid, errorMessage) = ValidateTableName(tableName);
var listObject = worksheet.ListObjects.Add(
1, // xlSrcRange
range,
null,
1 // xlYes (has headers)
);
listObject.Name = tableName;
listObject.TableStyle = "TableStyleMedium2";⏱️ Timeline
- Phase 1: 6-8 hours (Tool Naming)
- Phase 2: 32-39 hours (Excel Tables)
- Total: 38-47 hours across 2 PRs
✅ Acceptance Criteria
Phase 1:
- All 9 MCP tools renamed (no
excel_prefix) - server.json updated
- Documentation updated
- All existing tests pass
Phase 2:
- Full CRUD operations on Excel Tables
- PathValidator in all methods
- Table name validation (spaces, reserved names, invalid chars)
- Null-safe access to HeaderRowRange/DataBodyRange
- COM cleanup after Unlist()
- Security tests pass (path traversal, name validation)
- Integration tests pass (full CRUD workflow)
- OnDemand tests pass (no Excel.exe leaks)
- Documentation complete
📚 Related
- Comments: Complete implementation specification in comments below
- Version: v1.1.0 (non-breaking enhancement)
- Assigned: GitHub Copilot Coding Agent
Priority: High - Fundamental Excel automation capability for Power Query integration
Metadata
Metadata
Assignees
Labels
No labels