Back to Home
zhangrunhao icon

mcp-local-files

Verified Safe

by zhangrunhao

Overview

This server provides a Model Context Protocol (MCP) interface for AI agents to list, read, and search local project files, acting as a bridge for code understanding and interaction.

Installation

Run Command
PROJECT_ROOT=/absolute/path/to/your/project npx tsx src/index.ts

Environment Variables

  • PROJECT_ROOT
  • PORT
  • MAX_ENTRIES
  • MAX_FILE_BYTES
  • MAX_SEARCH_RESULTS

Security Notes

The server implements robust security measures for file system access, including a mandatory PROJECT_ROOT environment variable to define the scope, and a 'resolveSafe' function to prevent directory traversal attacks. It explicitly denies access to common sensitive/large directories and binary file extensions. File reading includes truncation and a check for null bytes to reject binary content. No 'eval' or direct arbitrary command execution (outside of controlled SDK dependencies) is observed. The server exits if PROJECT_ROOT is not set, enforcing secure configuration. The use of Zod for input validation is also a positive security practice.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassHigh
Avg Tokens50000
Stars0
Forks0
Last Update2026-01-19

Tags

local file accessfile system toolsMCP serverproject contextAI agent utility