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:
Power your agent
Cài đặt từ nhà phát hành. Không phải endpoint của PlugMCP.
Host a copy with our keys and logs.
Chưa có bản phát hành đóng gói nào trong registry. Làm theo README của kho mã.
URL từ xa hay một lệnh trên máy của bạn? Hai cách cài đặt khác nhau thế nào
Chạy trên PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
MởTừ nhà phát hành
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.
This MCP server exposes the following tools:
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.
brew install jdtls)mvn clean package
This creates a shaded JAR at target/lsp4j-mcp-1.0.0-SNAPSHOT.jar.
./run.sh /path/to/your/java/project
java -jar target/lsp4j-mcp-1.0.0-SNAPSHOT.jar <workspace-path> <jdtls-command>
Example:
java -jar target/lsp4j-mcp-1.0.0-SNAPSHOT.jar /Users/me/projects/myapp jdtls
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"
}
}
}
}
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.
LSP4J-MCP/
├── pom.xml # Maven build configuration
├── run.sh # Startup script
├── mcp-config.json # Example MCP configuration
├── src/
│ ├── main/
│ │ ├── java/com/devoxx/lsp4jmcp/
│ │ │ ├── client/
│ │ │ │ ├── JdtlsClient.java # LSP client for JDTLS
│ │ │ │ └── JdtlsLanguageClient.java # LSP callback handler
│ │ │ ├── tools/
│ │ │ │ └── JavaTools.java # Tool implementations
│ │ │ └── server/
│ │ │ └── McpServerMain.java # MCP server entry point
│ │ └── resources/
│ │ └── logback.xml # Logging configuration
│ └── test/
│ └── java/com/devoxx/lsp4jmcp/
│ ├── client/JdtlsClientTest.java
│ ├── tools/JavaToolsTest.java
│ └── server/McpServerMainTest.java
└── README.md
Run all tests:
mvn test
Once the MCP server is configured, you can ask your AI assistant questions that will trigger the LSP tools. Here are some examples:
"Find all classes named Repository in this project"
"Search for methods containing 'save' in their name"
"Where is the UserService class defined?"
"List all interfaces in this codebase"
"Find all usages of the
processOrdermethod at line 45 in OrderService.java"
"Where is the
CustomerRepositoryinterface used throughout the codebase?"
"Show me all places that call the constructor at line 12 of PaymentGateway.java"
"What is the definition of the method being called at line 78, column 15 in CheckoutController.java?"
"Take me to the implementation of the interface method at line 23 in MyService.java"
"List all methods and fields in the Customer.java file"
"What symbols are defined in src/main/java/com/example/service/OrderService.java?"
"Give me an overview of the structure of ConfigurationManager.java"
"Which interfaces define a method called 'findById'?"
"Find all classes that have a method named 'process'"
"Show me all interfaces containing the 'validate' method"
"I need to understand how the
authenticatemethod works. First find its definition, then show me all places it's called."
"Refactor help: Find all usages of the deprecated
legacyProcessmethod so I can update them"
"I want to implement a new Repository interface. Show me all existing Repository interfaces and their methods."
Logs are written to the file specified by the LOG_FILE environment variable (default: /tmp/lsp4j-mcp.log).
Note: stdout is reserved for MCP protocol communication, so all logging goes to file.
Claude Code ──MCP──▶ McpServerMain ──LSP4J──▶ JDTLS ──▶ Java Codebase
│
▼
JavaTools
(find_symbols, find_references, etc.)
The server:
MIT
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.
Công cụ
Chưa có danh sách công cụ. Máy chủ từ xa sẽ có danh sách sau lần kiểm tra tình trạng đầu tiên.
Câu hỏi thường gặp
Sao chép cấu hình stdio cho Cursor, Claude Desktop, Claude Code hoặc VS Code trên trang này. Cấu hình dùng bản cài đặt của nhà phát hành, không phải proxy của PlugMCP.
Bản ghi này không liệt kê biến môi trường bắt buộc nào.
LSP4J chạy cục bộ qua stdio.
Kiểm tra lần cuối: 2026-10-27. 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.