File Analysis MCP Server
Provides tools for text file analysis, including metrics like word counts and character frequencies, alongside file reading and directory browsing capabilities. This server enables LLMs to interact with and process local file content securely through the Model Context Protocol.
README
This server is certified by MCP Hub and listed as a trusted MCP server.
File Analysis MCP Server
A custom-built MCP (Model Context Protocol) server for text file analysis, also published as a package to PyPI.
Table of Contents
- Introduction
- Features
- Installation and Setup from GitHub
- Claude Desktop Integration
- Installation from Package
Introduction
What is MCP?
Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It creates a consistent interface for AI models like Claude to interact with external tools, data sources, and services.
MCP follows a client-server architecture:
- MCP Hosts: Programs like Claude Desktop that initiate connections
- MCP Clients: Protocol clients inside the host application
- MCP Servers: Lightweight programs (like this one) that expose capabilities
- Local Data Sources: Your computer's files, databases, and services
Why MCP?
MCP helps you build agents and complex workflows with LLMs by providing:
- Standardized interfaces to connect AI models to different data sources
- The flexibility to switch between LLM providers
- Best practices for secure data access
Features
This File Analysis MCP Server provides:
- Text analysis tools (word count, character frequency, etc.)
- File reading capabilities
- Directory listing
- File content access via MCP resources
Text Analysis Tool (analyze_text)
File Reader Tool (read_file)
Directory Browsing Tool (list_files)
Installation and Setup from GitHub
Step 1: Clone the Repository
Start by cloning the repository to your local machine:
git clone https://github.com/yourusername/file-analysis-mcp.git
cd file-analysis-mcp
Step 2: Set Up UV Package Manager
This project uses UV, a fast Python package manager. If you don't have it installed:
For MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
For Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Remember to restart your terminal after installing UV.
Step 3: Create a Virtual Environment
# Create and activate a virtual environment
uv venv
For MacOS/Linux:
source .venv/bin/activate
For Windows:
.venv\Scripts\activate
Step 4: Install Dependencies
# Install the required dependencies
uv pip install "mcp[cli]"
Testing and Debugging
Running with the MCP Inspector:
uv run mcp dev path/to/your/server/file
Claude Desktop Integration
The real power of your File Analysis server comes when you connect it to Claude Desktop!
Setting Up with Claude Desktop
-
Make sure Claude Desktop is installed
- Download from Claude.ai if you don't have it
-
Locate the configuration file:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%AppData%\Claude\claude_desktop_config.json
If the file doesn't exist, create it.
- MacOS:
-
Add your server configuration:
For MacOS/Linux:
{ "mcpServers": { "file-analysis": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/file-analysis-mcp", "run", "server.py" ] } } }For Windows:
{ "mcpServers": { "file-analysis": { "command": "uv", "args": [ "--directory", "C:\\ABSOLUTE\\PATH\\TO\\file-analysis-mcp", "run", "server.py" ] } } }Important: Replace the path with the actual absolute path to where you cloned the repository. Do not use relative paths.
-
Restart Claude Desktop
- Close and reopen the application completely
-
Verify the connection
- Look for the tools icon (hammer) in the Claude interface
- Your tools should appear in the list when clicking this icon
Tips for Using Your Server
- File Paths: Always provide absolute file paths for best results
- Large Files: Break up analysis of very large files into smaller chunks
- Permissions: Ensure Claude has permission to access the files/directories you're analyzing
Installation from Package
From PyPI (Recommended)
The simplest way to install File Analysis MCP Server is from PyPI:
pip install file-analysis-mcp
Or using UV (recommended):
uv pip install file-analysis-mcp
Add your server configuration
{
"mcpServers": {
"mcp-server": {
"command": "uv",
"args": [
"run",
"mcp-server"
]
}
}
}
License
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.