readFileLABSCO SUMMARY
The dry-run diff on edits is the detail that makes handing an agent write access reasonable.
editFile replaces exact line sequences and returns a git-style diff, and dryRun lets you see that diff before anything is written — so a proposed change can be reviewed rather than discovered afterwards. The set is otherwise the familiar agent toolkit, with grep carrying context lines and a result cap so a wide search does not flood the context. executeBash is the one to think about: it runs arbitrary shell commands with whatever privileges the server has.
What it is
A Spring Boot server that exposes local filesystem operations and web fetching to an MCP client, built on Spring AI's MCP server components.
What you get
- readFile and writeFile — read a file with encoding detection, or create and overwrite one, parent directories included
- editFile — line-based edits that return a git-style diff, with a dryRun flag to see the change before applying it
- grepFiles — text search inside files with line numbers and context lines, optional regex, case control and a result cap
- searchFiles — recursive search for files and directories by pattern, case-insensitive and matching partial names
- listDirectory and createDirectory — detailed listings, and several directories created in one call
- executeBash — a shell command run with a working directory and a timeout, returning stdout and stderr
- fetchWebpage — a URL retrieved and its text extracted, with a configurable timeout
- Both transports: SSE over HTTP on port 8081, or stdio for clients that need it
Requirements
Java 17 or higher and Maven 3.6 or higher; built with mvn clean package. No account and no key — but it reads, writes and executes on the machine it runs on, so scope that machine accordingly. For stdio mode the banner and console logging must be switched off, otherwise the log output corrupts the JSON-RPC stream.
Setup effort
Build from source — git clone https://github.com/stephanj/MCPJavaFileSystem.git
USE CASES
Letting an agent make a change you can inspect first
Run the edit as a dry run, read the diff, then apply it when it looks right.
Finding where something is used across a project
Grep with context lines so the match arrives with enough surrounding code to judge it.
Running the build or the tests as part of the conversation
Execute the command with a working directory and a timeout, and read stdout and stderr back.
Pulling reference material off the web into the same session
Fetch the page and get its text, without leaving the tool you are working in.
Setting up a new project's directory structure
Create the directories in one call, then write the initial files.
9 tools
Listed in project docs. Your client may show a different list.
writeFileeditFilesearchFileslistDirectorygrepFilescreateDirectoryexecuteBashfetchWebpageBEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation.
Requires
- Java 17 or later
- Maven 3.6+
- Spring Boot 3.3.6
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/stephanj/MCPJavaFileSystem.git
cd MCPJavaFileSystem
mvn clean packageMCP Clients
Claude Desktop
{
"mcpServers": {
"filesystem": {
"command": "/Library/Java/JavaVirtualMachines/liberica-jdk-23.jdk/Contents/Home/bin/java",
"args": [
"-Dspring.ai.mcp.server.stdio=true",
"-Dspring.main.web-application-type=none",
"-Dspring.main.banner-mode=off",
"-Dlogging.pattern.console=",
"-jar",
"~/JavaFileSystemMCP/target/devoxx-filesystem-0.0.1-SNAPSHOT.jar"
]
}
}
}The "command" value is the author's Liberica JDK 23; yours is the full path to your own Java 17 or later executable. The -jar value is the full path to target/devoxx-filesystem-0.0.1-SNAPSHOT.jar inside your MCPJavaFileSystem clone. Write both out in full: Claude Desktop does not expand ~.