<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Antika Burman on Medium]]></title>
        <description><![CDATA[Stories by Antika Burman on Medium]]></description>
        <link>https://medium.com/@antikaburman7?source=rss-a4b9acc84136------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a2kz64E-f4X0lWpmF_NzTQ.png</url>
            <title>Stories by Antika Burman on Medium</title>
            <link>https://medium.com/@antikaburman7?source=rss-a4b9acc84136------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:11:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antikaburman7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Java MCP Server: Connecting Spring Boot Microservices to Claude Desktop]]></title>
            <link>https://medium.com/@antikaburman7/java-mcp-server-connecting-spring-boot-microservices-to-claude-desktop-151676a6ff43?source=rss-a4b9acc84136------2</link>
            <guid isPermaLink="false">https://medium.com/p/151676a6ff43</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Antika Burman]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 11:30:11 GMT</pubDate>
            <atom:updated>2026-03-17T11:30:11.439Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>If you’ve been following the AI tooling space, you’ve probably heard of MCP or Model Context Protocol. Most examples you’ll find online are in Python or Node.js. This article is for the Java developers who want to do the same thing without leaving the Spring Boot ecosystem.</p><p>We’ll build a real MCP server from scratch using Spring Boot and Spring AI, wire it up to a set of existing microservices, and connect it to Claude Desktop as the MCP Client. By the end, you’ll be able to type a plain English query into Claude Desktop and have it call your live Spring Boot APIs in real time.</p><h3>Why Java / Spring Boot?</h3><p>If you search for MCP server examples today, you’ll find Python and Node.js everywhere. The official Anthropic docs, most GitHub repos, and nearly every Medium article uses one of the two. That’s fine but it leaves a massive gap for the enterprise Java world.</p><h3>Understanding MCP Architecture And Communication</h3><p>MCP (Model Context Protocol) is an open standard introduced by Anthropic that defines how AI models communicate with external tools and data sources. Think of it as USB-C for AI, a universal connector between a model and the outside world.</p><p>The protocol has two sides:</p><ul><li><strong>MCP Server</strong> — exposes tools (functions the AI can call), resources (data the AI can read), and prompts. In our case, this is the Spring Boot app.</li><li><strong>MCP Client</strong> — connects to the server and decides when to call which tool. Claude Desktop acts as the client here.</li><li><strong>Transport</strong> — For communication, locally, the MCP Client launches the JAR as a process and talks via stdin/stdout; remotely, the MCP Client connects to a hosted server over HTTP + SSE.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*iZiNrhAoG3RrFNpqq7i8gw.png" /></figure><h3>Why is it a Game Changer</h3><p>Before MCP, connecting AI to external systems meant custom glue code for every tool and every model. MCP standardizes that with one universal protocol where you can build your tools once, connect any compatible AI. For instance, instead of asking an LLM how to raise a Jira ticket, it can create one for you by pulling context from your codebase, assigning the right team, and setting the priority.</p><h3>Setting Up the Spring Boot MCP Server</h3><h4>Spring Initializr setup :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHlu2Qd-LE4OLofT6vNxFA.png" /></figure><h4>Main Dependency :</h4><p><strong>spring-ai-starter-mcp-server</strong></p><p>This single dependency is what makes your Spring Boot app an MCP server. It brings in everything including the MCP protocol handling, stdio transport, tool registration, and the @Tool / @ToolParam annotations.</p><p>Managed via the Spring AI BOM so no version needed on the dependency itself:</p><p><strong>Note:</strong> As of March 2026, spring-ai 1.0.0 requires Spring Boot 3.4.x. Spring Initializr defaults to 4.0.x . Change the parent version in pom.xml to 3.4.3 after downloading, otherwise the MCP server will not respond correctly to the MCP Client.</p><p>If you already have a Spring Boot app, add these to your existing pom.xml:</p><pre>&lt;dependencyManagement&gt;<br> &lt;dependencies&gt;<br> &lt;dependency&gt;<br> &lt;groupId&gt;org.springframework.ai&lt;/groupId&gt;<br> &lt;artifactId&gt;spring-ai-bom&lt;/artifactId&gt;<br> &lt;version&gt;1.0.0&lt;/version&gt;<br> &lt;type&gt;pom&lt;/type&gt;<br> &lt;scope&gt;import&lt;/scope&gt;<br> &lt;/dependency&gt;<br> &lt;/dependencies&gt;<br>&lt;/dependencyManagement&gt;</pre><pre>&lt;dependencies&gt;<br> &lt;dependency&gt;<br> &lt;groupId&gt;org.springframework.ai&lt;/groupId&gt;<br> &lt;artifactId&gt;spring-ai-starter-mcp-server&lt;/artifactId&gt;<br> &lt;/dependency&gt;<br>&lt;/dependencies&gt;</pre><h4>Key settings that make the MCP server work correctly:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEC7G6067pAhkJ9gNyv5bQ.png" /></figure><ul><li>web-application-type=none : no HTTP server, stdio only. Remove this if you’re building a remote MCP server over HTTP + SSE.</li><li>banner-mode=off and logging.level.root=OFF : silence all console output so stdout stays clean for MCP JSON communication</li><li>logging.file.name : redirect logs to a file using an absolute path (relative paths fail when MCP Client launches the JAR)</li></ul><h4>Writing MCP Tools</h4><p>Spring AI provides two annotations that turn a regular Java method into an MCP-callable tool. Spring AI just needs the object to be a Spring-managed bean so it can be injected into McpConfig :</p><ul><li><em>@Tool(description = “…”) </em>— marks a method as a tool and describes what it does. The MCP Client uses this description to decide <em>when</em> to call it, so write it clearly in plain English.</li><li><em>@ToolParam(description = “…”) </em>— describes each parameter so the MCP Client knows what to pass.</li></ul><p>Each method calls a downstream microservice via RestTemplate and returns the response as a String which the MCP Client receives as the tool result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLfPVq46qtj3-NNRth8JXw.png" /></figure><h4>McpConfig.java — Registering Tools as Beans</h4><p>Spring AI won’t auto-discover your tools. You need to explicitly register them as a ToolCallbackProvider bean. This is what the MCP server reads at startup to know which tools to advertise to the MCP Client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRj6-J31-I9ECq3MM_B4Pg.png" /></figure><p>Rest everything goes as usual</p><h3>Connecting to Claude Desktop</h3><p>In this setup, Claude Desktop acts as the MCP Client. It launches your Spring Boot JAR as a local process, performs the MCP handshake, discovers your tools, and decides when to call them based on the conversation. All you need to do is tell it where the JAR lives.</p><h4>Build the JAR</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*O8DsMnx6GbCIHNzsoHzOqA.png" /></figure><p>This generates the JAR at: target/mcp-server-0.0.1-SNAPSHOT.jar</p><h4>Configure Claude Desktop</h4><p>Go to Claude Desktop -&gt; Settings -&gt; Developer (under Desktop App) -&gt; Edit Config</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20obviCBAR7lu_YjEKZPww.png" /></figure><p>Add your MCP server:</p><p>Note : Use the full absolute path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lpFzCdmGGaQZD19Qy6CQg.png" /></figure><h4>Restart Claude Desktop</h4><p>Fully quit (Cmd+Q on Mac, not just close the window) and reopen. Claude Desktop launches the JAR as a local process on startup. It will not pick up config changes until restarted.</p><h3>It Works!</h3><p>Type a natural language query in Claude Desktop and it automatically identifies the right tool to call, requests permission, hits your microservice, and formats the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7ZuosXodZZ3CHLVSPBp1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D8An3zrqtuWtEXAGNSPW9w.png" /></figure><h3>How the MCP Server Sits Alongside Existing Microservices</h3><p>The MCP server is not a replacement for any existing service, it is an additional layer that sits alongside your microservices and acts as an AI-facing orchestration layer. Your existing services don’t change at all.</p><p>As shown in the diagram, the MCP Server sits between the MCP Client and your microservices receiving natural language intent from the top and making targeted HTTP calls downward. The response travels back up the same chain as a String.</p><p>Each @Tool method in the MCP server is essentially a use-case wrapper which knows which microservice to call, what parameters to pass, and how to return the result in a format the MCP Client can understand. One method, one responsibility, one downstream service.</p><p>This also means your existing team structure stays intact. The existing services continue to be developed and deployed independently. The MCP Server simply orchestrates them from above ; no shared databases, no tight coupling, no changes to existing APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*YY2VJSNICJP9IHf2ueb1GA.png" /></figure><h3>GitHub Repo Link</h3><p><a href="https://github.com/Antika7/greengrub-mcp-server">https://github.com/Antika7/greengrub-mcp-server</a></p><h3>Offical Documentation / Resource Links</h3><p>MCP — <a href="https://modelcontextprotocol.io/docs/getting-started/intro">https://modelcontextprotocol.io/docs/getting-started/intro</a></p><p>Spring AI — <a href="https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html">https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=151676a6ff43" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>