Azure Cosmos DB MCP CLient & Server

by patrice-truong

1 stars
348 downloads
Not rated
GitHub

About

This project demonstrates how to build an MCP Server and client connected to Azure Cosmos DB for NoSQL. It includes a NextJS 15 frontend that displays a product catalog and provides an AI Assistant for searching products and retrieving past orders, alongside a Node.js MCP Server…

Details

Author
patrice-truong
GitHub stars
1
Downloads
348
Categories
Database

- MCP Server connected to Azure Cosmos DB NoSQL
- NextJS 15 frontend with product catalog display
- AI Assistant for product search and order lookup
- Vector search enabled on Cosmos DB for semantic queries
- Integration with Azure Blob Storage for product images
- Uses Azure OpenAI for embedding generation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Azure Cosmos DB MCP CLient & Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, configure environment variables (Azure Cosmos DB endpoint, database, containers, Azure Storage, Azure OpenAI credentials), then start the MCP server with npx ts-node src/server.ts from the mcp-server folder. Run the frontend with npm start from the nextjs folder. Optionally, populate the product catalog using the provided .NET tool in the populate folder.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "azure cosmos db mcp client & server": {
            "cosmosdb-mcp": {
                "command": "npx",
                "args": [
                    "ts-node",
                    "src/server.ts"
                ]
            }
        }
    }
}

McpServers

{
    "cosmosdb-mcp": {
        "command": "npx",
        "args": [
            "ts-node",
            "src/server.ts"
        ]
    }
}

Azure Cosmos DB MCP CLient & Server

This repository contains a project that shows how to create an MCP Server and client for Azure Cosmos DB. The project is divided into 2 parts:

- Frontend application: NextJS 15 application that displays a products catalog and features an AI Assistant that helps users to find products in the catalog and get past orders
- an MCP Server component, connected to the Azure Cosmos DB NoSQL database and responsible for reading products and orders from the database.

Demo

Azure Architecture

- an Azure Cosmos DB NoSQL database that stores the product catalog
- a node.js server that serves as the MCP Server component

References

- Create an Azure Cosmos DB for NoSQL account
- Create an Azure Storage account
- Create a Windows virtual machine
- Windows execution policies

Step-by-step walkthrough

Installation

Azure Cosmos DB

In the Azure portal, create an Azure Cosmos DB for NoSQL account.

- Give a unique name for your Azure Cosmos DB account. We will be using cosmos-eastus2-nosql-2 in the rest of this walkthrough.

Cosmos DB - Basics

- Click on "Next: Global distribution"

Cosmos DB - Global distribution

- Accept the default values and click on "Next: Networking"

Cosmos DB - Networking

- Accept the default values and click on "Next: Backup Policy"
- Select "Periodic" backup policy
- Select "Locally-redundant backup storage"

Cosmos DB - Backup Policy

- Click on "Next: Encryption"

Cosmos DB - Encryption

- Click on "Review and Create" to start validation

Cosmos DB - Validation

- Click on "Create" to start the creation of the Azure Cosmos DB for NoSQL account

For this project, you will need to enable vector support on the Azure Cosmos DB account.
- In the settings section, select Features, then "Vector Search for NoSQL API"

- In the panel that opens, click on the Enable button

Cosmos DB - Validation

- Create the Azure Cosmos DB eShop database and the Products container

- Click on "..." next to eShop to display the contextual menu and select "New container" to create the "carts" container in the eShop database.

Make sure that the partition key is _"/id"_ (the partition key is case-sensitive)

Expand "Container Vector Policy" and click on the "Add vector embedding" button

Cosmos DB - Create database

- Create the carts container

Cosmos DB - Create database

Storage account

1. Create a storage account to store the product images

For more details, refer to the documentation: https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal

Storage - Basics

Storage - Advanced

Storage - Networking

Storage - Data protection

Storage - Encryption

Storage - Validation

Install software pre-requisites

1. Create a virtual machine in Azure or use your local computer
2. Install node.js v22.13.1 (LTS) from https://nodejs.org/en/download
3. Install Visual Studio Code x64 1.97.0 from https://code.visualstudio.com/download
4. Install Git 2.47.12 x64 from https://git-scm.com/downloads
5. Install .NET SDK x64 v9.0.102 from https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.102-windows-x64-installer
6. Open a terminal window and add nuget source with

dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org

7. If necessary, change PowerShell execution policies for Windows computers. Open a Powershell window in administrator mode and run this command

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

8. If necessary, install nuget, powershell, az cli and az modules

```sh

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.