java-lsp-mcp
Supports Gradle-based Java projects, providing workspace and dependency navigation, diagnostics, compilation, tests, and refactoring previews for Gradle project structures.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@java-lsp-mcpfind affected tests for the change in PaymentService.java"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
java-lsp-mcp
Java semantic intelligence for Model Context Protocol (MCP) clients, powered by Eclipse JDT Language Server and ECJ.
java-lsp-mcp gives coding agents semantic navigation, diagnostics, compilation, tests, and refactoring previews. It never edits source files: changes are returned as hash-bound edits and optional diffs for the client to apply.
Features
Workspace and dependency navigation
Maven, Gradle, Eclipse, modular, and unmanaged projects
Current-snapshot diagnostics and ECJ compilation
Parallel JUnit tests, suspended JDWP test launches, affected-test discovery, and JaCoCo coverage
Read-only fixes, refactorings, import, and formatting previews
Bounded, paginated agent-friendly results
Related MCP server: JDTLS-MCP
Requirements
Release archives bundle Node.js and JDT LS; provide a JDK through JAVA_HOME or --tooling-jdk. Source builds require Node.js 24 and npm.
Quick start
npm ci
npm run fetch-runtime
npm run check
bin/java-lsp-mcp serve --workspace /absolute/path/to/project --trust-workspaceOn Windows use bin\java-lsp-mcp.cmd. Run java-lsp-mcp doctor --workspace /project to check setup. See Getting started for client configuration and trust guidance.
Tools
Tool | Purpose |
| Readiness and runtime status |
| Source declarations |
| Workspace and dependency symbols |
| Symbol declarations |
| Semantic usages |
| Callers and callees; incoming callers default to production scope |
| Supertypes, subtypes, implementations |
| Current-snapshot diagnostics |
| ECJ workspace compilation with automatic loaded-prerequisite recovery |
| JUnit execution or suspended JDWP debug launch ( |
| Statically connected tests |
| Candidate unused private members |
| Available fixes and refactorings |
| Rename, action, import, format previews |
| Discover local JVMs started with the JDWP agent |
| JDWP debug-session lifecycle |
| Source breakpoints and bounded stop-event waits |
| Filtered runtime thread/stack, local, collection, and object inspection |
| Continue and step over, into, or out |
| ECJ/JDI Hot Code Replace with change and active-frame reporting |
See the tool reference or run java-lsp-mcp describe-tools.
Documentation
Contributing
Contributions are welcome. See CONTRIBUTING.md.
Security
Review SECURITY.md before granting workspace trust. Report vulnerabilities privately.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Ship better Java with your coding agent.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Project memory, semantic code search, and grounded agent context.
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides Java development capabilities through Eclipse JDT.LS, enabling symbol navigation, code diagnostics, workspace searching, and Javadoc access across Java projects.10MIT
- AlicenseNot gradedqualityBmaintenanceExposes Eclipse JDT Language Server to AI agents via MCP. Embedded OSGi architecture runs jdtls in the same JVM — no subprocess, no network hop. Tools: hover, definition, references, completion, diagnostics, document & workspace symbols.4Eclipse Public 2.0
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.9 npm191MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to perform local code search, indexing, and analysis across Java, JavaScript/TypeScript, .NET/C#, and Python projects through the MCP protocol.1Apache 2.0