Skip to content
Conduit

mcp server

excel-mcp

Excel MCP Server: Connect AI agents to Excel/CSV files. Securely read, query, and analyze spreadsheet data for intelligent reporting.

az-coder-123/excel-mcpcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 17, 2026

Excel MCP Server

A Model Context Protocol (MCP) server for Excel operations with enterprise-grade security and clean architecture. Seamlessly integrates with GitHub Copilot, Cline, and other MCP-compatible tools in VS Code.

Features

  • Complete Excel Operations: Read, write, and manipulate Excel files (.xlsx, .xls)
  • Clean Architecture: Follows Single Responsibility Principle for maintainability
  • Enterprise Security: Robust permission system with path restrictions and access control
  • VS Code Integration: Works seamlessly with GitHub Copilot and Cline
  • TypeScript: Full type safety with modern ES2022+ features
  • Zero Deprecated Dependencies: Uses only current, actively maintained libraries

Quick Start

Installation

# Clone the repository
git clone https://github.com/az-coder-123/excel-mcp.git
cd excel-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Copy example environment file
cp .env.example .env

📌 Đã cấu hình sẵn cho Cline

Server đã được cấu hình và kết nối sẵn với Cline! Xem Hướng dẫn cài đặt chi tiết để biết:

✅ Trạng thái hiện tại: Đã kết nối và hoạt động bình thường

  • Server đang chạy: node dist/index.js
  • Cấu hình Cline: .cline/mcp_servers.json
  • File cấu hình đã sẵn sàng sử dụng

Xem ngay: docs/SETUP_GUIDE.md để biết cách sử dụng

Configuration

Edit .env file to customize permissions:

# Restrict access to specific directories
MCP_ALLOWED_PATHS=/home/user/documents,/workspace

