Back to Home
Vishwasa2004 icon

mcp-regex-server

by Vishwasa2004

Overview

This server provides a standardized interface (MCP) for performing regular expression searches within specified files, returning matching lines.

Installation

Run Command
go run main.go

Security Notes

The server allows searching arbitrary file paths (`file_path` argument) using a user-provided regex pattern (`pattern` argument). This introduces two significant risks if deployed in an untrusted environment or with untrusted input: 1. Local File Inclusion (LFI): An attacker could specify paths to sensitive system files (e.g., /etc/passwd) to extract their content. The current implementation only reads, not writes, files. 2. Regular Expression Denial of Service (ReDoS): Maliciously crafted complex regex patterns can consume excessive CPU resources, leading to a denial of service. There is no built-in input validation or sanitization for file paths or regex patterns.

Similar Servers

Stats

Interest Score0
Security Score5
Cost ClassMedium
Avg Tokens1000
Stars0
Forks0
Last Update2026-01-19

Tags

RegexFile SearchGoToolingMCP