naosugi
MCP Servernaosugipublic

csv_read_mcp

大きめのcsv表データを生成AIで使えるようにするMCP Server

Repository Info

1
Stars
0
Forks
1
Watchers
0
Issues
Python
Language
MIT License
License

About This Server

大きめのcsv表データを生成AIで使えるようにするMCP Server

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

MCP Server for table data (CSS)

Claude Desktop用のMCP Serverで、長大なCSVファイルの分析を支援するためのツールを提供します。

大雑把な使い方

https://modelcontextprotocol.io/quickstart/server のPython verが動く状態にする

  1. csvフォルダに分析したいCSVファイルを入れる。ここにあるものだけが利用される
  2. claude_desktop_config.json のmcp serverの名前をデータに応じてそれっぽく変更し、パスを絶対パスにする。Claude Desktopの設定ファイルとしてしかるべき場所に配置する
  3. Claude Desktopを起動する
  4. (任意)dbの場合はtable_info.txtというファイルが作られ、ここを直接編集することで使われないテーブルやカラムを設定できる

概要

このプロジェクトには2つの異なるサーバー実装が含まれています:

  1. server_pandas.py - CSVファイルをPandas DataFrameとして直接メモリ上で操作します
  2. server_db.py - CSVファイルをSQLiteデータベースに読み込み、SQLクエリで操作します

必要条件

  • Python 3.10以上
  • 必要なパッケージ(pyproject.tomlに記載)

インストール方法

# 依存関係のインストール
pip3 install -e .

SQLiteは標準でPythonに組み込まれているため、別途インストールする必要はありません。

使用方法

Pandas版サーバーの起動

python server_pandas.py

SQLite版サーバーの起動

python server_db.py

サーバー起動時に、./csv/ディレクトリ内のCSVファイルが自動的に読み込まれます。

機能

Pandas版 (server_pandas.py)

  1. get_dataframe_names() - 利用可能なPandas DataFrameの一覧を取得
  2. get_detailed_column_info(df_name) - 指定したDataFrameのカラム情報と統計情報を取得
  3. select_dataframe(df_name, df_query, columns) - 指定したDataFrameに対してクエリを実行し、結果を取得

SQLite版 (server_db.py)

  1. get_table_names() - データベース内のテーブル一覧を取得
  2. get_table_schema(table_name) - 指定したテーブルのスキーマ情報を取得
  3. execute_sql_query(sql_query) - SELECTクエリを実行して結果を取得(最大10行)

注意事項

  • SQLite版は冪等性を確保するため、サーバー起動時に毎回テーブルを新規作成します
  • セキュリティ上の理由から、SQLite版ではSELECTクエリのみ実行可能です
  • 結果表示は最大10行に制限されています

データセット

./csv/ディレクトリにCSVファイルを配置。Pandas Dataframeで特に設定しないで読み込めるものであればなんでもOk

Quick Start

1

Clone the repository

git clone https://github.com/naosugi/csv_read_mcp
2

Install dependencies

cd csv_read_mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownernaosugi
Repocsv_read_mcp
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation