Local File Reader MCP Server

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.

Category
Visit Server

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-parse to 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

  1. Open your terminal in the project directory (mcp-project).
  2. 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.

  1. Run the inspector command:
    npx @modelcontextprotocol/inspector node index.js
    
  2. The terminal will output a URL like http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=.... Open this link in your browser.
  3. In the Inspector UI, go to the Tools tab.
  4. Select analyze_spending.
  5. Enter the filename of a file that exists in this directory (e.g. test.csv or document.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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured