Awesome MCPJava

theronic/modex

⭐ 120 Clojure added to this list on 2025-04-09 repository created 2025-03-05

Modex, short for Model and Context, is a Clojure library that implements most of the Model Context Protocol so that servers and clients can be written in idiomatic Clojure rather than through interop with the Anthropic MCP Java SDK. It implements the stdio transport from the 2024-11-05 revision of the specification, which removes the need for a bridging proxy between SSE and stdio. The library covers the three MCP primitives: tools that a model can invoke, resources that it can read, and prompt templates. Internally a tool is a record holding a name, docstring, argument list and handler, with each argument represented as a parameter record carrying its own name, docstring, type, required flag and default. Rather than building those records by hand, authors use the tool and tools macros, which look like defrecord: the handler destructures a map of arguments and accepts optional :type, :or and :doc maps that supply the metadata sent to the client. Presence of a key in the :or map marks the argument optional, missing parameter docstrings fall back to the parameter name, and the supported parameter types follow the specification limits of string and number. Handlers return a vector so that a tool can yield multiple values. Tools are invoked through invoke-tool, which validates arguments and returns a success flag with the results in the same shape an MCP client would receive from a tools/call request, or through invoke-handler when validation and error handling should be skipped. The tools macro groups several definitions into a map keyed by tool name. The repository ships a runnable example server that builds into an uberjar and is registered with Claude Desktop as a java -jar command. Modex is used by datomic-mcp, which exposes production Datomic databases for schema and query access.

https://github.com/theronic/modex

mcp-frameworkclojurejvmstdiolibrarymcp-servermcp-client

Also in Java

modelcontextprotocol/java-sdk

The MCP Java SDK is the official Java SDK enabling Java applications to interact with AI models and tools through the Model Context Protocol, supporting both synchronous and asynchronous communication and integrating with Spring AI for enhanced functionality.

quarkiverse/quarkus-mcp-server

Quarkus MCP Server is a Quarkus extension that enables developers to implement Model Context Protocol server features for seamless integration between LLM applications and external data sources and tools.

vishalmysore/a2ajava

A pure Java implementation of Google's Agent2Agent protocol for Spring Boot applications, where any agent built with it is also exposed automatically as an MCP tool.