Local File Reader MCP Server
Enables AI assistants to securely read and analyze local files such as CSV, JSON, and PDF from the project directory, allowing tasks like spending analysis.
README
Local File Reader MCP Server
This is a Model Context Protocol (MCP) server that provides an analyze_spending tool to AI assistants. It securely reads local files (CSV, JSON, TXT, MD, PDF, etc.) from the project directory and returns their text contents to the AI for analysis.
Features
- Supports multiple formats: Reads text-based files out of the box, and uses
pdf-parseto extract text from PDFs. - Secure:
- Prevents path traversal and symlink attacks (only reads files inside the project directory).
- Prevents Out of Memory (OOM) crashes by enforcing a 10MB file size limit.
- Sanitizes error messages to prevent sensitive path leakage.
Prerequisites
- Node.js (v18 or higher recommended)
- npm
Setup & Installation
- Open your terminal in the project directory (
mcp-project). - Install the dependencies:
npm install
Testing the Server (Using the MCP Inspector)
The easiest way to test this server is to use the official MCP Inspector. This spins up a local web interface where you can pretend to be the AI and test the tool manually.
- Run the inspector command:
npx @modelcontextprotocol/inspector node index.js - The terminal will output a URL like
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=.... Open this link in your browser. - In the Inspector UI, go to the Tools tab.
- Select
analyze_spending. - Enter the
filenameof a file that exists in this directory (e.g.test.csvordocument.pdf) and hit Run. The contents of the file will be returned!
Using the Server with a real AI Agent
You can hook this local server up to any MCP-compatible AI client (like Claude Desktop or Cursor).
For example, to configure it in Claude Desktop, you would add this to your claude_desktop_config.json:
{
"mcpServers": {
"local-file-reader": {
"command": "node",
"args": [
"/absolute/path/to/your/mcp-project/index.js"
]
}
}
}
Once connected, you can ask the AI: "Can you analyze my spending in the data.csv file?" and it will seamlessly use this tool to fetch the file contents.
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.