# Block sensitive system directories
MCP_DENIED_PATHS=/etc/*,/sys/*,C:\Windows\*

# Set maximum file size (50MB default)
MCP_MAX_FILE_SIZE=52428800

VS Code Integration

This server works seamlessly with MCP-compatible tools in VS Code. See the dedicated setup guides for detailed configuration instructions:

Available Tools

For detailed parameter references, see the Tools Reference.

System

ToolDescription
excel_health_checkCheck server health, dependencies, and configuration

Workbook Operations

ToolDescription
excel_open_workbookOpen an Excel file for operations
excel_create_workbookCreate a new Excel workbook
excel_save_workbookSave the workbook to disk
excel_close_workbookClose an opened workbook
excel_get_workbook_contextGet workbook context and state
excel_export_worksheet_to_new_fileExport worksheet to a new Excel file

Worksheet Operations → Detailed docs

ToolDescription
excel_list_worksheetsList all worksheets in a workbook
excel_add_worksheetAdd a new worksheet
excel_delete_worksheetDelete a worksheet
excel_rename_worksheetRename a worksheet
excel_copy_worksheetCopy a worksheet
excel_insert_rowsInsert rows at position
excel_delete_rowsDelete rows from position
excel_insert_columnsInsert columns at letter
excel_delete_columnsDelete columns from letter
excel_merge_cellsMerge a cell range
excel_unmerge_cellsUnmerge cells
excel_add_tableAdd styled Excel table
excel_add_filterAdd auto-filter to range
excel_remove_filterRemove auto-filter

Cell Operations → Detailed docs

ToolDescription
excel_read_cellRead a single cell value
excel_read_rangeRead multiple cells
excel_write_cellWrite a value to a cell
excel_write_batchWrite multiple cells at once
excel_get_cell_infoGet detailed cell information (type, formula)
excel_copy_rangeCopy a cell range to another location
excel_find_replaceFind and replace text
excel_sort_rangeSort a range ascending/descending
excel_get_named_rangesList defined named ranges
excel_add_named_rangeCreate a new named range

Formatting & Styles → Detailed docs

ToolCategoryDocs
excel_set_font_styleFont & Text→
excel_set_font_name_sizeFont & Text→
excel_set_rich_textFont & Text→
excel_set_alignmentAlignment→
excel_center_textAlignment→
excel_set_borderBorders→
excel_apply_all_bordersBorders→
excel_apply_outline_borderBorders→
excel_set_background_colorColors→
excel_set_font_colorColors→
excel_set_gradient_fillColors→
excel_set_number_formatNumber Formats→
excel_apply_currency_formatNumber Formats→
excel_apply_percentage_formatNumber Formats→
excel_apply_date_formatNumber Formats→
excel_apply_header_styleStyle Presets→
excel_apply_title_styleStyle Presets→
excel_apply_table_styleStyle Presets→
excel_auto_fit_columnsLayout & Dimensions→
excel_set_column_widthLayout & Dimensions→
excel_set_row_heightLayout & Dimensions→
excel_freeze_panesLayout & Dimensions→
excel_set_print_areaLayout & Dimensions→
excel_add_header_footerLayout & Dimensions→
excel_add_commentNotes & Links→
excel_remove_commentNotes & Links→
excel_add_hyperlinkNotes & Links→
excel_add_data_validationValidation→
excel_format_worksheetBatch Formatting→
excel_batch_formatBatch Formatting→

Data Utilities & Analytics → Detailed docs

ToolCategoryDocs
excel_import_csvCSV Transfer→
excel_export_csvCSV Transfer→
excel_find_duplicatesDuplicates→
excel_count_unique_valuesDuplicates→
excel_highlight_duplicatesDuplicates→
excel_remove_duplicatesDuplicates→
excel_text_to_columnsTransformations→
excel_flash_fillTransformations→
excel_vlookupLookups→
excel_index_matchLookups→
excel_create_pivot_tablePivot Tables→
excel_get_column_statsAnalytics→
excel_filter_dataAnalytics→
excel_group_aggregateAnalytics→
excel_profile_dataAnalytics→
excel_searchSearch→
excel_compare_rangesRange Comparison→

Visualizations & Protection → Charts | Protection

ToolCategoryDocs
excel_add_chartCharts→
excel_update_chartCharts→
excel_delete_chartCharts→
excel_list_chartsCharts→
excel_add_conditional_formatConditional Formats→
excel_remove_conditional_formatConditional Formats→
excel_add_data_barVisual Rules→
excel_add_color_scaleVisual Rules→
excel_add_icon_setVisual Rules→
excel_protect_worksheetProtection→
excel_unprotect_worksheetProtection→
excel_protect_cellsProtection→

Formula Engineering & Auditing → Detailed docs

ToolCategoryDocs
excel_list_formulasInventory→
excel_analyze_formulaStructure Analysis→
excel_get_dependenciesDependencies→
excel_trace_precedentsPrecedent Tracing→
excel_trace_dependentsDependent Tracing→
excel_check_circularCycle Detection→
excel_explain_formulaMulti-language Explanation→
excel_audit_formulasAutomated Audit→

Accounting & Finance → Detailed docs

ToolCategoryDocs
excel_financial_sumFinancial Calculations→
excel_financial_averageFinancial Calculations→
excel_running_totalFinancial Calculations→
excel_percentage_of_totalFinancial Calculations→
excel_year_to_dateFinancial Calculations→
excel_accounting_formatAccounting Formats→
excel_vnd_currency_formatAccounting Formats→
excel_negative_red_formatAccounting Formats→
excel_show_zeros_instead_of_emptyAccounting Formats→
excel_period_comparisonFinancial Analysis→
excel_variance_analysisFinancial Analysis→
excel_check_balanceFinancial Analysis→
excel_find_anomaliesFinancial Analysis→
excel_calculate_npvInvestment Analysis→
excel_calculate_irrInvestment Analysis→
excel_calculate_xirrInvestment Analysis→
excel_calculate_financial_ratioInvestment Analysis→
excel_create_amortization_scheduleLoan & Debt→
excel_create_aging_reportLoan & Debt→
excel_calculate_taxTax & Currency→
excel_calculate_progressive_taxTax & Currency→
excel_convert_currencyTax & Currency→
excel_calculate_depreciationAsset Depreciation→

Usage Examples & Reference

  • Examples — Practical usage examples for all tool groups
  • Reference — Color codes, border styles, font names, AARRGGBB format

Security Features

Permission Levels

  • read: Read-only access to Excel files
  • write: Create and modify Excel files
  • delete: Delete worksheets and clear data
  • admin: Full administrative access

Path Restrictions

Configure allowed and denied paths using wildcards:

# Allow only specific directories
MCP_ALLOWED_PATHS=/workspace/*,/home/user/documents/*

# Block sensitive system paths
MCP_DENIED_PATHS=/etc/*,/sys/*,/proc/*,C:\Windows\*

File Size Limits

Prevent processing of excessively large files:

MCP_MAX_FILE_SIZE=52428800  # 50MB

Extension Whitelist

Only process specific file types (configured by default):

  • .xlsx - Excel Workbook
  • .xls - Excel 97-2003 Workbook
  • .xlsm - Excel Macro-Enabled Workbook
  • .xlsb - Excel Binary Workbook

Architecture

excel-mcp/
├── src/
│   ├── index.ts                 # Application entry point
│   ├── types/
│   │   └── index.ts            # Type definitions
│   ├── security/
│   │   └── permission-checker.ts # Access control
│   ├── services/
│   │   └── excel-service.ts    # Excel operations
│   ├── tools/
│   │   ├── tool-definitions.ts # Tool schemas
│   │   └── tool-handler.ts     # Tool execution
│   ├── server/
│   │   └── excel-mcp-server.ts # MCP server core
│   └── utils/
│       └── logger.ts           # Logging utility
├── docs/
│   ├── AI_WORKFLOW.md          # AI agent SOP & collaboration guidelines
│   ├── ARCHITECTURE.md         # Architecture details
│   ├── API.md                  # API reference
│   ├── SECURITY.md             # Security guide
│   └── TROUBLESHOOTING.md      # Common issues
└── dist/                       # Compiled JavaScript

Design Principles

  1. Single Responsibility: Each class/module has one clear purpose
  2. Dependency Injection: Components are loosely coupled
  3. Type Safety: Full TypeScript coverage with strict mode
  4. Error Handling: Comprehensive error catching and reporting
  5. Security First: Permission checks before all operations

Development

Scripts

# Development with hot reload
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

# Clean build artifacts
npm run clean

Project Structure

  • src/ - TypeScript source files
  • dist/ - Compiled JavaScript output
  • docs/ - Documentation
  • package.json - Dependencies and scripts
  • tsconfig.json - TypeScript configuration

Environment Variables

VariableDescriptionDefault
MCP_SERVER_NAMEServer identifierexcel-mcp
MCP_SERVER_VERSIONServer version1.0.0
MCP_LOG_LEVELLogging verbosityinfo
MCP_ALLOWED_PATHSComma-separated allowed pathsAll paths
MCP_DENIED_PATHSComma-separated denied pathsSystem paths
MCP_MAX_FILE_SIZEMaximum file size in bytes52428800 (50MB)

Troubleshooting

Common Issues

"Permission denied" errors

  • Check your MCP_ALLOWED_PATHS configuration
  • Ensure the file isn't in a denied path
  • Verify you have the required permission level

"Workbook not opened" errors

  • Call excel_open_workbook before other operations
  • Check that the file path is correct
  • Ensure the file isn't corrupted

TypeScript compilation errors

  • Run npm install to ensure all dependencies are installed
  • Check Node.js version (requires >= 18.0.0)

For more troubleshooting help, see docs/TROUBLESHOOTING.md.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please read our contributing guidelines and code of conduct.

Support

↑↓ navigate openesc close