kotlin-lib-mcp — browse the sources, API and KDoc of any Maven-published Kotlin/Java library #805
aoreshkov
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
kotlin-lib-mcp gives MCP clients direct access to the real sources of any Maven-published Kotlin/Java library, so an assistant can answer API questions from the actual code instead of guessing from training data.
Point it at a coordinate —
io.ktor:ktor-client-core:3.5.1, or justgroup:artifactfor the latest stable — and it downloads the sources jar, parses it with the Kotlin Analysis API (K2 standalone), and serves structured results from an on-disk cache.GitHub (demo GIF in the README): https://github.com/aoreshkov/kotlin-lib-mcp
Registry:
io.github.aoreshkov/kotlin-lib-mcpWhat it exposes
fetch_library,list_packages,list_declarations,get_api_signature,get_kdoc,get_source,search_source,get_dependencies,list_versions,get_latest_versionkotlinlib://{group}/{artifact}/{version}/indexexplain_public_api(coordinate, package?)MCP details I tried to get right
title, behavior annotations (readOnlyHint,openWorldHint,destructiveHint,idempotentHint) and anoutputSchemaderived from its response DTO — results carry both JSON text and matchingstructuredContent.notifications/message, honoring each session'slogging/setLevel— handy on stdio, where clients routinely discard stderr.fetch_libraryemits progress notifications (download → analyze → cache) when the request carries aprogressToken.--allowed-host/--allowed-originflags.gh attestation verify.Install
Or grab the zip from the releases page (needs Java 21+). There's also an optional Compose Desktop dashboard that embeds the server in-process (control, logs, cache browser).
Built with the Kotlin MCP SDK (
kotlin-sdk-server0.14). Feedback very welcome — especially from anyone pointing it at unusual KMP library setups, since per-target sources-jar resolution via.moduleGradle metadata was the trickiest part.Beta Was this translation helpful? Give feedback.
All reactions