This MCP server enables AI agents to automate Excel file operations through natural language commands.
Key Capabilities:
Workbook & Worksheet Management
Create new Excel workbooks (.xlsx files) at specified paths
Add worksheets with custom names to existing workbooks
Retrieve workbook information including sheet lists and metadata
Cell & Range Operations
Set/get individual cell values (strings, numbers, booleans) using A1 notation
Set/get range values for bulk data operations using 2D arrays (e.g., A1:C10)
Formatting & Styling
Apply comprehensive cell formatting: font properties (bold, italic, size, color), background fills (ARGB colors, patterns), and borders (top, bottom, left, right with custom styles)
Formulas & Calculations
Add Excel formulas to cells for automatic calculations (e.g., =SUM(A1:A10), =AVERAGE())
Data Operations
Search for specific values within worksheets and return their locations
Export worksheet data to CSV format
Use Cases: Automated report generation, data analysis and calculation, spreadsheet formatting, data extraction and transformation, bulk data entry and manipulation.
Provides the runtime environment for the Excel MCP server to operate, enabling Excel file operations on the server-side.
Used as the primary programming language for implementing the Excel MCP server, providing type safety and modern language features.
Implements schema validation for Excel operations, ensuring that inputs to Excel manipulation functions are properly formatted and validated.
Excel MCP Server
AIエージェント(Claude、ChatGPT、Copilotなど)がExcelファイルを自動操作できるModel Context Protocol (MCP) サーバーです。
🎯 できること
このMCPサーバーを使うと、AIエージェントに自然言語で指示するだけで、以下のようなExcel操作が自動化できます:
📊 データ入力・編集: セルや範囲に値を設定、取得
📝 ワークブック管理: 新規作成、シート追加、情報取得
🎨 書式設定: フォント、色、罫線などの装飾
🔢 数式・計算: セルに数式を追加して自動計算
🔍 データ検索: ワークシート内のデータを検索
💾 データ出力: ExcelシートをCSVファイルにエクスポート
例: 「売上データを分析して、月別の合計を計算し、グラフ用のシートを作成して」と指示すれば、AIが自動的にExcelファイルを操作します。
Related MCP server: Excel MCP Server
📚 詳細ガイド
初心者の方は
📖 メインガイド - プロジェクト全体の概要
🎓 MCP基礎知識 - MCPとは何か、仕組みの理解
⚙️ セットアップ手順 - 環境構築方法
🚀 使用方法 - 実際の使い方と例
🔧 ツール詳細 - 各Excel操作ツールの詳細
🛠️ トラブルシューティング - よくある問題と解決方法
📋 サンプル集 - 実用的な使用例集
🚀 セットアップ手順
1. 必要な環境
Node.js (v16以降)
Windows、macOS、またはLinux
2. インストール
3. VS Code Copilotとの連携設定
VS CodeでCopilotと連携する場合、mcp.jsonファイルに設定を追加します。
設定ファイルの場所:
Windows:
%APPDATA%\Code\User\mcp.json(安定版) または%APPDATA%\Code - Insiders\User\mcp.json(Insiders版)macOS:
~/Library/Application Support/Code/User/mcp.jsonまたは~/Library/Application Support/Code - Insiders/User/mcp.jsonLinux:
~/.config/Code/User/mcp.jsonまたは~/.config/Code - Insiders/User/mcp.json
設定内容:
重要: C:/path/to/excel_mcp_server/dist/index.js は、実際のプロジェクトの dist/index.js への絶対パスに置き換えてください。
4. 動作確認
VS Codeを再起動後、Copilotに以下のように話しかけてみてください:
💡 使用例
基本的な操作
新しいExcelファイルを作成
「C:/reports/monthly.xlsxという新しいExcelファイルを作成して」データを入力
「Sheet1のA1からC3の範囲に、商品名、価格、在庫数の表を作成して」書式を設定
「A1セルを太字にして、背景色を黄色にして」数式で計算
「D列に合計を計算する数式を追加して」
より高度な使い方
詳細な使用例は サンプル集 を参照してください。
🔧 提供される機能
このMCPサーバーは以下のExcel操作ツールを提供します:
ワークブック・ワークシート操作
create_workbook- 新しいExcelワークブックを作成get_workbook_info- ワークブックの詳細情報を取得(シート一覧など)add_worksheet- 既存のワークブックにワークシートを追加
セル・範囲操作
set_cell_value- 単一のセルに値を設定get_cell_value- 単一のセルの値を取得set_range_values- 複数セルに一括でデータを設定(表形式データに便利)get_range_values- 複数セルのデータを一括取得
書式設定
format_cell- セルの書式を設定(フォント、背景色、罫線など)
数式・計算
add_formula- セルに数式を追加(SUM、AVERAGEなど)
データ操作
find_data- ワークシート内で特定のデータを検索
出力
export_to_csv- ワークシートをCSVファイルにエクスポート
詳細は ツール詳細ガイド を参照してください。
🛠️ トラブルシューティング
問題が発生した場合は、トラブルシューティングガイド を確認してください。
📄 ライセンス
ISC
開発者向け情報
開発環境のセットアップ
開発モードで実行:
プロジェクト構造
プロジェクト構造
言語: TypeScript
ランタイム: Node.js
MCP SDK: @modelcontextprotocol/sdk
Excel ライブラリ: ExcelJS
スキーマ検証: Zod
デバッグ
VS Codeでのデバッグ設定は .vscode/mcp.json に含まれています。