Java Now Speaks Model Context Protocol |
Written by Nikos Vaggalis |
Tuesday, 18 February 2025 |
The Java SDK implementation of the Model Context Protocol gets to pre-release version 0.70, opening the way for Java to enjoy transparent interoperability with AI services. The official Java SDK is actually the same as Spring AI MCP which is now deemed mature enough to become Java's official SDK. The Model Context Protocol (MCP) is of course an open protocol developed by Anthropic, which enables seamless integration with language models and AI tools from a variety of programming languages. The protocol is already picking up steam quickly as it can be used to build a variety of applications:
At its core, MCP follows a client-server architecture where a host application can connect to multiple servers, with MCP Servers being lightweight programs that each expose specific capabilities through the standardized Model Context Protocol. Thus they function as the standardized interface and the foundational layer for Large Language Models (LLMs) to interact with data sources, tools, and AI agents. Examples of MCP servers: Filesystem MCP Server SQLite MCP Server Time MCP Server Sequential Thinking MCP Server As far as clients who consume those services offered by the servers goes, there's : Claude Desktop Cline Windsurf IDE etc Now back to Java. The initial Spring AI MCP project began just last November as the offspring of a collaboration between Anthropic and the Spring team. While it initially was labeled as experimental, it deemed so good that it finally turned out in the official Java sdk. The main components of the MCP SDK aside, Server and Client, there's two more :
The SDK supports both synchronous and asynchronous APIs, allowing for flexible integration in different application contexts. For instance to create a server with custom configuration and the sync api : McpSyncServer syncServer = McpServer.sync(transport) // Initialize the server to create server with custom configuration and the async api : McpAsyncServer asyncServer = McpServer.async(transport) // Initialize the server
To get started, there's a great demo application showcasing the integration of Spring AI with SQLite databases using the Model Context Protocol (MCP) which enables natural language interactions with SQLite databases through a command-line interface. It uses the SQLite MCP-Server to enable running SQL queries, analyzing business data, and automatically generating business insight memos. The MCP Java SDK comes at the right time when, as highlighted by the recent Azure Survey that we covered in Where's Java Going In 2025?, Java aims to compete with Python in enterprise settings that incorporate AI. The new SDK is certainly going to drive adoption of Java further. More InformationAnnouncing Spring AI MCP: A Java SDK for the Model Context Protocol Introducing the Model Context Protocol Java SDK Related Articles
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
Last Updated ( Wednesday, 19 February 2025 ) |