00 - Introduction to MCP Database Integration

Module
PostgreSQL
Progress
7%

Introduction to MCP Database Integration

🎯 What This Lab Covers

This introduction lab provides a comprehensive overview of building Model Context Protocol (MCP) servers with database integration.

You'll understand the business case, technical architecture, and real-world applications through the Zava Retail analytics use case at https://github.com/microsoft/MCP-Server-and-PostgreSQL-Sample-Retail.

Overview

Model Context Protocol (MCP) enables AI assistants to securely access and interact with external data sources in real-time. When combined with database integration, MCP unlocks powerful capabilities for data-driven AI applications.

This learning path teaches you to build production-ready MCP servers that connect AI assistants to retail sales data through PostgreSQL, implementing enterprise patterns like Row Level Security, semantic search, and multi-tenant data access.

Learning Objectives

By the end of this lab, you will be able to:

  • Define Model Context Protocol and its core benefits for database integration
  • Identify key components of an MCP server architecture with databases
  • Understand the Zava Retail use case and its business requirements
  • Recognize enterprise patterns for secure, scalable database access
  • List the tools and technologies used throughout this learning path
  • 🧭 The Challenge: AI Meets Real-World Data

    Traditional AI Limitations

    Modern AI assistants are incredibly powerful but face significant limitations when working with real-world business data:

    | Challenge | Description | Business Impact |

    |---------------|-----------------|-------------------|

    | Static Knowledge | AI models trained on fixed datasets can't access current business data | Outdated insights, missed opportunities |

    | Data Silos | Information locked in databases, APIs, and systems AI can't reach | Incomplete analysis, fragmented workflows |

    | Security Constraints | Direct database access raises security and compliance concerns | Limited deployment, manual data preparation |

    | Complex Queries | Business users need technical knowledge to extract data insights | Reduced adoption, inefficient processes |

    The MCP Solution

    Model Context Protocol addresses these challenges by providing:

  • Real-time Data Access: AI assistants query live databases and APIs
  • Secure Integration: Controlled access with authentication and permissions
  • Natural Language Interface: Business users ask questions in plain English
  • Standardized Protocol: Works across different AI platforms and tools
  • 🏪 Meet Zava Retail: Our Learning Case Study https://github.com/microsoft/MCP-Server-and-PostgreSQL-Sample-Retail

    Throughout this learning path, we'll build an MCP server for Zava Retail, a fictional DIY retail chain with multiple store locations. This realistic scenario demonstrates enterprise-grade MCP implementation.

    Business Context

    Zava Retail operates:

  • 8 physical stores across Washington state (Seattle, Bellevue, Tacoma, Spokane, Everett, Redmond, Kirkland)
  • 1 online store for e-commerce sales
  • Diverse product catalog including tools, hardware, garden supplies, and building materials
  • Multi-level management with store managers, regional managers, and executives
  • Business Requirements

    Store managers and executives need AI-powered analytics to:

    1. Analyze sales performance across stores and time periods

    2. Track inventory levels and identify restocking needs

    3. Understand customer behavior and purchasing patterns

    4. Discover product insights through semantic search

    5. Generate reports with natural language queries

    6. Maintain data security with role-based access control

    Technical Requirements

    The MCP server must provide:

  • Multi-tenant data access where store managers see only their store's data
  • Flexible querying supporting complex SQL operations
  • Semantic search for product discovery and recommendations
  • Real-time data reflecting current business state
  • Secure authentication with row-level security
  • Scalable architecture supporting multiple concurrent users
  • 🏗️ MCP Server Architecture Overview

    Our MCP server implements a layered architecture optimized for database integration:

    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                    VS Code AI Client                       │
    
    │                  (Natural Language Queries)                │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ HTTP/SSE
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                     MCP Server                             │
    
    │  ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
    
    │  │   Tool Layer    │ │  Security Layer │ │  Config Layer │ │
    
    │  │                 │ │                 │ │               │ │
    
    │  │ • Query Tools   │ │ • RLS Context   │ │ • Environment │ │
    
    │  │ • Schema Tools  │ │ • User Identity │ │ • Connections │ │
    
    │  │ • Search Tools  │ │ • Access Control│ │ • Validation  │ │
    
    │  └─────────────────┘ └─────────────────┘ └───────────────┘ │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ asyncpg
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                PostgreSQL Database                         │
    
    │  ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
    
    │  │  Retail Schema  │ │   RLS Policies  │ │   pgvector    │ │
    
    │  │                 │ │                 │ │               │ │
    
    │  │ • Stores        │ │ • Store-based   │ │ • Embeddings  │ │
    
    │  │ • Customers     │ │   Isolation     │ │ • Similarity  │ │
    
    │  │ • Products      │ │ • Role Control  │ │   Search      │ │
    
    │  │ • Orders        │ │ • Audit Logs    │ │               │ │
    
    │  └─────────────────┘ └─────────────────┘ └───────────────┘ │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ REST API
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                  Azure OpenAI                              │
    
    │               (Text Embeddings)                            │
    
    └─────────────────────────────────────────────────────────────┘
    
    

    Key Components

    1. MCP Server Layer
  • FastMCP Framework: Modern Python MCP server implementation
  • Tool Registration: Declarative tool definitions with type safety
  • Request Context: User identity and session management
  • Error Handling: Robust error management and logging
  • 2. Database Integration Layer
  • Connection Pooling: Efficient asyncpg connection management
  • Schema Provider: Dynamic table schema discovery
  • Query Executor: Secure SQL execution with RLS context
  • Transaction Management: ACID compliance and rollback handling
  • 3. Security Layer
  • Row Level Security: PostgreSQL RLS for multi-tenant data isolation
  • User Identity: Store manager authentication and authorization
  • Access Control: Fine-grained permissions and audit trails
  • Input Validation: SQL injection prevention and query validation
  • 4. AI Enhancement Layer
  • Semantic Search: Vector embeddings for product discovery
  • Azure OpenAI Integration: Text embedding generation
  • Similarity Algorithms: pgvector cosine similarity search
  • Search Optimization: Indexing and performance tuning
  • 🔧 Technology Stack

    Core Technologies

    | Component | Technology | Purpose |

    |---------------|----------------|-------------|

    | MCP Framework | FastMCP (Python) | Modern MCP server implementation |

    | Database | PostgreSQL 17 + pgvector | Relational data with vector search |

    | AI Services | Azure OpenAI | Text embeddings and language models |

    | Containerization | Docker + Docker Compose | Development environment |

    | Cloud Platform | Microsoft Azure | Production deployment |

    | IDE Integration | VS Code | AI Chat and development workflow |

    Development Tools

    | Tool | Purpose |

    |----------|-------------|

    | asyncpg | High-performance PostgreSQL driver |

    | Pydantic | Data validation and serialization |

    | Azure SDK | Cloud service integration |

    | pytest | Testing framework |

    | Docker | Containerization and deployment |

    Production Stack

    | Service | Azure Resource | Purpose |

    |-------------|-------------------|-------------|

    | Database | Azure Database for PostgreSQL | Managed database service |

    | Container | Azure Container Apps | Serverless container hosting |

    | AI Services | Azure AI Foundry | OpenAI models and endpoints |

    | Monitoring | Application Insights | Observability and diagnostics |

    | Security | Azure Key Vault | Secrets and configuration management |

    🎬 Real-World Usage Scenarios

    Let's explore how different users interact with our MCP server:

    Scenario 1: Store Manager Performance Review

    User: Sarah, Seattle Store Manager

    Goal: Analyze last quarter's sales performance

    Natural Language Query:

    > "Show me the top 10 products by revenue for my store in Q4 2024"

    What Happens:

    1. VS Code AI Chat sends query to MCP server

    2. MCP server identifies Sarah's store context (Seattle)

    3. RLS policies filter data to Seattle store only

    4. SQL query generated and executed

    5. Results formatted and returned to AI Chat

    6. AI provides analysis and insights

    Scenario 2: Product Discovery with Semantic Search

    User: Mike, Inventory Manager

    Goal: Find products similar to a customer request

    Natural Language Query:

    > "What products do we sell that are similar to 'waterproof electrical connectors for outdoor use'?"

    What Happens:

    1. Query processed by semantic search tool

    2. Azure OpenAI generates embedding vector

    3. pgvector performs similarity search

    4. Related products ranked by relevance

    5. Results include product details and availability

    6. AI suggests alternatives and bundling opportunities

    Scenario 3: Cross-Store Analytics

    User: Jennifer, Regional Manager

    Goal: Compare performance across all stores

    Natural Language Query:

    > "Compare sales by category for all stores in the last 6 months"

    What Happens:

    1. RLS context set for regional manager access

    2. Complex multi-store query generated

    3. Data aggregated across store locations

    4. Results include trends and comparisons

    5. AI identifies insights and recommendations

    🔒 Security and Multi-Tenancy Deep Dive

    Our implementation prioritizes enterprise-grade security:

    Row Level Security (RLS)

    PostgreSQL RLS ensures data isolation:

    
    -- Store managers see only their store's data
    
    CREATE POLICY store_manager_policy ON retail.orders
    
      FOR ALL TO store_managers
    
      USING (store_id = get_current_user_store());
    
    
    
    -- Regional managers see multiple stores
    
    CREATE POLICY regional_manager_policy ON retail.orders
    
      FOR ALL TO regional_managers
    
      USING (store_id = ANY(get_user_store_list()));
    
    

    User Identity Management

    Each MCP connection includes:

  • Store Manager ID: Unique identifier for RLS context
  • Role Assignment: Permissions and access levels
  • Session Management: Secure authentication tokens
  • Audit Logging: Complete access history
  • Data Protection

    Multiple layers of security:

  • Connection Encryption: TLS for all database connections
  • SQL Injection Prevention: Parameterized queries only
  • Input Validation: Comprehensive request validation
  • Error Handling: No sensitive data in error messages
  • 🎯 Key Takeaways

    After completing this introduction, you should understand:

    MCP Value Proposition: How MCP bridges AI assistants and real-world data

    Business Context: Zava Retail's requirements and challenges

    Architecture Overview: Key components and their interactions

    Technology Stack: Tools and frameworks used throughout

    Security Model: Multi-tenant data access and protection

    Usage Patterns: Real-world query scenarios and workflows

    🚀 What's Next

    Ready to dive deeper? Continue with:

    Lab 01: Core Architecture Concepts

    Learn about MCP server architecture patterns, database design principles, and the detailed technical implementation that powers our retail analytics solution.

    📚 Additional Resources

    MCP Documentation

  • MCP Specification - Official protocol documentation
  • MCP for Beginners - Comprehensive MCP learning guide
  • FastMCP Documentation - Python SDK documentation
  • Database Integration

  • PostgreSQL Documentation - Complete PostgreSQL reference
  • pgvector Guide - Vector extension documentation
  • Row Level Security - PostgreSQL RLS guide
  • Azure Services

  • Azure OpenAI Documentation - AI service integration
  • Azure Database for PostgreSQL - Managed database service
  • Azure Container Apps - Serverless containers
  • ---

    Disclaimer: This is a learning exercise using fictional retail data. Always follow your organization's data governance and security policies when implementing similar solutions in production environments.

    MCP 데이터베이스 통합 소개

    🎯 이 실습에서 다루는 내용

    이 입문 실습은 데이터베이스 통합을 통해 Model Context Protocol (MCP) 서버를 구축하는 방법에 대한 포괄적인 개요를 제공합니다. https://github.com/microsoft/MCP-Server-and-PostgreSQL-Sample-Retail의 Zava Retail 분석 사례를 통해 비즈니스 사례, 기술 아키텍처, 실제 응용 사례를 이해할 수 있습니다.

    개요

    Model Context Protocol (MCP)은 AI 어시스턴트가 외부 데이터 소스에 실시간으로 안전하게 액세스하고 상호작용할 수 있도록 합니다. 데이터베이스 통합과 결합하면 MCP는 데이터 기반 AI 애플리케이션을 위한 강력한 기능을 제공합니다.

    이 학습 경로는 PostgreSQL을 통해 AI 어시스턴트를 소매 판매 데이터에 연결하고, Row Level Security, 의미 검색, 멀티 테넌트 데이터 액세스와 같은 엔터프라이즈 패턴을 구현하는 프로덕션 준비 MCP 서버를 구축하는 방법을 가르칩니다.

    학습 목표

    이 실습을 완료하면 다음을 수행할 수 있습니다:

  • 정의: Model Context Protocol과 데이터베이스 통합의 핵심 이점
  • 식별: 데이터베이스를 포함한 MCP 서버 아키텍처의 주요 구성 요소
  • 이해: Zava Retail 사례와 비즈니스 요구 사항
  • 인식: 안전하고 확장 가능한 데이터베이스 액세스를 위한 엔터프라이즈 패턴
  • 목록 작성: 이 학습 경로에서 사용된 도구와 기술
  • 🧭 도전 과제: AI와 실제 데이터의 만남

    기존 AI의 한계

    현대의 AI 어시스턴트는 매우 강력하지만 실제 비즈니스 데이터와 작업할 때 중요한 한계를 가지고 있습니다:

    | 도전 과제 | 설명 | 비즈니스 영향 |

    |---------------|-----------------|-------------------|

    | 정적 지식 | 고정된 데이터셋으로 훈련된 AI 모델은 현재 비즈니스 데이터를 액세스할 수 없음 | 오래된 통찰력, 기회 상실 |

    | 데이터 사일로 | 데이터베이스, API, 시스템에 잠긴 정보로 인해 AI가 접근 불가 | 불완전한 분석, 단편화된 워크플로 |

    | 보안 제약 | 직접적인 데이터베이스 액세스는 보안 및 규정 준수 문제를 야기 | 제한된 배포, 수동 데이터 준비 |

    | 복잡한 쿼리 | 비즈니스 사용자가 데이터 통찰력을 추출하려면 기술적 지식이 필요 | 낮은 채택률, 비효율적인 프로세스 |

    MCP 솔루션

    Model Context Protocol은 다음을 통해 이러한 문제를 해결합니다:

  • 실시간 데이터 액세스: AI 어시스턴트가 라이브 데이터베이스와 API를 쿼리
  • 안전한 통합: 인증 및 권한을 통한 제어된 액세스
  • 자연어 인터페이스: 비즈니스 사용자가 평범한 영어로 질문
  • 표준화된 프로토콜: 다양한 AI 플랫폼 및 도구에서 작동
  • 🏪 Zava Retail 소개: 학습 사례 연구 https://github.com/microsoft/MCP-Server-and-PostgreSQL-Sample-Retail

    이 학습 경로에서는 Zava Retail이라는 가상의 DIY 소매 체인을 위한 MCP 서버를 구축합니다. 이 현실적인 시나리오는 엔터프라이즈급 MCP 구현을 보여줍니다.

    비즈니스 배경

    Zava Retail은 다음을 운영합니다:

  • 워싱턴 주 전역에 걸친 8개의 오프라인 매장 (시애틀, 벨뷰, 타코마, 스포캔, 에버렛, 레드먼드, 커클랜드)
  • 1개의 온라인 매장을 통한 전자상거래 판매
  • 도구, 하드웨어, 정원 용품, 건축 자재를 포함한 다양한 제품 카탈로그
  • 매장 관리자, 지역 관리자, 임원을 포함한 다단계 관리
  • 비즈니스 요구 사항

    매장 관리자와 임원은 AI 기반 분석을 통해 다음을 수행해야 합니다:

    1. 매장 및 기간별 판매 성과 분석

    2. 재고 수준 추적 및 재입고 필요성 식별

    3. 고객 행동 및 구매 패턴 이해

    4. 의미 검색을 통한 제품 통찰력 발견

    5. 자연어 쿼리를 사용한 보고서 생성

    6. 역할 기반 액세스 제어를 통한 데이터 보안 유지

    기술 요구 사항

    MCP 서버는 다음을 제공해야 합니다:

  • 멀티 테넌트 데이터 액세스: 매장 관리자가 자신의 매장 데이터만 볼 수 있도록
  • 유연한 쿼리: 복잡한 SQL 작업 지원
  • 의미 검색: 제품 검색 및 추천
  • 실시간 데이터: 현재 비즈니스 상태 반영
  • 안전한 인증: Row Level Security 포함
  • 확장 가능한 아키텍처: 여러 동시 사용자를 지원
  • 🏗️ MCP 서버 아키텍처 개요

    우리의 MCP 서버는 데이터베이스 통합에 최적화된 계층형 아키텍처를 구현합니다:

    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                    VS Code AI Client                       │
    
    │                  (Natural Language Queries)                │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ HTTP/SSE
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                     MCP Server                             │
    
    │  ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
    
    │  │   Tool Layer    │ │  Security Layer │ │  Config Layer │ │
    
    │  │                 │ │                 │ │               │ │
    
    │  │ • Query Tools   │ │ • RLS Context   │ │ • Environment │ │
    
    │  │ • Schema Tools  │ │ • User Identity │ │ • Connections │ │
    
    │  │ • Search Tools  │ │ • Access Control│ │ • Validation  │ │
    
    │  └─────────────────┘ └─────────────────┘ └───────────────┘ │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ asyncpg
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                PostgreSQL Database                         │
    
    │  ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
    
    │  │  Retail Schema  │ │   RLS Policies  │ │   pgvector    │ │
    
    │  │                 │ │                 │ │               │ │
    
    │  │ • Stores        │ │ • Store-based   │ │ • Embeddings  │ │
    
    │  │ • Customers     │ │   Isolation     │ │ • Similarity  │ │
    
    │  │ • Products      │ │ • Role Control  │ │   Search      │ │
    
    │  │ • Orders        │ │ • Audit Logs    │ │               │ │
    
    │  └─────────────────┘ └─────────────────┘ └───────────────┘ │
    
    └─────────────────────┬───────────────────────────────────────┘
    
                          │ REST API
    
                          ▼
    
    ┌─────────────────────────────────────────────────────────────┐
    
    │                  Azure OpenAI                              │
    
    │               (Text Embeddings)                            │
    
    └─────────────────────────────────────────────────────────────┘
    
    

    주요 구성 요소

    1. MCP 서버 계층
  • FastMCP Framework: 현대적인 Python MCP 서버 구현
  • 도구 등록: 타입 안전성을 갖춘 선언적 도구 정의
  • 요청 컨텍스트: 사용자 신원 및 세션 관리
  • 오류 처리: 강력한 오류 관리 및 로깅
  • 2. 데이터베이스 통합 계층
  • 연결 풀링: 효율적인 asyncpg 연결 관리
  • 스키마 제공자: 동적 테이블 스키마 검색
  • 쿼리 실행기: RLS 컨텍스트를 사용한 안전한 SQL 실행
  • 트랜잭션 관리: ACID 준수 및 롤백 처리
  • 3. 보안 계층
  • Row Level Security: 멀티 테넌트 데이터 격리를 위한 PostgreSQL RLS
  • 사용자 신원: 매장 관리자 인증 및 권한 부여
  • 액세스 제어: 세분화된 권한 및 감사 기록
  • 입력 검증: SQL 인젝션 방지 및 쿼리 검증
  • 4. AI 강화 계층
  • 의미 검색: 제품 검색을 위한 벡터 임베딩
  • Azure OpenAI 통합: 텍스트 임베딩 생성
  • 유사성 알고리즘: pgvector 코사인 유사성 검색
  • 검색 최적화: 인덱싱 및 성능 튜닝
  • 🔧 기술 스택

    핵심 기술

    | 구성 요소 | 기술 | 목적 |

    |---------------|----------------|-------------|

    | MCP Framework | FastMCP (Python) | 현대적인 MCP 서버 구현 |

    | 데이터베이스 | PostgreSQL 17 + pgvector | 관계형 데이터와 벡터 검색 |

    | AI 서비스 | Azure OpenAI | 텍스트 임베딩 및 언어 모델 |

    | 컨테이너화 | Docker + Docker Compose | 개발 환경 |

    | 클라우드 플랫폼 | Microsoft Azure | 프로덕션 배포 |

    | IDE 통합 | VS Code | AI 채팅 및 개발 워크플로 |

    개발 도구

    | 도구 | 목적 |

    |----------|-------------|

    | asyncpg | 고성능 PostgreSQL 드라이버 |

    | Pydantic | 데이터 검증 및 직렬화 |

    | Azure SDK | 클라우드 서비스 통합 |

    | pytest | 테스트 프레임워크 |

    | Docker | 컨테이너화 및 배포 |

    프로덕션 스택

    | 서비스 | Azure 리소스 | 목적 |

    |-------------|-------------------|-------------|

    | 데이터베이스 | Azure Database for PostgreSQL | 관리형 데이터베이스 서비스 |

    | 컨테이너 | Azure Container Apps | 서버리스 컨테이너 호스팅 |

    | AI 서비스 | Azure AI Foundry | OpenAI 모델 및 엔드포인트 |

    | 모니터링 | Application Insights | 관찰 가능성 및 진단 |

    | 보안 | Azure Key Vault | 비밀 및 구성 관리 |

    🎬 실제 사용 시나리오

    다양한 사용자가 MCP 서버와 상호작용하는 방법을 살펴보겠습니다:

    시나리오 1: 매장 관리자 성과 검토

    사용자: Sarah, 시애틀 매장 관리자

    목표: 지난 분기의 판매 성과 분석

    자연어 쿼리:

    > "2024년 4분기 동안 내 매장에서 매출 기준 상위 10개 제품을 보여줘"

    진행 과정:

    1. VS Code AI 채팅이 쿼리를 MCP 서버로 전송

    2. MCP 서버가 Sarah의 매장 컨텍스트(시애틀)를 식별

    3. RLS 정책이 데이터를 시애틀 매장으로 필터링

    4. SQL 쿼리가 생성되고 실행됨

    5. 결과가 포맷되어 AI 채팅으로 반환

    6. AI가 분석 및 통찰력을 제공

    시나리오 2: 의미 검색을 통한 제품 발견

    사용자: Mike, 재고 관리자

    목표: 고객 요청과 유사한 제품 찾기

    자연어 쿼리:

    > "야외용 방수 전기 커넥터와 유사한 제품을 우리가 판매하나요?"

    진행 과정:

    1. 쿼리가 의미 검색 도구에 의해 처리됨

    2. Azure OpenAI가 임베딩 벡터를 생성

    3. pgvector가 유사성 검색 수행

    4. 관련 제품이 관련성 순으로 정렬됨

    5. 결과에 제품 세부 정보와 가용성이 포함됨

    6. AI가 대안 및 번들링 기회를 제안

    시나리오 3: 매장 간 분석

    사용자: Jennifer, 지역 관리자

    목표: 모든 매장의 카테고리별 판매 비교

    자연어 쿼리:

    > "지난 6개월 동안 모든 매장의 카테고리별 판매를 비교해줘"

    진행 과정:

    1. RLS 컨텍스트가 지역 관리자 액세스로 설정됨

    2. 복잡한 다중 매장 쿼리가 생성됨

    3. 데이터가 매장 위치별로 집계됨

    4. 결과에 트렌드와 비교가 포함됨

    5. AI가 통찰력과 추천을 식별

    🔒 보안 및 멀티 테넌시 심층 분석

    우리의 구현은 엔터프라이즈급 보안을 우선시합니다:

    Row Level Security (RLS)

    PostgreSQL RLS는 데이터 격리를 보장합니다:

    
    -- Store managers see only their store's data
    
    CREATE POLICY store_manager_policy ON retail.orders
    
      FOR ALL TO store_managers
    
      USING (store_id = get_current_user_store());
    
    
    
    -- Regional managers see multiple stores
    
    CREATE POLICY regional_manager_policy ON retail.orders
    
      FOR ALL TO regional_managers
    
      USING (store_id = ANY(get_user_store_list()));
    
    

    사용자 신원 관리

    각 MCP 연결에는 다음이 포함됩니다:

  • 매장 관리자 ID: RLS 컨텍스트를 위한 고유 식별자
  • 역할 할당: 권한 및 액세스 수준
  • 세션 관리: 안전한 인증 토큰
  • 감사 로깅: 완전한 액세스 기록
  • 데이터 보호

    다중 보안 계층:

  • 연결 암호화: 모든 데이터베이스 연결에 TLS 사용
  • SQL 인젝션 방지: 매개변수화된 쿼리만 허용
  • 입력 검증: 포괄적인 요청 검증
  • 오류 처리: 오류 메시지에 민감한 데이터 포함 금지
  • 🎯 주요 요점

    이 소개를 완료한 후 다음을 이해해야 합니다:

    MCP 가치 제안: MCP가 AI 어시스턴트와 실제 데이터를 연결하는 방법

    비즈니스 배경: Zava Retail의 요구 사항과 과제

    아키텍처 개요: 주요 구성 요소와 상호작용

    기술 스택: 사용된 도구와 프레임워크

    보안 모델: 멀티 테넌트 데이터 액세스 및 보호

    사용 패턴: 실제 쿼리 시나리오와 워크플로

    🚀 다음 단계

    더 깊이 탐구할 준비가 되셨나요? 다음을 진행하세요:

    Lab 01: 핵심 아키텍처 개념

    MCP 서버 아키텍처 패턴, 데이터베이스 설계 원칙, 소매 분석 솔루션을 지원하는 상세 기술 구현에 대해 알아보세요.

    📚 추가 자료

    MCP 문서

  • MCP 사양 - 공식 프로토콜 문서
  • MCP 초보자용 - 포괄적인 MCP 학습 가이드
  • FastMCP 문서 - Python SDK 문서
  • 데이터베이스 통합

  • PostgreSQL 문서 - PostgreSQL 참조 자료
  • pgvector 가이드 - 벡터 확장 문서
  • Row Level Security - PostgreSQL RLS 가이드
  • Azure 서비스

  • Azure OpenAI 문서 - AI 서비스 통합
  • Azure Database for PostgreSQL - 관리형 데이터베이스 서비스
  • Azure Container Apps - 서버리스 컨테이너
  • ---

    면책 조항: 이는 가상의 소매 데이터를 사용하는 학습 연습입니다. 프로덕션 환경에서 유사한 솔루션을 구현할 때는 항상 조직의 데이터 거버넌스 및 보안 정책을 따르십시오.

    ---

    면책 조항:

    이 문서는 AI 번역 서비스 Co-op Translator를 사용하여 번역되었습니다.

    정확성을 위해 최선을 다하고 있으나, 자동 번역에는 오류나 부정확성이 포함될 수 있습니다.

    원본 문서의 원어 버전이 권위 있는 출처로 간주되어야 합니다.

    중요한 정보의 경우, 전문적인 인간 번역을 권장합니다.

    이 번역 사용으로 인해 발생하는 오해나 잘못된 해석에 대해 당사는 책임을 지지 않습니다.

    MCP Academy — microsoft/mcp-for-beginners