LabscoMCP early access ↗
BeamLiuMCP SERVER

Javadoc MCP

Turn a Java project's Javadoc into structured JSON, then search classes and methods from a chat with fuzzy matching.

by BeamLiu ↗Framework & SDK Documentation LookupCommunity

LABSCO SUMMARY

It answers the question a model usually guesses at.

Asking a model about an internal Java API is where hallucinated method signatures come from, because the documentation was never in its training data. Generating JSON from your own source and putting a search tool over it replaces the guess with a lookup. The crawl path is narrower than it sounds — it targets one vendor's HTML documentation today, with the parser named as the place to extend — so plan on the source-code route unless yours happens to match.

What it is

Two pieces that work together: a Maven plugin that converts Java documentation into structured JSON, and a Node.js MCP server that searches that JSON. The point is to give a model accurate API documentation for your own code — or for a library whose docs only exist as HTML — instead of relying on what it remembers.

What you get

  • search_all searches everything at once, search_classes and search_methods narrow it to one kind
  • get_class_details returns the full record for a fully qualified class name
  • get_stats reports what the indexed documentation actually covers
  • Fuzzy matching through Fuse.js, so an approximate name still finds the right class
  • Coverage across classes, methods, constructors and fields, with duplicate entries merged automatically
  • Two ways to produce the JSON: generate it from source with the plugin's javadoc-json goal, which supports Java 8 and above, or crawl an existing HTML Javadoc site with the crawl goal
  • Lombok projects handled through a delombok step, so generated accessors appear in the documentation

Requirements

For generating documentation: Maven, with the plugin java-docs-json-doclet from group io.github.beamliu, version 0.1.1 added to the project, then mvn javadoc-json:javadoc-json. For serving it: Node.js, with npx @io.emop/mcp-javadoc-server --javadoc-path /path/to/javadoc-json; the published package version is 0.1.6. The crawl goal currently targets one vendor documentation site, and the parser class is the extension point for others. Package filtering uses regex patterns, and proxy settings are configurable for crawling.

Setup effort

Follow the published steps — mvn javadoc-json:javadoc-json