Filesystem MCP server

Provides a filesystem and web access server that enables interaction with local files and web resources through standardized tools, supporting operations like reading, writing, searching, and editing files, as well as fetching web page content with robust error handling.
Back to servers
Provider
Stephan Janssen
Release date
Mar 26, 2025
Language
Java
Stats
15 stars

The Java Filesystem & Web MCP Server implements the Model Context Protocol (MCP) to enable AI assistants to interact with both local filesystem and web resources. It provides a set of tools that allow LLMs to read, write, and edit files, search directories, and fetch web content through a standardized protocol.

Installation

Prerequisites

  • Java 17 or higher
  • Maven 3.6+
  • Spring Boot 3.3.6
  • Spring AI MCP Server components

Building from Source

Build the project using Maven:

mvn clean package

Starting the Server

Run the server using the following command:

java -jar target/devoxx-filesystem-0.0.1-SNAPSHOT.jar

Note that the server uses STDIO for communication and doesn't expose HTTP endpoints. It's designed to be launched by an MCP client.

Available Tools

Filesystem Operations

Reading Files

readFile(String fullPathFile)

Reads the complete contents of a file with proper encoding detection and provides detailed error messages if the file cannot be read.

Writing Files

writeFile(String path, String content)

Creates a new file or overwrites an existing file with new content. Automatically creates parent directories if they don't exist.

Editing Files

editFile(String path, String edits, Boolean dryRun)

Makes line-based edits to text files. Returns a git-style diff showing the changes made. Use the dryRun parameter to preview changes without applying them.

Searching Files

searchFiles(String path, String pattern)

Recursively searches for files and directories matching a pattern. The search is case-insensitive and matches partial names.

Listing Directories

listDirectory(String path)

Gets a detailed listing of all files and directories in a specified path, clearly distinguishing between files and directories with additional metadata.

Web Operations

Fetching Web Pages

fetchWebpage(String url, Integer timeoutMs)

Retrieves content from web pages with configurable timeouts. Uses jsoup to connect to the webpage and fetch its content.

Configuration

The 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.log

Integration with Other Tools

DevoxxGenie Configuration

To integrate with DevoxxGenie:

  1. Access the MCP Server configuration screen in DevoxxGenie
  2. Configure with the following settings:
    • Name: JavaFilesystem (or any descriptive name)
    • Transport Type: STDIO
    • Command: Full path to your Java executable
    • Arguments:
      -Dspring.ai.mcp.server.stdio=true
      -Dspring.main.web-application-type=none
      -Dlogging.pattern.console=
      -jar
      /path/to/devoxx-filesystem-0.0.1-SNAPSHOT.jar
      

Claude Desktop Integration

To use with Claude Desktop, edit your claude_desktop_config.json file and add:

java -jar target/devoxx-filesystem-0.0.1-SNAPSHOT.jar

Security Considerations

When using this server, be aware of the following security implications:

  • The LLM agent will have access to read and write files on the host system
  • The agent can fetch content from any accessible web URL
  • Consider running the server with appropriate permissions in a controlled environment
  • The server does not implement authentication or authorization mechanisms
  • Consider network firewall rules if restricting web access is required

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later