Excel MCP Server
A Model Context Protocol server that enables AI agents to freely operate Excel spreadsheets, providing tools for workbook creation, cell manipulation, formatting, formula handling, and data export.
Tools
create_workbook
新しいExcelワークブックを作成します
open_workbook
既存のExcelワークブックを開いて情報を表示します
get_workbook_info
Excelワークブックの詳細情報を取得します(シート一覧、メタデータ等)
add_worksheet
既存のワークブックにワークシートを追加します
set_cell_value
指定されたセルに値を設定します
get_cell_value
指定されたセルの値を取得します
set_range_values
指定された範囲に2次元配列のデータを設定します
get_range_values
指定された範囲のデータを取得します
format_cell
セルの書式(フォント、塗りつぶし、罫線)を設定します
add_formula
セルに数式を追加します
find_data
ワークシート内で指定された値を検索します
close_workbook
開いているExcelワークブックを閉じてメモリから解放します
list_open_workbooks
現在開いているExcelワークブックの一覧を表示します
export_to_csv
ワークシートをCSVファイルにエクスポートします
README
Excel MCP Server
AIエージェントがExcelを自由に操作できるModel Context Protocol (MCP) サーバーです。
📚 詳細ガイド
初心者の方は guide/ ディレクトリの詳細ガイドを参照してください:
- 📖 メインガイド - プロジェクト全体の概要
- 🎓 MCP基礎知識 - MCPとは何か、仕組みの理解
- ⚙️ セットアップ手順 - 開発環境の構築方法
- 🚀 使用方法 - 実際の使い方と例
- 🔧 ツール詳細 - 各Excel操作ツールの詳細説明
- 🛠️ トラブルシューティング - よくある問題と解決方法
- 📋 サンプル集 - 実用的な使用例集
機能
このMCPサーバーは以下のExcel操作機能を提供します:
ワークブック・ワークシート操作
create_workbook- 新しいExcelワークブックを作成add_worksheet- ワークシートを追加
セル・範囲操作
set_cell_value- セルに値を設定get_cell_value- セルの値を取得set_range_values- 範囲に2次元配列データを設定get_range_values- 範囲のデータを取得
書式設定
format_cell- セルの書式(フォント、塗りつぶし、罫線)を設定
数式・計算
add_formula- セルに数式を追加
データ操作
find_data- ワークシート内でデータを検索
出力
export_to_csv- ワークシートをCSVファイルにエクスポート
セットアップ
- 依存関係をインストール:
npm install
- TypeScriptをコンパイル:
npm run build
- サーバーを起動:
npm start
開発
開発モード(コンパイル後に実行):
npm run dev
使用例
MCPクライアントから以下のようにツールを呼び出せます:
// 新しいワークブックを作成
await callTool("create_workbook", {
filePath: "C:/path/to/workbook.xlsx"
});
// ワークシートを追加
await callTool("add_worksheet", {
filePath: "C:/path/to/workbook.xlsx",
sheetName: "Sheet1"
});
// セルに値を設定
await callTool("set_cell_value", {
filePath: "C:/path/to/workbook.xlsx",
sheetName: "Sheet1",
cell: "A1",
value: "Hello, Excel!"
});
// 範囲にデータを設定
await callTool("set_range_values", {
filePath: "C:/path/to/workbook.xlsx",
sheetName: "Sheet1",
startCell: "A1",
values: [
["名前", "年齢", "職業"],
["田中", 30, "エンジニア"],
["佐藤", 25, "デザイナー"]
]
});
// セルの書式を設定
await callTool("format_cell", {
filePath: "C:/path/to/workbook.xlsx",
sheetName: "Sheet1",
cell: "A1",
format: {
font: {
bold: true,
size: 14,
color: "FF0000FF"
},
fill: {
type: "pattern",
pattern: "solid",
fgColor: "FFFF00"
}
}
});
技術仕様
- 言語: TypeScript
- ランタイム: Node.js
- MCP SDK: @modelcontextprotocol/sdk
- Excel ライブラリ: ExcelJS
- スキーマ検証: Zod
VS Code での デバッグ
このプロジェクトはVS Codeでデバッグできるように設定されています。.vscode/mcp.jsonファイルにMCPサーバーの設定が含まれています。
ライセンス
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.