SM

stephanj/mcpjavafilesystem

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

25 stars 11 forks 품질 51 트렌드 0

이 프로젝트는 큰 언어 모델 (LLM) 에이전트에 대한 파일 시스템 운영 및 웹 액세스 도구를 제공하는 모델 Context Protocol (MCP) 서버를 구현합니다.

개요

이 프로젝트는 큰 언어 모델 (LLM) 에이전트에 대한 파일 시스템 운영 및 웹 액세스 도구를 제공하는 모델 Context Protocol (MCP) 서버를 구현합니다. 그것은 AI 조수가 잘 정의 된 작업을 통해 로컬 파일 시스템 및 웹 리소스와 상호 작용 할 수 있습니다. 서버는 다음과 같은 작업을 제공합니다: - : 적절한 인코딩 검출을 가진 파일의 전체 내용을 읽으십시오 - : 새 콘텐츠로 파일 생성 또는 덮어쓰기 - : git-style diff 생성과 함께 라인 기반 편집을 만드십시오 - : glob 패턴을 사용하여 파일 및 디렉토리에 대한 반복적으로 검색 - : 디렉토리 내용의 상세한 목록을 가져옵니다 - : 디렉토리 및 배열 된 디렉토리 구조 생성 - : 줄 번호 및 컨텍스트가있는 파일 내의 텍스트 패턴 검색, 유닉스 grep 명령과 유사합니다 - : 시스템 쉘에서 bash 명령을 실행하고 출력을 캡처하고 출력합니다. - : configurable timeout로 웹페이지에서 콘텐츠를 검색 - : HTML 문서에서 텍스트 콘텐츠를 추출 이 작업은...

개요(AI 번역)

이 프로젝트는 큰 언어 모델 (LLM) 에이전트에 대한 파일 시스템 운영 및 웹 액세스 도구를 제공하는 모델 Context Protocol (MCP) 서버를 구현합니다. 그것은 AI 조수가 잘 정의 된 작업을 통해 로컬 파일 시스템 및 웹 리소스와 상호 작용 할 수 있습니다.

특징

서버는 다음과 같은 작업을 제공합니다:

파일 시스템 운영

-Reading Files: 적절한 인코딩 감지를 가진 파일의 전체 내용을 읽어

  • ** 파일 쓰기 **: 새 콘텐츠로 파일 생성 또는 삭제
  • Editing Files: git-style diff 생성을 이용한 라인 기반 편집 -Searching Files: glob 패턴을 사용하여 파일 및 디렉토리에 대한 반복적으로 검색 -Listing Directories: 디렉토리 내용의 상세 목록 보기
  • Directory Creation: 디렉터리 및 배열된 디렉토리 구조 생성
  • Grep Files : 유닉스 grep 명령과 같은 라인 번호 및 컨텍스트로 파일 내 텍스트 패턴 검색
  • Bash Command: 시스템 쉘에서 bash 명령을 실행하고 출력을 캡처

웹 운영

-Web Page Fetching: 설정 가능한 타임아웃으로 웹페이지에서 콘텐츠를 검색

이 페이지는 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)
GitHub에서 전체 README 보기

설치

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" ] } } }