
This project implements a Model Context Protocol (MCP) server that provides filesystem operations
This project implements a Model Context Protocol (MCP) server that provides filesystem operations and web access tools for Large Language Model (LLM) agents. It enables AI assistants to interact with both the local filesystem and web resources through a set of well-defined operations.
·
This project implements a Model Context Protocol (MCP) server that provides filesystem operations and web access tools for Large Language Model (LLM) agents. It enables AI assistants to interact with both the local filesystem and web resources through a set of well-defined operations.
The server provides the following operations:
These operations are exposed as tools for Large Language Models using the Model Context Protocol (MCP), allowing AI systems to safely interact with the filesystem and access web resources.
Build the project using Maven:
mvn clean packageThe server supports two transport modes:
Run the server for SSE-based communication:
java -jar target/devoxx-filesystem-0.0.1-SNAPSHOT.jarThis starts an HTTP server on port 8081 with the SSE endpoint at /sse.
For STDIO-based communication (required by most MCP clients):
java -Dspring.ai.mcp.server.stdio=true \
-Dspring.main.web-application-type=none \
-Dspring.main.banner-mode=off \
-Dlogging.pattern.console= \
-jar target/devoxx-filesystem-0.0.1-SNAPSHOT.jarImportant flags for STDIO mode:
-Dspring.ai.mcp.server.stdio=true - Enables STDIO transport-Dspring.main.web-application-type=none - Disables the web server-Dspring.main.banner-mode=off - Disables Spring Boot banner (required to avoid corrupting JSON-RPC communication)-Dlogging.pattern.console= - Disables console loggingreadFile(String fullPathFile)Reads the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read.
writeFile(String path, String content)Creates a new file or completely overwrites an existing file with new content. Creates parent directories if they don't exist.
editFile(String path, String edits, Boolean dryRun)Makes line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. The dryRun parameter allows viewing changes without applying them.
searchFiles(String path, String pattern)Recursively searches for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names.
listDirectory(String path)Gets a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with additional metadata.
grepFiles(String directory, String pattern, String fileExtension, Boolean useRegex, Integer contextLines, Integer maxResults, Boolean ignoreCase)Searches for text patterns within files. Returns matching files with line numbers and context. Similar to the Unix 'grep' command but with additional features for context display. Supports regex patterns, case-insensitive search, and context lines before/after matches.
createDirectory(List<String> directories)Creates new directories or ensures that directories exist. Can create multiple directories in one operation. If a directory already exists, the operation succeeds silently. Perfect for setting up directory structures for projects or ensuring required paths exist.
executeBash(String command, String workingDirectory, Integer timeoutSeconds)Execute a Bash command in the system shell and return the output. This tool allows running system commands and capturing their standard output and error streams. Use with caution as some commands may have system-wide effects.
fetchWebpage(String url, Integer timeoutMs)Fetches or reads a webpage from a URL and returns its content. The service uses jsoup to connect to the webpage and retrieve its content. The optional timeoutMs parameter allows setting a custom connection timeout.
A comprehensive set of unit tests is provided for all service classes. Run them using:
mvn testThe tests use JUnit 5 and Mockito for mocking external dependencies like the jsoup library for web requests.
Integration tests verify the STDIO transport by spawning the server as a subprocess. First build the JAR, then run integration tests:
mvn package -DskipTests
mvn test -Pintegration-testsTest clients are provided to demonstrate MCP protocol usage:
ClientStdio.java - Demonstrates STDIO transport communicationClientSse.java - Demonstrates SSE transport communicationThe application is configured via application.properties:
spring.main.web-application-type=none
spring.main.banner-mode=off
logging.pattern.console=
spring.ai.mcp.server.name=filesystem-server
spring.ai.mcp.server.version=0.0.1
logging.file.name=,/JavaFileSystemMCP/target/filesystem-server.logJavaFileSystemMCP/
src/
main/
java/
com/
devoxx/
mcp/
filesystem/
tools/
EditFileService.java
ReadFileService.java
WriteFileService.java
SearchFilesService.java
FetchWebpageService.java
ListDirectoryService.java
CreateDirectoryService.java
GrepFilesService.java
BashService.java
McpServerApplication.java
resources/
application.properties
test/
java/
com/
devoxx/
mcp/
filesystem/
tools/
ReadFileServiceTest.java
WriteFileServiceTest.java
EditFileServiceTest.java
SearchFilesServiceTest.java
FetchWebpageServiceTest.java
ListDirectoryServiceTest.java
CreateDirectoryServiceTest.java
GrepFilesServiceTest.java
ClientStdio.java
pom.xml
README.mdThe project uses:
EditFileService includes sophisticated diff generation for tracking changesSearchFilesService supports glob patterns for flexible file matchingFetchWebpageService includes configurable timeouts and robust error handling for web requestsThis server can be easily integrated with DevoxxGenie using the MCP (Model Context Protocol) support. Here's how to set it up:
Name: JavaFilesystem (or any descriptive name)
Transport Type: STDIO
Command: Full path to your Java executable (e.g., /Library/Java/JavaVirtualMachines/liberica-jdk-23.jdk/Contents/Home/bin/java)
Arguments:
-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.jarEnter each argument on a new line. You may need to change the path for -jar to point to where you've built the jar.
Important: The -Dspring.main.banner-mode=off flag is required to disable the Spring Boot banner, which would otherwise interfere with the JSON-RPC communication over STDIO.
Once configured, DevoxxGenie will automatically discover the tools provided by this MCP server. The AI assistant can then use these tools to:
All operations will be performed with the permissions of the user running the DevoxxGenie application.
Edit your claude_desktop_config.json file with the following:
{
"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"
]
}
}
}You may need to change the path for -jar to point to where you've built the jar.
Important: The -Dspring.main.banner-mode=off flag is required to disable the Spring Boot banner, which would otherwise interfere with the JSON-RPC communication over STDIO.
When using this server, be aware that:
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add filesystem -- /Library/Java/JavaVirtualMachines/liberica-jdk-23.jdk/Contents/Home/bin/java -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{
"mcpServers": {
"filesystem": {
"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"
],
"command": "/Library/Java/JavaVirtualMachines/liberica-jdk-23.jdk/Contents/Home/bin/java"
}
}
}code --add-mcp '{"name":"filesystem","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"],"command":"/Library/Java/JavaVirtualMachines/liberica-jdk-23.jdk/Contents/Home/bin/java"}'[mcp_servers.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"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/java-filesystem-and-web-mcp-server to learn what the "Java Filesystem & Web MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
This server runs locally, so we can't read its tool list over the web yet.
We could not run this server: it ships no npx package for our sandbox and no public endpoint. The four checks that need a live server are left out, and the grade tops out at B until one exists.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/java-filesystem-and-web-mcp-server)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "java-filesystem-and-web-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.