SL

stephanj/lsp4j-mcp

Developer tools

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

39 stars 6 forks 품질 67 트렌드 20

LSP4J를 사용하여 JDTLS (Eclipse JDT Language Server)를 감싸는 Java MCP (모델 Context Protocol) 서버는 Claude와 같은 AI 조수에 Java IDE 기능을 제공합니다.

개요

LSP4J를 사용하여 JDTLS (Eclipse JDT Language Server)를 감싸는 Java MCP (모델 Context Protocol) 서버는 Claude와 같은 AI 조수에 Java IDE 기능을 제공합니다. 이 MCP 서버는 다음과 같은 도구를 노출: - Java 21+ - Maven 3.8+ - JDTLS 설치 (예를 들어, Homebrew를 통해: Brew install jdtls) 이것은 대상 / lsp4j-mcp-1.0.0-SNAPSHOT.jar에서 그늘진 JAR를 만듭니다. 멀티 스테이지 이미지를 만듭니다. 그것은 포함 자바 21, 그늘 MCP 서버, 핀 Eclipse JDTLS 배포: stdio에 실행하고 /workspace에서 Java 프로젝트를 마운트: Linux에서, 언어 서버가 프로젝트 메타데이터를 마운트 워크스페이스로 작성해야 할 때 호스트 UID/GID를 사용합니다. 서버는 stdio를 사용하므로 이미지는 네트워크 포트가 노출되지 않습니다. 컨테이너 로그는 stdout이 MCP 프로토콜에 대해 예약 한 동안 stderr에 기록됩니다. 이미지는 UID/GID 10001로 기본적으로 실행되며 최소 1GB의 컨테이너 메모리를 기대합니다.

개요(AI 번역)

LSP4J를 사용하여 JDTLS (Eclipse JDT Language Server)를 감싸는 Java MCP (모델 Context Protocol) 서버는 Claude와 같은 AI 조수에 Java IDE 기능을 제공합니다.

특징

이 MCP 서버는 다음과 같은 도구를 노출:

도구 설명
find_symbols 이름의 Java 기호 검색(종류, 방법, 필드)
find_references 주어진 파일 위치의 기호에 대한 모든 참조를 찾아
[T2] find_definition 【공식】 기호의 정의로 이동
document_symbols Java 파일에 정의된 모든 기호를 가져옵니다
find_interfaces_with_method 주어진 이름을 가진 방법을 포함하는 모든 인터페이스를 찾아

필수품

  • 자바 21+
  • 평균 3.8+
  • JDTLS 설치 (예 : Homebrew를 통해 : brew install jdtls)

빌드

이것은 target/lsp4j-mcp-1.0.0-SNAPSHOT.jar]에서 그늘진 JAR를 만듭니다.

사용법

옵션 1: 스크립트 실행

옵션 2: Java 명령을 지시

예:

옵션 3: 클로드 코드 MCP 구성

.mcp.json에 추가:

옵션 4: 도커

다단계 이미지를 만듭니다. 그것은 포함 자바 21, 그늘 MCP 서버, 그리고 Pinned Eclipse JDTLS 배급:

stdio를 실행하고 /workspace]에서 Java 프로젝트를 마운트:

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

README

원문 README의 일부입니다. 원문 보기.

LSP4J-MCP Server

A Java MCP (Model Context Protocol) server that wraps JDTLS (Eclipse JDT Language Server) using LSP4J to provide Java IDE features to AI assistants like Claude.

Features

This MCP server exposes the following tools:

Tool Description
find_symbols Search for Java symbols (classes, methods, fields) by name
find_references Find all references to a symbol at a given file location
find_definition Go to the definition of a symbol
document_symbols Get all symbols defined in a Java file
find_interfaces_with_method Find all interfaces containing a method with a given name

Prerequisites

  • Java 21+
  • Maven 3.8+
  • JDTLS installed (e.g., via Homebrew: brew install jdtls)

Build

mvn clean package

This creates a shaded JAR at target/lsp4j-mcp-1.0.0-SNAPSHOT.jar.

Usage

Option 1: Run Script

./run.sh /path/to/your/java/project

Option 2: Direct Java Command

java -jar target/lsp4j-mcp-1.0.0-SNAPSHOT.jar  

Example:

java -jar target/lsp4j-mcp-1.0.0-SNAPSHOT.jar /Users/me/projects/myapp jdtls

Option 3: Claude Code MCP Configuration

Add to your .mcp.json:

{
  "mcpServers": {
    "java-lsp": {
      "command": "java",
      "args": [
        "-jar",
        "/path/to/LSP4J-MCP/target/lsp4j-mcp-1.0.0-SNAPSHOT.jar",
        "/path/to/your/java/project",
        "jdtls"
      ],
      "env": {
        "LOG_FILE": "/tmp/lsp4j-mcp.log"
      }
    }
  }
}

Option 4: Docker

Build the multi-stage image. It includes Java 21, the shaded MCP server, and a pinned Eclipse JDTLS distribution:

docker build -t lsp4j-mcp:local .

Run it over stdio and mount the Java project at /workspace:

docker run --rm -i \
  --mount type=bind,source=/absolute/path/to/java/project,target=/workspace \
  lsp4j-mcp:local

On Linux, use the host UID/GID when the language server needs to write project metadata into the mounted workspace:

docker run --rm -i \
  --user "$(id -u):$(id -g)" \
  --mount type=bind,source=/absolute/path/to/java/project,target=/workspace \
  lsp4j-mcp:local

Example MCP configuration:

{
  "mcpServers": {
    "java-lsp-docker": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--mount",
        "type=bind,source=/absolute/path/to/java/project,target=/workspace",
        "lsp4j-mcp:local"
      ]
    }
  }
}

The server uses stdio, so the image exposes no network port. Container logs are written to stderr while stdout remains reserved for the MCP protocol. The image runs as UID/GID 10001 by default and expects at least 1 GB of container memory.

Project Structure

LSP4J-MCP/
├── pom.xml                              # Maven build configuration
├── run.sh                               # Startup script
GitHub에서 전체 README 보기

설치

docker run --rm -i --mount type=bind source=/absolute/path/to/java/project target=/workspace lsp4j-mcp:local
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "java-lsp": { "command": "java", "args": [ "-jar", "/path/to/LSP4J-MCP/target/lsp4j-mcp-1.0.0-SNAPSHOT.jar", "/path/to/your/java/project", "jdtls" ], "env": { "LOG_FILE": "/tmp/lsp4j-mcp.log" } } } }