
stephanj/mcpjavafilesystem
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
このプロジェクトでは、大規模なランゲージモデル(LLM)エージェントのファイルシステム操作とWebアクセスツールを提供するモデルコンテキストプロトコル(MCP)サーバーを実装しています.
概要
このプロジェクトでは、大規模なランゲージモデル(LLM)エージェントのファイルシステム操作とWebアクセスツールを提供するモデルコンテキストプロトコル(MCP)サーバーを実装しています。 AIアシスタントは、定義された操作のセットを通じて、ローカルファイルシステムとWebリソースの両方と相互作用することを可能にします。 サーバは、以下の操作を行います。 - : 適切なエンコーディング検出でファイルの完全なコンテンツを読みます - : 新規コンテンツでファイルを作成するか、上書き - : git-style diff 生成で行ベースの編集を行います - : 再帰的にファイルとディレクトリの検索 - : ディレクトリのコンテンツの詳細なリストを取得する - : ディレクトリとネストされたディレクトリ構造を作成 - : 行番号とコンテキストを持つファイル内のテキストパターンを検索し、Unix grep コマンドと同様に - : システムシェルで bash コマンドを実行し、出力する - : 設定可能なタイムアウトでWebページからコンテンツを取得する - : HTML文書からテキストコンテンツを抽出する これらの操作は、...
概要(AI 翻訳)
このプロジェクトでは、大規模なランゲージモデル(LLM)エージェントのファイルシステム操作とWebアクセスツールを提供するモデルコンテキストプロトコル(MCP)サーバーを実装しています。 AIアシスタントは、定義された操作のセットを通じて、ローカルファイルシステムとWebリソースの両方と相互作用することを可能にします。
##特徴
サーバは、以下の操作を行います。
ファイルシステム操作
-Reading Files:適切なエンコーディング検出でファイルの完全な内容を読む
- 書き込みファイル: 新規コンテンツでファイルを作成または上書きする
- Editing Files: 線ベースの編集を git-style diff 生成
- Searching Files: 不具合パターンを使用してファイルとディレクトリを再帰的に検索 -Listing Directories: ディレクトリの内容の詳細なリストを取得する -Directory Creation:ディレクトリとネストされたディレクトリ構造を作成する -Grep Files: Unix grepコマンドと同様に、行番号とコンテキストを持つファイル内のテキストパターンを検索
- Bash Command:システムシェルで bash コマンドを実行し、出力をキャプチャ
###Webオペレーション -Webページのフェッチ:設定可能なタイムアウトでWebページからコンテンツを取得する
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Java Filesystem & Web MCP Server
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.
Features
The server provides the following operations:
Filesystem Operations
- Reading Files: Read the complete contents of a file with proper encoding detection
- Writing Files: Create or overwrite files with new content
- Editing Files: Make line-based edits with git-style diff generation
- Searching Files: Recursively search for files and directories using glob patterns
- Listing Directories: Get detailed listings of directory contents
- Directory Creation: Create directories and nested directory structures
- Grep Files: Search for text patterns within files with line numbers and context, similar to Unix grep command
- Bash Command: Execute bash commands in the system shell and capture their output
Web Operations
- Web Page Fetching: Retrieve content from web pages with configurable timeouts
- HTML Content Extraction: Extract text content from HTML documents
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.
Example of the MCP Java tool with DevoxxGenie
Getting Started
Prerequisites
- Java 17 or higher
- Maven 3.6+
- Spring Boot 3.3.6
- Spring AI MCP Server components
Building the Project
Build the project using Maven:
mvn clean package
Running the Server
The server supports two transport modes:
SSE Mode (HTTP-based, default)
Run the server for SSE-based communication:
java -jar target/devoxx-filesystem-0.0.1-SNAPSHOT.jar
This starts an HTTP server on port 8081 with the SSE endpoint at /sse.
STDIO Mode (for MCP clients like Claude Desktop or DevoxxGenie)
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.jar
Important 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 logging
Tool Services
Filesystem Tools
ReadFileService
readFile(String fullPathFile)
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"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"
]
}
}
}