# msft-innovation-hub-india/mcp-az-storage-svc-sample architecture

> Architecture diagram of the GitHub repository msft-innovation-hub-india/mcp-az-storage-svc-sample, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/msft-innovation-hub-india/mcp-az-storage-svc-sample
- Repository: https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample

## Overview

##### Project Type and Purpose
- This is a full-stack sample application demonstrating the Model Context Protocol (MCP) over Azure Blob Storage.
- It consists of two major deliverables:
a. An MCP Server (“mcp-server-az-storage-svc”) that exposes Azure Blob Storage operations as asynchronous Python APIs.
b. An MCP Client AI Assistant (“mcp-client-ai-assistant”) that provides an AI-powered chat interface (using Azure OpenAI GPT-4o) to discover and invoke the server’s storage tools via MCP.

##### File-Structure Analysis
- Top-level folders:
- mcp-server-az-storage-svc/
– Contains a Dockerfile, .dockerignore, .gitignore, plus the Python package “mcp-server” with server.py, az_storage_svcs.py, requirements.txt, and an .env_example.
- mcp-client-ai-assistant/
– Holds client.py, requirements.txt, .env_example, .gitignore and its own README.
- Patterns & configuration:
- Server packaged as a microservice (Dockerized, entry in server.py).
- Client is a standalone script/app using MCP client libraries and Azure OpenAI SDK.
- Common use of .env files for configuration, requirements.txt for dependencies.

##### Key Architectural Insights from READMEs
- Server:
- Implements MCP server interfaces over HTTP or WebSocket (asynchronous).
- Authenticates to Azure Blob Storage via Managed Identity or Azure CLI.
- Core module: az_storage_svcs.py (wraps list/create/delete, upload/download).
- Client:
- Discovers server-endpoints/tools at startup.
- Uses OpenAI GPT-4o to translate natural language into MCP calls.
- client.py orchestrates chat loop, calls server, formats responses.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Client Tier"
        direction TB
        subgraph "User Interface"
            direction TB
            ChatUI["Chat UI / CLI"]:::client
        end
        subgraph "AI Processing"
            direction TB
            MCPClientLib["MCP Client Library"]:::client
            OpenAI["Azure OpenAI Service (GPT-4o)"]:::azure
            ClientEnv["Client .env_example"]:::client
        end
    end

    %% Server Tier inside Docker
    subgraph "Server Tier (Docker Container)" 
        direction TB
        subgraph "MCP API Layer"
            direction TB
            MCPServerAPI["MCP Server API"]:::server
            ServerEnv["Server .env_example"]:::server
            ServerDeps["Server requirements.txt"]:::server
            AuthModule["Authentication Module"]:::server
        end
        subgraph "Storage Service Layer"
            direction TB
            StorageWrapper["Azure Blob Storage Service Wrapper"]:::server
        end
    end

    %% External Services
    AzureBlob["Azure Blob Storage"]:::azure
    GitIgnoreClient[".gitignore"]:::client
    GitIgnoreServer[".gitignore"]:::server
    DockerIgnore[".dockerignore"]:::server
    Dockerfile["Dockerfile"]:::server

    %% Data Flows
    ChatUI -->|"natural language"| MCPClientLib
    MCPClientLib -->|"HTTP/JSON"| MCPServerAPI
    MCPServerAPI -->|"calls SDK"| StorageWrapper
    StorageWrapper -->|"REST API"| AzureBlob
    AzureBlob -->|"response"| MCPServerAPI
    MCPServerAPI -->|"HTTP/JSON"| MCPClientLib
    MCPClientLib -->|"SDK call"| OpenAI
    OpenAI -->|"MCP commands"| MCPClientLib
    MCPClientLib -->|"formatted response"| ChatUI

    %% Click Events
    click ChatUI "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-client-ai-assistant/client.py"
    click MCPClientLib "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-client-ai-assistant/requirements.txt"
    click ClientEnv "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-client-ai-assistant/.env_example"
    click MCPServerAPI "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/mcp-server/server.py"
    click StorageWrapper "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/mcp-server/az_storage_svcs.py"
    click ServerDeps "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/mcp-server/requirements.txt"
    click ServerEnv "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/mcp-server/.env_example"
    click Dockerfile "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/tree/main/mcp-server-az-storage-svc/Dockerfile"
    click DockerIgnore "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/.dockerignore"
    click GitIgnoreClient "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-client-ai-assistant/.gitignore"
    click GitIgnoreServer "https://github.com/msft-innovation-hub-india/mcp-az-storage-svc-sample/blob/main/mcp-server-az-storage-svc/.gitignore"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef server fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef azure fill:#90EE90,stroke:#000,stroke-width:1px
```
