Getting Started with Remote MCP Servers using Azure Functions (Java)

by Azure-Samples

172 downloads
Not rated
GitHub

About

This is a quickstart template to easily build and deploy a custom remote MCP server to the cloud using Azure Functions with Java.

Details

Author
Azure-Samples
Downloads
172
Categories
Cloud Service

- MCP server running on Azure Functions (Java)
- Tools: HelloWorld, SaveSnippets, GetSnippets
- Server-Sent Events (SSE) transport
- Secure with system keys + HTTPS
- Optional OAuth via EasyAuth or API Management
- Optional VNet isolation
- Deploy locally or to Azure with azd up

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 Getting Started with Remote MCP Servers using Azure Functions (Java)
    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

Install prerequisites (JDK 17+, Azure Functions Core Tools, Azure Developer CLI, Docker for Azurite). Run mvn clean package then mvn azure-functions:run to start the local SSE endpoint at http://127.0.0.1:7071/runtime/webhooks/mcp/sse. Deploy to Azure with azd up. Connect clients by setting the SSE URL with the system key mcp_extension as a header (x-functions-key).

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "getting started with remote mcp servers using azure functions (java)": {
            "remote-mcp-functions-java": {
                "command": "docker",
                "args": [
                    "run",
                    "-p",
                    "10000:10000",
                    "-p",
                    "10001:10001",
                    "-p",
                    "10002:10002",
                    "\\"
                ]
            }
        }
    }
}

McpServers

{
    "remote-mcp-functions-java": {
        "command": "docker",
        "args": [
            "run",
            "-p",
            "10000:10000",
            "-p",
            "10001:10001",
            "-p",
            "10002:10002",
            "\\"
        ]
    }
}

Getting Started with Remote MCP Servers using Azure Functions (Java)

This quick-start shows how to build and deploy a remote MCP server with Azure Functions (Java).
You can run it locally for debugging, then ship it to the cloud with azd up in minutes.
The server is secured by design (system keys + HTTPS), supports OAuth via EasyAuth or API Management, and can be isolated inside a VNet.

Watch the overview video.
---

Prerequisites

| Purpose | Tool | Notes |
|---------|------|-------|
| Java build + run | JDK 17 (or newer) | Java 8 runtime still works but JDK 17 is recommended. |
| Local Functions runtime | Azure Functions Core Tools v44.0.7030 | Used by func start / mvn azure-functions:run. |
| Provision & deploy | Azure Developer CLI (azd) | Simplifies end-to-end deployment. |
| IDE (optional) | Visual Studio Code + Azure Functions extension | One-click debug & log streaming. |
| Blob Storage emulator | Docker to run Azurite | Needed only when running locally with UseDevelopmentStorage=true. |

---

Prepare your local environment

> Why Azurite?
> The SaveSnippet / GetSnippet tools persist snippets in Azure Blob Storage.
> Azurite emulates that storage account on your dev machine.

docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
       mcr.microsoft.com/azure-storage/azurite

If you prefer the Azurite VS Code extension, run “Azurite: Start” from the command palette instead.

---

Run the MCP server locally

``bash

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.