A Model Context Protocol server to automate file operations, project initialization, and command execution β ideal for backend workflows and LLM-based agent integrations.
FileGen MCP Server is a lightweight Model Context Protocol (MCP) server built to automate file handling, project initialization, and command execution β enabling seamless integration with LLM-based coding workflows.
When LLMs generate code and project structures, the developer often has to manually create folders, files, and paste code β a repetitive and time-consuming process.
FileGen MCP Server eliminates this friction by letting agents or tools directly:
Itβs the perfect backend utility for building smarter, faster, AI-assisted development pipelines.
read_files
Reads one or more files/directories from the local filesystem.
Parameters:
paths
(List[str]): List of file/directory paths to read.init_project
Generates a folder/file structure.
Parameters:
name
(str): Project name.path
(str, optional): Base path (default: system root directory).structure
(Dict[str, Any]): Nested dictionary defining folders/files.write_file
Creates or appends content to a file.
Parameters:
path
(str): Target file path.content
(str): Content to write.mode
(str, optional): "w"
(overwrite) or "a"
(append). Default: "w"
.delete_path
Deletes a file or directory.
Parameters:
path
(str): Target path to delete.execute_command
Executes a shell command.
Parameters:
params
(Dict[str, Any]): Command and arguments to execute.Install dependencies:
uv sync
Start the server:
uv run python src/main.py
Use the setup_and_run.sh
script to configure and launch the MCP server in one go.
Ensure Python 3 is installed.
Make the script executable:
chmod +x setup_and_run.sh
Run the script:
./setup_and_run.sh
uv
availability.uv
if missing.uv
.pyproject.toml
.config.json
.A config.json
file is auto-generated when you run the setup script.
To manually integrate with your agent system, ensure the cwd
field points to the correct project directory.
π‘ Tip: Include the project path in your LLM prompt so it knows where to write files.
{
"mcpServers": {
"project": {
"command": "uv",
"args": ["run", "python", "src/main.py"],
"cwd": "/your/absolute/path/project",
"env": {
"PYTHONPATH": "/your/absolute/path/project/src"
}
}
}
}
project/
βββ src/
β βββ main.py # MCP server entry point
β βββ actions/
β β βββ read_files.py # Read files/directories
β β βββ init_project.py # Project structure creation
β β βββ delete_file.py # File/folder deletion
β β βββ execute_command.py # System command execution
β βββ schemas/
β βββ project_structure.py # Pydantic models for project
βββ setup_and_run.sh # Bootstrap script