Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/fan-67/local-mcp
General Purpose UtilitiesVulnerability AnalysisExploitationScripting & AutomationUtilities & Frameworks
GitHubfan-67/local-mcp

local-mcp

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

About

A lightweight stdio-based MCP server for local file system operations — read, write, edit, search, exec for AI assistants. Specially optimized for Chatbox: bat-bypass for exec (CVE-2026-6130), b64 encoding to eliminate escaping issues, and multi-pattern regex for precise code block targeting.

Share

local-mcp

Version License Node Tests Dependencies

Zero-dependency MCP server for local file operations. 13 filesystem tools + 3 meta-tools for progressive discovery — no SDKs, no frameworks, no npm install needed.

MCP Protocol: 2024-11-05 · Transport: stdio + Streamable HTTP · Runtime: Node.js ≥ 22.0.0


Architecture

root@kitploit:~
local-mcp.mjs       — 595 lines, 13 tools, entry point
lib/mcp-core.mjs    — 229 lines, stdio + HTTP transport, 9 MCP methods
lib/config.mjs      —  31 lines, MCP_WORKSPACE/DATA env config with validation

Total: ~855 lines, zero runtime dependencies.


Tools

Filesystem Tools (13)

ToolDescriptionAnnotation
readRead file with line numbers, optional head/tail truncationreadOnlyHint
searchFile search by name (glob) then content (grep)readOnlyHint
lsCompact directory listing with lazy statreadOnlyHint
execStreaming command execution with stdin support and timeoutdestructiveHint
diffDiff two files or text strings (Myers O(ND))readOnlyHint
copyCopy file or directorydestructiveHint
moveMove or rename file/directorydestructiveHint
batchRun multiple ops sequentially; atomic rollback, $prev refsdestructiveHint
fileUnified: read, write, edit, append, delete, info, mkdir, move—
blockRead/replace/insert/delete code blocks by range or function name—
bookmarkPersistent path aliases (add/get/list/delete)—
grepCompact file:line:content format with adaptive concurrencyreadOnlyHint
watchWatch file/directory for changes; max 20 concurrent watchers—

Meta-Tools (3) — Progressive Discovery

ToolDescription
search_toolsSearch available tools by keyword — saves ~90% tokens vs listing all
describe_toolGet full input schema for a specific tool (loaded on demand)
call_toolExecute any tool by name with arguments

Instead of sending all 13 tool schemas (~3,000 tokens) in every request, progressive discovery with these 3 meta-tools reduces it to ~50 tokens — ~90% token savings.


Performance Optimizations (v1.1.1)

#OptimizationImpact
AStream head/tail readstreamHead() avoids reading entire files. 500MB logs: 3s → 5ms, memory: 500MB → few KB
BLazy stat in lsOnly calls statSync when sort=size. 1000-file dir: 50ms → 2ms
CAdaptive grep concurrencyos.availableParallelism() (max 16, min 4) instead of hardcoded 16 workers
DLRU cache evictionMap insertion-order LRU — hot small files no longer evicted by cold large files
EGrep byte protectionMAX_GREP_TOTAL_MB=100 + MAX_GREP_FILES=1000 guards prevent OOM
FProgress notification_meta.progressToken passthrough for MCP 2025 spec (TODO: events for long exec)

Additional Optimizations

AreaDetail
Read cacheSize-aware eviction (max 50 items, 10 MB) + 5s TTL
Myers diffO(ND) algorithm, used by edit, block, and diff
Search scoringName-match first (no I/O), then stat only top 50 candidates
Output formatgrep: file:line:content, ls: compact columns, read: line numbers + truncation hint
ProtocolO(1) Map dispatch, sync handler short-circuit

Getting Started

root@kitploit:~
# Zero install — no dependencies
node local-mcp.mjs

# With configuration
MCP_WORKSPACE=D:/projects node local-mcp.mjs

stdio mode (default)

root@kitploit:~
{
  "mcpServers": {
    "local-mcp": {
      "command": "node",
      "args": ["D:/path/to/local-mcp.mjs"],
      "env": {
        "MCP_WORKSPACE": "D:/projects"
      }
    }
  }
}

HTTP mode

root@kitploit:~
node local-mcp.mjs --http
node local-mcp.mjs --http --port 3456

Supports JSON-RPC 2.0 POST, SSE streaming (Accept: text/event-stream), CORS, and GET /tools.

CLI flags

root@kitploit:~
node local-mcp.mjs --help          # Show usage + env vars
node local-mcp.mjs --list-tools    # Print available tools and exit
node local-mcp.mjs --http          # Start HTTP mode
node local-mcp.mjs --http --port 3456

Configuration

VariableDefaultDescription
MCP_WORKSPACEprocess.cwd()Working directory root (security boundary)
MCP_DATA{WORKSPACE}/.mcp-dataData directory (bookmarks, temp files)
MCP_DIR{WORKSPACE}Default directory for tree/ls commands
MCP_PORT3100HTTP server port (when using --http)
MCP_READONLYfalseSet to true to block all write operations
MCP_EXCLUDE—Comma-separated extra dirs to exclude from search

Security

  • All file operations restricted to MCP_WORKSPACE and subdirectories
  • Prototype-safe bookmark keys (blocks __proto__/constructor/prototype injection)
  • Atomic writes (temp + rename) prevent partial file writes
  • Binary file detection prevents reading non-text files
  • .gitignore and common exclude dirs (node_modules, .git, etc.) respected

Dependencies

Zero runtime dependencies. Uses only Node.js built-ins:

ModulePurpose
fsFile system + glob (Node 22)
child_processStreaming shell execution
httpHTTP transport (no Express needed)
pathPath resolution
osavailableParallelism() for adaptive concurrency
readlineStreaming line-by-line processing

Changelog

v1.1.1 — Performance Optimizations

  • A. Stream head/tail read: 500MB logs 3s → 5ms
  • B. Lazy stat in ls: 1000-file dir 50ms → 2ms
  • C. Adaptive grep concurrency with availableParallelism()
  • D. LRU cache eviction via Map insertion order
  • E. Grep byte protection (100MB / 1000 files)
  • F. Progress notification passthrough for MCP 2025 spec
  • Fix: streamHead scope bug — done defined outside Promise callback

v1.1.0

  • 13 filesystem tools + 3 meta-tools for progressive discovery
  • stdio + Streamable HTTP transport
  • Myers diff engine, read cache, streaming exec
  • Environment-based configuration with validation

Development

root@kitploit:~
# Run tests
node --test test/*.test.mjs

# Adding a tool
# 1. Define schema + handler in local-mcp.mjs
# 2. Register with server.tool()
# 3. Add tests

Contributing

  1. Maintain zero-dependency constraint
  2. Add tests for new functionality
  3. Update the Optimizations table for performance changes

License

MIT

Download Tool