<?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 Hafizur Rahman on Medium]]></title>
        <description><![CDATA[Stories by Hafizur Rahman on Medium]]></description>
        <link>https://medium.com/@hafizur.rahman?source=rss-27ae412408b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YC1Db8-7ZX48g79L.jpg</url>
            <title>Stories by Hafizur Rahman on Medium</title>
            <link>https://medium.com/@hafizur.rahman?source=rss-27ae412408b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:51:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hafizur.rahman/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[Claude MCP Server with Databricks Unity Catalog]]></title>
            <link>https://medium.com/@hafizur.rahman/claude-mcp-server-with-databricks-unity-catalog-e74c3aaa905c?source=rss-27ae412408b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e74c3aaa905c</guid>
            <dc:creator><![CDATA[Hafizur Rahman]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 04:15:35 GMT</pubDate>
            <atom:updated>2025-04-14T04:15:35.369Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I will explore how to connect to <strong>Databricks Unity Catalog</strong> using <strong>Claude Desktop</strong> to perform data analysis. Before diving into that, it’s important to understand the concept of <strong>Model Context Protocol (MCP)</strong>.</p><p>You might be wondering — what exactly is MCP?</p><p>Think of a scenario where you want to learn how a load balancer functions or how many types of AWS certifications exist. In such cases, we typically turn to AI tools like <strong>ChatGPT</strong>, <strong>DeepSeek</strong>, or <strong>Claude Desktop</strong>, asking questions like:</p><p><strong><em>“How many types of AWS certifications are available?”</em></strong></p><p><strong><em>“How does a load balancer work?”</em></strong></p><p>These <strong>LLM-based tools (Large Language Models)</strong> then provide informative responses.</p><p><strong>Now, imagine, </strong>you’ve built a microservices application called <strong>PatientAIAnalytics</strong>, which can only be used by your registered users. This means no one can log in <strong>without</strong> a user ID and password.</p><p>Let’s say your application manages patient data. Now, you want users who access Claude Desktop to be able to ask your application questions in natural language, like:</p><p><strong><em>“How many patients in PatientAIAnalytics have diabetes levels above 10?”</em></strong></p><p>As soon as this question is asked, your Claude Desktop responds with:</p><p><strong>“In your PatientAIAnalytics application, diabetes prevalence above level 10 is higher among patients aged 30 to 40.</strong>”</p><p>Interesting, right?</p><p>This is exactly where the MCP protocol comes into play. The <strong>MCP Protocol</strong> acts as the bridge between <strong>Claude Desktop</strong> and your <strong>application</strong>, enabling seamless communication. In other words, when you ask a question, <strong>Claude Desktop understands it, connects with MCP Server and MCP server connects with your application PatientAIAnalytics, and retrieves the relevant data</strong>.</p><p>Not only that, <strong>Only registered users</strong> of your application are permitted to ask these questions. That means if you have authentication in place, it can also be successfully managed.</p><h3><strong>High level architecture of MCP Protocol</strong></h3><p>Let’s now illustrate the flow of how the MCP protocol operates using a diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7A1qXKOFcuuOvheWec7Kzg.png" /></figure><p>If we observe the above diagram, we will see that on the left side, there are Claude Desktop/Tools/IDE, which are connected to the MCP server. Using arrows, different types of MCP servers are shown on the right side. These servers primarily act as a bridge between MCP hosts (in this case, Claude Desktop) and third-party applications. Here, third-party applications can refer to your own application or any other external application.</p><p>Someone might ask, <strong>“What would happen if MCP didn’t exist? Would AI tools be unable to connect with backend applications?”</strong></p><p>Yes, they <strong>could still connect</strong>, but without <strong>MCP (Model Context Protocol)</strong>, integrating AI tools with backend applications or data sources would be much more <strong>complex</strong>. Each data source would require <strong>a separate integration</strong>. To connect an AI model with a backend application, <strong>custom APIs or database connectors</strong> would need to be developed for each system.</p><p>For example, <strong>Trino</strong>, <strong>Salesforce</strong>, Apache <strong>Ignite</strong>, <strong>PostgreSQL</strong> — each would require different code for integration. And if everyone tried to implement it in their own preferred way, it would be impossible to maintain any standard.</p><p>But <strong>MCP simplifies this process by providing a unified, standardized solution.</strong></p><h3><strong>Step-by-step setup and execution of Claude desktop, MCP server, PatientAIAnalytics</strong></h3><p>Now, we will explore step by step how our custom-built application can work with the MCP protocol to enable access through Claude Desktop. We will perform below tasks:</p><ol><li>Install Claude Desktop on macOS.</li><li>Install OpenAPI MCP server in macOS.</li><li>Install <strong>PatientAIAnalytics project </strong>locally.</li><li>Databricks Registration and tables creation.</li><li>Open <strong>Claude Desktop</strong> on the local computer, connect it with <strong>PatientAIAnalytics</strong>, and perform NLP-based conversations.</li></ol><p><strong>A. Install Claude desktop in MAC environment (or any linux based environment)</strong></p><p>Install Claude Desktop from below URL:</p><p><a href="https://claude.ai/download">https://claude.ai/download</a></p><p><strong>B. Install openAPI MCP server in Local environment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6L_0jBZJOM_576Uu6A5ZNA.png" /></figure><p><strong>C. Clone PatientAIAnalytics from public gitHub</strong></p><ul><li>Clone the project from public github</li></ul><p>git clone <a href="https://github.com/hafiz321/patientaianalytics.git">https://github.com/hafiz321/patientaianalytics.git</a></p><ul><li>Install JAVA</li><li>Run the spring boot application (McpDataBricks.java)</li></ul><p>Note: If you need any further information for running the application read the README.MD file for details.</p><p><strong>D. Databricks Account creation</strong></p><p>Create an account in Databricks, and upload the attached 4 files. These four files will be uploaded for creating tables in databricks. Click on the “Create Table” and for each table upload individual files. This files data will be used for the table records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-br9NY476E0wmi6TyeS4wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_F9modBfF1F3CVESHRYwQ.png" /></figure><p>Update the below configuration file in PatientAIAnalytics spring boot java file <strong>with your databricks credentials</strong>:</p><p>mcp-databricks/src/main/java/com/restapi/mcpdatabricks/config/<strong>DataSourceConfig</strong>.java</p><p>After configuring DataSourceConfig file with your databricks credentials, run the spring boot application <strong>McpDataBricks</strong></p><p><strong>E. Run Claude desktop</strong></p><p>Now the complete environment is ready to run claude desktop. We have run MCP Server (Section 2.3), we have run our PatientAIAnalytics server, now we will open the claude desktop. After opening claude desktop we can ask questions like below:</p><p><strong><em>Can you show me all the records of PatientAIAnalytics?</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4XgwD5UKh_she8ewqt9-jg.png" /></figure><p>After asking the above questions, Claude Desktop will display a popup similar to the diagram above. Once you click <strong>“Allow for this chat,”</strong> it will show all the patients records something like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBftjY3i2HIkwWKzoxSmvQ.png" /></figure><p>The claude desktop has established a connection with the OpenAPI MCP server. This server will then connect to our application (<strong>PatientAIAnalytics</strong>), which will ultimately link to <strong>Databricks Unity Catalog</strong>.</p><p>Bingo !</p><h3>Sample Additional Report from Claude Desktop</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kyo_2ECIB7xEDQNumL9OKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzxZ9RnB4vsBtDyatqEtlg.png" /></figure><h3>Few Important points</h3><ul><li>The <strong>PatientAIAnalytics</strong> system connects to the <strong>Databricks Unity Catalog</strong> via a <strong>JDBC driver</strong>. This means the underlying interaction with Unity Catalog remains abstracted from the <strong>MCP OpenAPI Server</strong>, which is a good thing — we avoid exposing these internal mechanisms to the LLM.</li><li>Another key advantage of this design is enhanced <strong>security and privacy</strong>. We’re not exposing the full database schema or any <strong>PII (Personally Identifiable Information)</strong> to the outside world. Only curated, shareable data is made accessible through the OpenAPI layer.</li><li>In the upcoming version, we plan to implement robust <strong>authentication</strong> and <strong>data governance (DG)</strong> policies. This will ensure that the <strong>LLM (Claude Desktop + MCP OpenAPI Server)</strong> serves data strictly to <strong>authorized users</strong>, adhering to established governance rules.</li></ul><p>One limitation of the MCP Server is that it <strong>cannot be installed or configured on a remote server</strong>. As a result, <strong>each user must install it locally</strong> to use it. Hopefully, the <strong>Anthropic (Claude) team</strong> will address this in a future release.</p><h3>Conclusion</h3><p><strong>We have reached the final stage of our discussion. </strong>Now, I will briefly explain how our application, <strong>PatientAIAnalytics,</strong> works with the <strong>MCP server</strong>.</p><p>When an NLP-based query is made through <strong>Claude Desktop</strong>, in the background, Claude Desktop connects with the <strong>OpenAPI MCP Server</strong>. This <strong>OpenAPI MCP Server</strong> knows how to communicate with <strong>OpenAPI applications</strong>. Therefore, based on the <strong>OpenAPI spec</strong> published by <strong>PatientAIAnalytics</strong>, the OpenAPI MCP interacts with our <strong>PatientAIAnalytics</strong> application to access data.</p><p>This process is illustrated in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vt9QaQTXQ8jSAoa-WNnTgQ.png" /></figure><h4>Reference</h4><ol><li>PatientAIAnalytics gitHub Link <a href="https://github.com/hafiz321/patientaianalytics">https://github.com/hafiz321/patientaianalytics</a></li><li>OpenAPI MCP Server link: <a href="https://github.com/janwilmake/openapi-mcp-server">https://github.com/janwilmake/openapi-mcp-server</a></li><li><a href="https://modelcontextprotocol.io/introduction">https://modelcontextprotocol.io/introduction</a></li><li><a href="https://www.anthropic.com/news/model-context-protocol">https://www.anthropic.com/news/model-context-protocol</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e74c3aaa905c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>