csv-analyzer-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@csv-analyzer-mcpanalyze the sales data from data.csv"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CSV Analyzer MCP
Model Context Protocol (MCP) を使って CSV ファイルを分析し、統計情報を提供するサーバーであり、AI アシスタントツールとしても利用できます。
LLM が発見・呼び出し可能なツールを公開
ユーザー入力(CSV ファイルパス)を処理
構造化された結果を返す
Claude for Desktop および他の MCP 互換クライアントと統合
機能
CSV 分析: 統計情報の計算と分析
サマリー取得: CSV 構造の JSON 形式サマリー
型アノテーション: Python 3.12+ 対応
ロギング: stderr へのログ出力
エラーハンドリング: ファイル I/O と入力検証
MCP 互換性: 複数の MCP クライアントに対応
Related MCP server: mcp-csv-database
クイックスタート
前提条件
Python 3.12 以上
uvパッケージマネージャー(インストール)
インストール
# プロジェクトディレクトリに移動
cd csv-analyzer-mcp
# 仮想環境を作成して依存パッケージをインストール
uv venv
source .venv/bin/activate # Windows の場合: .venv\Scripts\activate
# 開発モードでパッケージをインストール
uv syncサーバーの実行
# uv 経由(開発時に推奨)
uv run csv-analyzer-mcp
# または、venv をアクティベート後
python -m csv_analyzer_mcp.mainサーバーが起動し、MCP クライアント接続を STDIO でリッスンします。
Claude for Desktop との統合
このMCPサーバーを Claude for Desktop と一緒に使用するには:
Claude設定ファイルを探します:
# macOS/Linux code ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windows code $env:AppData\Claude\claude_desktop_config.jsonサーバー設定を追加します:
{ "mcpServers": { "csv-analyzer": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/csv-analyzer-mcp", "run", "csv-analyzer-mcp" ] } } }/ABSOLUTE/PATH/TO/csv-analyzer-mcpを実際のパスに置き換えます(例:/Users/username/python/csv-analyzer-mcp)Claude for Desktop を再起動します
Claude で、コネクター メニューに「csv-analyzer」サーバーが利用可能として表示されるようになります。以下でテストできます:
「このCSVを分析して: /path/to/your/file.csv」
「data.csvの構造をまとめて」
ツール
1. analyze_csv
CSV ファイルの包括的な統計分析
入力:
file_path(文字列): CSV ファイルへのパス
出力: 以下を含むフォーマット済みレポート:
行数と列数
列名とデータ型
列ごとの統計(数値列: 最小値、最大値、平均値、標準偏差、中央値、文字列列: ユニーク値数)
全体サマリー(数値列、欠損値、メモリ使用量)
例:
ユーザー: 「/Users/john/data/sales.csv を分析して」
Claude: [analyze_csv ツールを呼び出し]
出力:
======================================================================
CSV 分析レポート
======================================================================
基本情報
行数: 1000
列数: 5
列名: date, product, amount, region, discount
列の統計情報
...2. get_csv_summary
CSV 構造の JSON フォーマット済みクイックサマリー
入力:
file_path(文字列): CSV ファイルへのパス
出力: 以下を含む JSON オブジェクト:
rows: 行数columns: 列数column_names: すべての列名のリストcolumn_types: 列型の辞書numeric_columns: 数値列のリストtotal_missing_values: 欠損値の数
例:
{
"rows": 1000,
"columns": 5,
"column_names": ["date", "product", "amount", "region", "discount"],
"column_types": {
"date": "object",
"product": "object",
"amount": "float64",
"region": "object",
"discount": "int64"
},
"numeric_columns": ["amount", "discount"],
"total_missing_values": 12
}アーキテクチャ
csv-analyzer-mcp/
├── pyproject.toml # プロジェクトメタデータ、依存関係、エントリポイント
├── README.md # このファイル
├── .gitignore # Git無視パターン
│
├── src/csv_analyzer_mcp/
│ ├── __init__.py # パッケージ初期化とバージョン
│ ├── main.py # サーバーエントリポイントと STDIO トランスポート設定
│ ├── tools.py # MCP ツール定義(@mcp.tool デコレータ)
│ ├── utils.py # ヘルパー関数(CSV読込、統計処理)
│ └── py.typed # PEP 561 型ヒントマーカー
│
├── examples/
│ ├── sample.csv # テスト用サンプルデータ
│ └── example_usage.md # 使用例
│
└── tests/ (オプション)
├── test_utils.py
└── test_tools.pyモジュール概要
main.py: FastMCP サーバーを初期化し、STDIO トランスポートで実行します。これは MCP サーバーのエントリポイントです。tools.py:@mcp.tool()デコレータを使用して MCP ツールを定義します。各関数は LLM クライアントが利用可能なツールになります。utils.py: ビジネスロジックを含みます:read_csv_file(): エラー処理付きで CSV を安全に読み込みcalculate_statistics(): pandas を使用して統計を計算format_statistics_report(): 出力を人間が読みやすいテキストにフォーマット
動作原理
┌─────────────┐
│ Claude for │
│ Desktop │
└──────┬──────┘
│ (JSON-RPC over STDIO)
│
┌───▼────────────────────┐
│ MCP サーバープロセス │
│ (csv-analyzer-mcp) │
└───┬────────────────────┘
│
┌───▼────────────────────┐
│ tools.py │
│ - analyze_csv │
│ - get_csv_summary │
└───┬────────────────────┘
│
┌───▼────────────────────┐
│ utils.py │
│ - read_csv_file() │
│ - calculate_statistics │
│ - format_report() │
└────────────────────────┘フロー:
Claude がCSV分析に関する質問をします
Claude のクライアントが JSON-RPC リクエストをこの MCP サーバーに送信します
tools.pyモジュールがリクエストを受け取りますutils.pyが実際のファイル読み込みと計算を実行します結果をフォーマットして JSON-RPC レスポンスとして返送します
Claude は結果をユーザーに表示します
サンプルデータ
examples/sample.csv に 12行5列のサンプル従業員データが含まれています:
列 | 型 | 説明 |
name | 文字列 | 従業員フルネーム |
age | 整数 | 従業員年齢 |
salary | 整数 | 年間給与(USD) |
department | 文字列 | 部門名 |
hire_date | 日付 | 採用日(YYYY-MM-DD形式) |
使用例
Claude for Desktop での使用
Claude for Desktop を開いて、以下のように質問できます:
例 1: CSV ファイルの詳細分析
ユーザー: 「/Users/username/python/csv-analyzer-mcp/examples/sample.csv ファイルを分析してもらえますか?」
Claude: [analyze_csv ツールを呼び出し]
出力:
======================================================================
CSV 分析レポート
======================================================================
基本情報
行数: 12
列数: 5
列名: name, age, salary, department, hire_date
列の統計情報
name (型: object)
非null値: 12
null値: 0
ユニーク値: 12
age (型: int64)
非null値: 12
null値: 0
最小値: 26
最大値: 52
平均値: 36.25
標準偏差: 8.91
中央値: 34.5
salary (型: int64)
非null値: 12
null値: 0
最小値: 65000
最大値: 105000
平均値: 83916.67
標準偏差: 11899.63
中央値: 84500.0
department (型: object)
非null値: 12
null値: 0
ユニーク値: 5
hire_date (型: object)
非null値: 12
null値: 0
ユニーク値: 12
サマリー
数値列: age, salary
欠損値の合計: 0
メモリ使用量: 0.18 MB
======================================================================例 2: CSV 構造のクイックサマリー
ユーザー: 「/Users/username/python/csv-analyzer-mcp/examples/sample.csv の JSON サマリーをください」
Claude: [get_csv_summary ツールを呼び出し]
出力:
{
"rows": 12,
"columns": 5,
"column_names": ["name", "age", "salary", "department", "hire_date"],
"column_types": {
"name": "object",
"age": "int64",
"salary": "int64",
"department": "object",
"hire_date": "object"
},
"numeric_columns": ["age", "salary"],
"total_missing_values": 0
}トラブルシューティング
Claude for Desktop にサーバーが表示されない
claude_desktop_config.jsonが正しくフォーマットされているか確認してください(有効な JSON)プロジェクトディレクトリへの絶対パスが正しいか確認してください
Claude for Desktop を再起動してください(macOS では Cmd+Q で完全に終了)
ログを確認:
tail -f ~/Library/Logs/Claude/mcp*.log
CSV ファイルが見つからないエラー
絶対パスまたは現在の作業ディレクトリに相対的なパスを使用してください
ファイルが存在し、読み取り可能か確認:
ls -la /path/to/file.csv
最初の実行時の「許可が拒否されました」エラー
macOS/Linux では、実行許可を与える必要がある場合があります:
chmod +x /Users/username/python/csv-analyzer-mcpさらに詳しく
ライセンス
MIT ライセンス - LICENSE ファイルの詳細を参照してください。
Available Tools
2 toolsanalyze_csvA
CSVファイルを分析して基本統計情報を返します。
このツールは以下の包括的な統計を計算します:
行数と列数
列名とデータ型
数値列の場合: 最小値、最大値、平均値、標準偏差、中央値
文字列列の場合: ユニーク値の数
全体統計: 欠損値の合計、メモリ使用量
Args: file_path: 分析対象の CSV ファイルへの絶対パスまたは相対パス 例: "/path/to/data.csv" または "data.csv"
Returns: 統計情報と洞察を含むフォーマット済みのテキストレポート ファイルが読み込めない場合または空の場合はエラーメッセージを返します
Example: >>> await analyze_csv("/Users/username/data.csv") # フォーマット済みの統計レポートを返します
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral disclosure burden. It details exactly which statistics are computed, states that the return is a formatted text report, and specifies error conditions for unreadable or empty files. It does not cover potential size limits or encoding concerns, but for a read-only analysis tool this is solid coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement, a bulleted list of statistics, an Args section, a Returns section, and an example. Every element contributes value and there is no redundancy, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists (signal true), the description does not need to detail return fields. It covers input semantics, output format, error behavior, and an example, so an agent can invoke it correctly. The only notable gap is the lack of routeing relative to the sibling tool get_csv_summary.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% coverage, so the description must define file_path. It does so clearly, explaining that it accepts absolute or relative paths and providing a concrete example. This is useful beyond the raw schema, though it stops short of mentioning supported file extensions or size constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('analyze'), the resource ('CSV file'), and the outcome ('basic statistical information'). However, it does not mention the sibling tool get_csv_summary or explain how it differs, so an agent must infer the distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes an example invocation and describes the file_path argument, but gives no explicit guidance about when to use this tool versus get_csv_summary, nor any conditions or exclusions. The usage context is entirely implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_csv_summaryA
CSV ファイルの JSON 形式でのクイックサマリーを取得します。
このツールは CSV ファイルの構造と基本情報の簡潔なサマリーを提供します。 プログラマティックな処理に有用です。
Args: file_path: CSV ファイルへの絶対パスまたは相対パス
Returns: 以下の情報を含む JSON 文字列: - rows: 行数 - columns: 列数 - column_names: 列名のリスト - column_types: 列名とデータ型の辞書 - numeric_columns: 数値列の列名リスト - total_missing_values: 欠損値の数
Example: >>> await get_csv_summary("/Users/username/data.csv") # JSON サマリーを返します
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of disclosure and does a good job by enumerating the exact return fields (rows, columns, column_names, etc.) and providing an example invocation. It does not cover error handling or file access behavior, but for a read-only summary tool the essential behavioral contract is clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args, Returns, and Example sections, and the first sentence immediately conveys the purpose. A few phrases like 'this tool provides' are slightly redundant but not wasteful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool, the definition provides parameter semantics, detailed return values, and an example, giving an agent enough to invoke it correctly. The main gap is not addressing how it relates to analyze_csv, which is a minor context shortfall.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides no description for file_path (0% coverage), so the description's clarification that it accepts 'absolute or relative path' adds essential meaning. The example also demonstrates realistic usage, though no additional constraints or formats are specified.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('get a quick summary' of a CSV file) and the output format (JSON). It identifies the resource precisely, but does not differentiate from the sibling tool analyze_csv, so it falls just short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Beyond the generic note that it is 'useful for programmatic processing', the description gives no guidance on when to use this tool versus analyze_csv or any exclusions. No alternatives or selection criteria are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.0- First observed
analyze_csv - First observed
get_csv_summary
TDQS
Both tools operate on the same CSV file and return overlapping information such as row count, column names, column types, and missing values. get_csv_summary is essentially a subset of analyze_csv, so an agent could easily select the wrong one despite the output format difference.
Both tool names follow a consistent verb_noun snake_case pattern: analyze_csv and get_csv_summary. The naming style is uniform and predictable.
Two tools is borderline for a CSV analyzer server. The count is not extreme, but the tools are highly redundant, which makes the set feel thin and not fully justified.
The core CSV analysis need is covered through basic statistics and a JSON summary. Minor gaps exist, such as no raw data preview or per-column analysis controls, but agents can work around these for typical summary tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Transform your data analysis with our Data Compute & Stats Bot. Effortlessly calculate descriptive
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceAn MCP server that enables AI assistants to load, query, and analyze local CSV files using tools for filtering, aggregation, and grouping. It provides capabilities to describe schemas, calculate statistics, and sample data directly from CSV files.6-
- AlicenseBqualityDmaintenanceLoads CSV files into a temporary SQLite database and provides comprehensive data analysis tools via MCP, enabling AI assistants to query, analyze, and export data using natural language.14MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI models to interact with local CSV and Parquet data through MCP tools, providing summarization and analysis capabilities.1-
- FlicenseAqualityDmaintenanceEnables LLMs to generate visual summary reports from CSV datasets using MCP Resources, Tools, and Prompts, without exposing raw data to the model.10-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gakuji3/csv-analyzer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server