File Analysis MCP Server

File Analysis MCP Server

By huangyz0918 GitHub

-

file-analysis data-analysis
Overview

what is File Analysis MCP Server?

File Analysis MCP Server is a Model Context Protocol (MCP) server that provides tools for reading and writing files, analyzing data (especially CSV files), generating visualizations, and reading PDF files, accessible to any MCP client like Claude Desktop.

how to use File Analysis MCP Server?

To use the server, install it in an MCP client like Claude Desktop, set up the necessary directories, and then you can interact with it by asking questions related to file operations and data analysis.

key features of File Analysis MCP Server?

  • Securely read and write text files
  • Analyze CSV data with detailed statistics
  • Generate various visualizations (bar, line, scatter, etc.)
  • Extract text from PDF files
  • Includes prompts for data analysis and reporting

use cases of File Analysis MCP Server?

  1. Analyzing sales data from CSV files
  2. Extracting text from PDF reports
  3. Generating visualizations for data presentations
  4. Cleaning and summarizing data for stakeholders

FAQ from File Analysis MCP Server?

  • What are the prerequisites for using the server?

You need Python 3.10 or higher and an MCP client like Claude Desktop.

  • How do I install the server?

Install dependencies using pip and set up the server in your MCP client.

  • Can I customize the directories for file access?

Yes, you can set the MCP_FILE_ROOTS environment variable to customize allowed directories.

Content

File Analysis MCP Server

This Model Context Protocol (MCP) server provides tools for reading and writing files, analyzing data (especially CSV files), generating visualizations, and reading PDF files - all accessible to any MCP client like Claude Desktop.

Features

File Operations

  • Read and write text files securely
  • List files in directories matching patterns
  • Get detailed file information (size, creation time, etc.)
  • Extract text content from PDF files

Data Analysis

  • Read and sample CSV files
  • Analyze CSV data with detailed statistics
  • Visualize data with various plot types (bar, line, scatter, histogram, boxplot)

Included Prompts

  • Analyze Data File - Comprehensive data analysis
  • Data Cleaning Steps - Identifying and fixing data issues
  • Generate Summary Report - Executive summary for stakeholders
  • Exploratory Data Analysis - Detailed EDA workflow

Installation

Prerequisites

  • Python 3.10 or higher
  • Claude Desktop or another MCP client

Setup

  1. Install dependencies:
pip install "mcp[cli]" pandas numpy matplotlib PyPDF2
  1. Set up safe directories (optional):
# Default directories are ~/Documents and ~/Downloads
# To customize, set this environment variable:
export MCP_FILE_ROOTS="~/Documents:~/Desktop:~/Downloads"
  1. Install in Claude Desktop:
mcp install file_analysis_server.py

Usage with Claude Desktop

Once installed, you can ask Claude questions like:

  • "Can you list the files in my Documents folder?"
  • "Read the content of ~/Documents/example.txt for me"
  • "Extract text from my ~/Documents/report.pdf file"
  • "Read page 5 of my PDF document"
  • "Analyze the data in ~/Downloads/sample.csv"
  • "Create a bar chart of the 'Sales' column from my CSV file"
  • "Write a summary report of my quarterly_sales.csv file"

Security

The server enforces strict path validation to ensure only files within authorized directories can be accessed. By default, these are limited to ~/Documents and ~/Downloads.

Configuration

You can adjust the allowed directories by setting the MCP_FILE_ROOTS environment variable. Multiple directories should be separated by colons, for example:

mcp install file_analysis_server.py -v MCP_FILE_ROOTS="~/Documents:~/Desktop:~/projects/data"

Development

For development and testing:

mcp dev file_analysis_server.py

This will start the server with the MCP Inspector interface for interactive testing.

Examples

Reading a file

Could you read the content of ~/Documents/notes.txt?

Reading a PDF file

Can you extract the text from ~/Documents/report.pdf?

Reading specific pages from a PDF

Please read pages 3 and 5 from ~/Downloads/manual.pdf

Analyzing CSV data

I have a CSV file at ~/Downloads/sales_data.csv. Could you analyze it and tell me about the 'Revenue' column?

Creating a visualization

Using my ~/Documents/monthly_data.csv file, can you create a bar chart showing 'Month' vs 'Profit'?

Using prompts

Can you run an exploratory data analysis on ~/Downloads/customer_data.csv?
No tools information available.
Powerdrill
Powerdrill by powerdrillai

-

powerdrill data-analysis
View Details

MCP Server - Chat with your Syften social listening data

social-listening data-analysis
View Details

demo of how to use edu data via mcp server

edu-data-analysis data-analysis
View Details

Datax is an intelligent data analysis tool designed for the AI era, enabling users to interact with data through natural language to effortlessly gain deep business insights and predictive analytics.

datax data-analysis
View Details
神岛地图数据统计
神岛地图数据统计 by %E7%A5%9E%E5%B2%9B%E5%AE%9E%E9%AA%8C%E5%AE%A4

-

statistics-mcp data-analysis
View Details
Hubble Ai Mcp
Hubble Ai Mcp by adaHubble

MCP server for solana data analysis.

hubble-ai data-analysis
View Details