5.12 Entra ID Authentication for Model Context Protocol Servers

Module
Advanced Topics
Progress
68%

Securing AI Workflows: Entra ID Authentication for Model Context Protocol Servers

Introduction

Securing your Model Context Protocol (MCP) server is as important as locking the front door of your house.

Leaving your MCP server open exposes your tools and data to unauthorized access, which can lead to security breaches.

Microsoft Entra ID provides a robust cloud-based identity and access management solution, helping ensure that only authorized users and applications can interact with your MCP server.

In this section, you’ll learn how to protect your AI workflows using Entra ID authentication.

Learning Objectives

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

  • Understand the importance of securing MCP servers.
  • Explain the basics of Microsoft Entra ID and OAuth 2.0 authentication.
  • Recognize the difference between public and confidential clients.
  • Implement Entra ID authentication in both local (public client) and remote (confidential client) MCP server scenarios.
  • Apply security best practices when developing AI workflows.
  • Security and MCP

    Just as you wouldn't leave the front door of your house unlocked, you shouldn't leave your MCP server open for anyone to access.

    Securing your AI workflows is essential for building robust, trustworthy, and safe applications.

    This chapter will introduce you to using Microsoft Entra ID to secure your MCP servers, ensuring that only authorized users and applications can interact with your tools and data.

    Why Security Matters for MCP Servers

    Imagine your MCP server has a tool that can send emails or access a customer database. An unsecured server would mean anyone could potentially use that tool, leading to unauthorized data access, spam, or other malicious activities.

    By implementing authentication, you ensure that every request to your server is verified, confirming the identity of the user or application making the request. This is the first and most critical step in securing your AI workflows.

    Introduction to Microsoft Entra ID

    By using Entra ID, you can:

  • Enable secure sign-in for users.
  • Protect APIs and services.
  • Manage access policies from a central location.
  • For MCP servers, Entra ID provides a robust and widely-trusted solution to manage who can access your server's capabilities.

    ---

    Understanding the Magic: How Entra ID Authentication Works

    Entra ID uses open standards like OAuth 2.0 to handle authentication. While the details can be complex, the core concept is simple and can be understood with an analogy.

    A Gentle Introduction to OAuth 2.0: The Valet Key

    Think of OAuth 2.0 like a valet service for your car.

    When you arrive at a restaurant, you don't give the valet your master key.

    Instead, you provide a valet key that has limited permissionsβ€”it can start the car and lock the doors, but it can't open the trunk or the glove compartment.

    In this analogy:

  • You are the User.
  • Your car is the MCP Server with its valuable tools and data.
  • The Valet is Microsoft Entra ID.
  • The Parking Attendant is the MCP Client (the application trying to access the server).
  • The Valet Key is the Access Token.
  • The access token is a secure string of text that the MCP client receives from Entra ID after you sign in.

    The client then presents this token to the MCP server with every request.

    The server can verify the token to ensure the request is legitimate and that the client has the necessary permissions, all without ever needing to handle your actual credentials (like your password).

    The Authentication Flow

    Here’s how the process works in practice:

    
    sequenceDiagram
    
        actor User as πŸ‘€ User
    
        participant Client as πŸ–₯️ MCP Client
    
        participant Entra as πŸ” Microsoft Entra ID
    
        participant Server as πŸ”§ MCP Server
    
    
    
        Client->>+User: Please sign in to continue.
    
        User->>+Entra: Enters credentials (username/password).
    
        Entra-->>Client: Here is your access token.
    
        User-->>-Client: (Returns to the application)
    
    
    
        Client->>+Server: I need to use a tool. Here is my access token.
    
        Server->>+Entra: Is this access token valid?
    
        Entra-->>-Server: Yes, it is.
    
        Server-->>-Client: Token is valid. Here is the result of the tool.
    
    

    Introducing the Microsoft Authentication Library (MSAL)

    Before we dive into the code, it's important to introduce a key component you'll see in the examples: the Microsoft Authentication Library (MSAL).

    MSAL is a library developed by Microsoft that makes it much easier for developers to handle authentication.

    Instead of you having to write all the complex code to handle security tokens, manage sign-ins, and refresh sessions, MSAL takes care of the heavy lifting.

    Using a library like MSAL is highly recommended because:

  • It's Secure: It implements industry-standard protocols and security best practices, reducing the risk of vulnerabilities in your code.
  • It Simplifies Development: It abstracts away the complexity of the OAuth 2.0 and OpenID Connect protocols, allowing you to add robust authentication to your application with just a few lines of code.
  • It's Maintained: Microsoft actively maintains and updates MSAL to address new security threats and platform changes.
  • MSAL supports a wide variety of languages and application frameworks, including .NET, JavaScript/TypeScript, Python, Java, Go, and mobile platforms like iOS and Android.

    This means you can use the same consistent authentication patterns across your entire technology stack.

    To learn more about MSAL, you can check out the official MSAL overview documentation.

    ---

    Securing Your MCP Server with Entra ID: A Step-by-Step Guide

    Now, let's walk through how to secure a local MCP server (one that communicates over stdio) using Entra ID.

    This example uses a public client, which is suitable for applications running on a user's machine, like a desktop app or a local development server.

    Scenario 1: Securing a Local MCP Server (with a Public Client)

    In this scenario, we'll look at an MCP server that runs locally, communicates over stdio, and uses Entra ID to authenticate the user before allowing access to its tools.

    The server will have a single tool that fetches the user's profile information from the Microsoft Graph API.

    1. Setting Up the Application in Entra ID

    Before writing any code, you need to register your application in Microsoft Entra ID. This tells Entra ID about your application and grants it permission to use the authentication service.

    1. Navigate to the Microsoft Entra portal.

    2. Go to App registrations and click New registration.

    3. Give your application a name (e.g., "My Local MCP Server").

    4. For Supported account types, select Accounts in this organizational directory only.

    5. You can leave the Redirect URI blank for this example.

    6. Click Register.

    Once registered, take note of the Application (client) ID and Directory (tenant) ID. You'll need these in your code.

    2. The Code: A Breakdown

    Let's look at the key parts of the code that handle authentication.

    The full code for this example is available in the Entra ID - Local - WAM folder of the mcp-auth-servers GitHub repository.

    AuthenticationService.cs

    This class is responsible for handling the interaction with Entra ID.

  • CreateAsync: This method initializes the PublicClientApplication from the MSAL (Microsoft Authentication Library). It's configured with your application's clientId and tenantId.
  • WithBroker: This enables the use of a broker (like the Windows Web Account Manager), which provides a more secure and seamless single sign-on experience.
  • AcquireTokenAsync: This is the core method. It first tries to get a token silently (meaning the user won't have to sign in again if they already have a valid session). If a silent token can't be acquired, it will prompt the user to sign in interactively.
  • 
    // Simplified for clarity
    
    public static async Task<AuthenticationService> CreateAsync(ILogger<AuthenticationService> logger)
    
    {
    
        var msalClient = PublicClientApplicationBuilder
    
            .Create(_clientId) // Your Application (client) ID
    
            .WithAuthority(AadAuthorityAudience.AzureAdMyOrg)
    
            .WithTenantId(_tenantId) // Your Directory (tenant) ID
    
            .WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows))
    
            .Build();
    
    
    
        // ... cache registration ...
    
    
    
        return new AuthenticationService(logger, msalClient);
    
    }
    
    
    
    public async Task<string> AcquireTokenAsync()
    
    {
    
        try
    
        {
    
            // Try silent authentication first
    
            var accounts = await _msalClient.GetAccountsAsync();
    
            var account = accounts.FirstOrDefault();
    
    
    
            AuthenticationResult? result = null;
    
    
    
            if (account != null)
    
            {
    
                result = await _msalClient.AcquireTokenSilent(_scopes, account).ExecuteAsync();
    
            }
    
            else
    
            {
    
                // If no account, or silent fails, go interactive
    
                result = await _msalClient.AcquireTokenInteractive(_scopes).ExecuteAsync();
    
            }
    
    
    
            return result.AccessToken;
    
        }
    
        catch (Exception ex)
    
        {
    
            _logger.LogError(ex, "An error occurred while acquiring the token.");
    
            throw; // Optionally rethrow the exception for higher-level handling
    
        }
    
    }
    
    

    Program.cs

    This is where the MCP server is set up and the authentication service is integrated.

  • AddSingleton: This registers the AuthenticationService with the dependency injection container, so it can be used by other parts of the application (like our tool).
  • GetUserDetailsFromGraph tool: This tool requires an instance of AuthenticationService. Before it does anything, it calls authService.AcquireTokenAsync() to get a valid access token. If authentication is successful, it uses the token to call the Microsoft Graph API and fetch the user's details.
  • 
    // Simplified for clarity
    
    [McpServerTool(Name = "GetUserDetailsFromGraph")]
    
    public static async Task<string> GetUserDetailsFromGraph(
    
        AuthenticationService authService)
    
    {
    
        try
    
        {
    
            // This will trigger the authentication flow
    
            var accessToken = await authService.AcquireTokenAsync();
    
    
    
            // Use the token to create a GraphServiceClient
    
            var graphClient = new GraphServiceClient(
    
                new BaseBearerTokenAuthenticationProvider(new TokenProvider(authService)));
    
    
    
            var user = await graphClient.Me.GetAsync();
    
    
    
            return System.Text.Json.JsonSerializer.Serialize(user);
    
        }
    
        catch (Exception ex)
    
        {
    
            return $"Error: {ex.Message}";
    
        }
    
    }
    
    
    3. How It All Works Together

    1.

    When the MCP client tries to use the GetUserDetailsFromGraph tool, the tool first calls AcquireTokenAsync.

    2. AcquireTokenAsync triggers the MSAL library to check for a valid token.

    3. If no token is found, MSAL, through the broker, will prompt the user to sign in with their Entra ID account.

    4. Once the user signs in, Entra ID issues an access token.

    5. The tool receives the token and uses it to make a secure call to the Microsoft Graph API.

    6. The user's details are returned to the MCP client.

    This process ensures that only authenticated users can use the tool, effectively securing your local MCP server.

    Scenario 2: Securing a Remote MCP Server (with a Confidential Client)

    When your MCP server is running on a remote machine (like a cloud server) and communicates over a protocol like HTTP Streaming, the security requirements are different.

    In this case, you should use a confidential client and the Authorization Code Flow.

    This is a more secure method because the application's secrets are never exposed to the browser.

    This example uses a TypeScript-based MCP server that uses Express.js to handle HTTP requests.

    1. Setting Up the Application in Entra ID

    The setup in Entra ID is similar to the public client, but with one key difference: you need to create a client secret.

    1. Navigate to the Microsoft Entra portal.

    2. In your app registration, go to the Certificates & secrets tab.

    3. Click New client secret, give it a description, and click Add.

    4. Important: Copy the secret value immediately. You will not be able to see it again.

    5.

    You also need to configure a Redirect URI.

    Go to the Authentication tab, click Add a platform, select Web, and enter the redirect URI for your application (e.g., http://localhost:3001/auth/callback).

    > ⚠️ Important Security Note: For production applications, Microsoft strongly recommends using secretless authentication methods such as Managed Identity or Workload Identity Federation instead of client secrets.

    Client secrets pose security risks as they can be exposed or compromised.

    Managed identities provide a more secure approach by eliminating the need to store credentials in your code or configuration.

    >

    > For more information about managed identities and how to implement them, see the Managed identities for Azure resources overview.

    2. The Code: A Breakdown

    This example uses a session-based approach.

    When the user authenticates, the server stores the access token and refresh token in a session and gives the user a session token.

    This session token is then used for subsequent requests.

    The full code for this example is available in the Entra ID - Confidential client folder of the mcp-auth-servers GitHub repository.

    Server.ts

    This file sets up the Express server and the MCP transport layer.

  • requireBearerAuth: This is middleware that protects the /sse and /message endpoints. It checks for a valid bearer token in the Authorization header of the request.
  • EntraIdServerAuthProvider: This is a custom class that implements the McpServerAuthorizationProvider interface. It's responsible for handling the OAuth 2.0 flow.
  • /auth/callback: This endpoint handles the redirect from Entra ID after the user has authenticated. It exchanges the authorization code for an access token and a refresh token.
  • 
    // Simplified for clarity
    
    const app = express();
    
    const { server } = createServer();
    
    const provider = new EntraIdServerAuthProvider();
    
    
    
    // Protect the SSE endpoint
    
    app.get("/sse", requireBearerAuth({
    
      provider,
    
      requiredScopes: ["User.Read"]
    
    }), async (req, res) => {
    
      // ... connect to the transport ...
    
    });
    
    
    
    // Protect the message endpoint
    
    app.post("/message", requireBearerAuth({
    
      provider,
    
      requiredScopes: ["User.Read"]
    
    }), async (req, res) => {
    
      // ... handle the message ...
    
    });
    
    
    
    // Handle the OAuth 2.0 callback
    
    app.get("/auth/callback", (req, res) => {
    
      provider.handleCallback(req.query.code, req.query.state)
    
        .then(result => {
    
          // ... handle success or failure ...
    
        });
    
    });
    
    

    Tools.ts

    This file defines the tools that the MCP server provides.

    The getUserDetails tool is similar to the one in the previous example, but it gets the access token from the session.

    
    // Simplified for clarity
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
    
      const { name } = request.params;
    
      const context = request.params?.context as { token?: string } | undefined;
    
      const sessionToken = context?.token;
    
    
    
      if (name === ToolName.GET_USER_DETAILS) {
    
        if (!sessionToken) {
    
          throw new AuthenticationError("Authentication token is missing or invalid. Ensure the token is provided in the request context.");
    
        }
    
    
    
        // Get the Entra ID token from the session store
    
        const tokenData = tokenStore.getToken(sessionToken);
    
        const entraIdToken = tokenData.accessToken;
    
    
    
        const graphClient = Client.init({
    
          authProvider: (done) => {
    
            done(null, entraIdToken);
    
          }
    
        });
    
    
    
        const user = await graphClient.api('/me').get();
    
    
    
        // ... return user details ...
    
      }
    
    });
    
    

    auth/EntraIdServerAuthProvider.ts

    This class handles the logic for:

  • Redirecting the user to the Entra ID sign-in page.
  • Exchanging the authorization code for an access token.
  • Storing the tokens in the tokenStore.
  • Refreshing the access token when it expires.
  • 3. How It All Works Together

    1.

    When a user first tries to connect to the MCP server, the requireBearerAuth middleware will see that they don't have a valid session and will redirect them to the Entra ID sign-in page.

    2. The user signs in with their Entra ID account.

    3. Entra ID redirects the user back to the /auth/callback endpoint with an authorization code.

    4. The server exchanges the code for an access token and a refresh token, stores them, and creates a session token which is sent to the client.

    5. The client can now use this session token in the Authorization header for all future requests to the MCP server.

    6.

    When the getUserDetails tool is called, it uses the session token to look up the Entra ID access token and then uses that to call the Microsoft Graph API.

    This flow is more complex than the public client flow, but is required for internet-facing endpoints.

    Since remote MCP servers are accessible over the public internet, they need stronger security measures to protect against unauthorized access and potential attacks.

    Security Best Practices

  • Always use HTTPS: Encrypt communication between the client and server to protect tokens from being intercepted.
  • Implement Role-Based Access Control (RBAC): Don't just check *if* a user is authenticated; check *what* they are authorized to do. You can define roles in Entra ID and check for them in your MCP server.
  • Monitor and audit: Log all authentication events so you can detect and respond to suspicious activity.
  • Handle rate limiting and throttling: Microsoft Graph and other APIs implement rate limiting to prevent abuse. Implement exponential backoff and retry logic in your MCP server to gracefully handle HTTP 429 (Too Many Requests) responses. Consider caching frequently accessed data to reduce API calls.
  • Secure token storage: Store access tokens and refresh tokens securely. For local applications, use the system's secure storage mechanisms. For server applications, consider using encrypted storage or secure key management services like Azure Key Vault.
  • Token expiration handling: Access tokens have a limited lifetime. Implement automatic token refresh using refresh tokens to maintain seamless user experience without requiring re-authentication.
  • Consider using Azure API Management: While implementing security directly in your MCP server gives you fine-grained control, API Gateways like Azure API Management can handle many of these security concerns automatically, including authentication, authorization, rate limiting, and monitoring. They provide a centralized security layer that sits between your clients and your MCP servers. For more details on using API Gateways with MCP, see our Azure API Management Your Auth Gateway For MCP Servers.
  • Key Takeaways

  • Securing your MCP server is crucial for protecting your data and tools.
  • Microsoft Entra ID provides a robust and scalable solution for authentication and authorization.
  • Use a public client for local applications and a confidential client for remote servers.
  • The Authorization Code Flow is the most secure option for web applications.
  • Exercise

    1. Think about an MCP server you might build. Would it be a local server or a remote server?

    2. Based on your answer, would you use a public or confidential client?

    3. What permission would your MCP server request for performing actions against Microsoft Graph?

    Hands-on Exercises

    Exercise 1: Register an Application in Entra ID

    Navigate to the Microsoft Entra portal.

    Register a new application for your MCP server.

    Record the Application (client) ID and Directory (tenant) ID.

    Exercise 2: Secure a Local MCP Server (Public Client)

  • Follow the code example to integrate MSAL (Microsoft Authentication Library) for user authentication.
  • Test the authentication flow by calling the MCP tool that fetches user details from Microsoft Graph.
  • Exercise 3: Secure a Remote MCP Server (Confidential Client)

  • Register a confidential client in Entra ID and create a client secret.
  • Configure your Express.js MCP server to use the Authorization Code Flow.
  • Test the protected endpoints and confirm token-based access.
  • Exercise 4: Apply Security Best Practices

  • Enable HTTPS for your local or remote server.
  • Implement role-based access control (RBAC) in your server logic.
  • Add token expiration handling and secure token storage.
  • Resources

    1. MSAL Overview Documentation

    Learn how the Microsoft Authentication Library (MSAL) enables secure token acquisition across platforms:

    MSAL Overview on Microsoft Learn

    2. Azure-Samples/mcp-auth-servers GitHub Repository

    Reference implementations of MCP servers demonstrating authentication flows:

    Azure-Samples/mcp-auth-servers on GitHub

    3. Managed Identities for Azure Resources Overview

    Understand how to eliminate secrets by using system- or user-assigned managed identities:

    Managed Identities Overview on Microsoft Learn

    4. Azure API Management: Your Auth Gateway for MCP Servers

    A deep dive into using APIM as a secure OAuth2 gateway for MCP servers:

    Azure API Management Your Auth Gateway For MCP Servers

    5. Microsoft Graph Permissions Reference

    Comprehensive list of delegated and application permissions for Microsoft Graph:

    Microsoft Graph Permissions Reference

    Learning Outcomes

    After completing this section, you will be able to:

  • Articulate why authentication is critical for MCP servers and AI workflows.
  • Set up and configure Entra ID authentication for both local and remote MCP server scenarios.
  • Choose the appropriate client type (public or confidential) based on your server’s deployment.
  • Implement secure coding practices, including token storage and role-based authorization.
  • Confidently protect your MCP server and its tools from unauthorized access.
  • What's next

  • 5.13 Model Context Protocol (MCP) Integration with Azure AI Foundry
  • AI μ›Œν¬ν”Œλ‘œμš° λ³΄μ•ˆ: λͺ¨λΈ μ»¨ν…μŠ€νŠΈ ν”„λ‘œν† μ½œ μ„œλ²„μš© Entra ID 인증

    μ†Œκ°œ

    λͺ¨λΈ μ»¨ν…μŠ€νŠΈ ν”„λ‘œν† μ½œ(MCP) μ„œλ²„λ₯Ό λ³΄ν˜Έν•˜λŠ” 것은 μ§‘μ˜ ν˜„κ΄€λ¬Έμ„ μž κ·ΈλŠ” κ²ƒλ§ŒνΌ μ€‘μš”ν•©λ‹ˆλ‹€.

    MCP μ„œλ²„λ₯Ό 열어두면 도ꡬ와 데이터가 무단 접근에 λ…ΈμΆœλ˜μ–΄ λ³΄μ•ˆ μ‚¬κ³ λ‘œ μ΄μ–΄μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€.

    Microsoft Entra IDλŠ” κ°•λ ₯ν•œ ν΄λΌμš°λ“œ 기반 아이덴티티 및 μ ‘κ·Ό 관리 μ†”λ£¨μ…˜μ„ μ œκ³΅ν•˜μ—¬, κΆŒν•œμ΄ μžˆλŠ” μ‚¬μš©μžμ™€ μ• ν”Œλ¦¬μΌ€μ΄μ…˜λ§Œ MCP μ„œλ²„μ™€ μƒν˜Έμž‘μš©ν•  수 μžˆλ„λ‘ λ„μ™€μ€λ‹ˆλ‹€.

    이 μ„Ήμ…˜μ—μ„œλŠ” Entra ID 인증을 μ‚¬μš©ν•΄ AI μ›Œν¬ν”Œλ‘œμš°λ₯Ό λ³΄ν˜Έν•˜λŠ” 방법을 λ°°μ›λ‹ˆλ‹€.

    ν•™μŠ΅ λͺ©ν‘œ

    이 μ„Ήμ…˜μ„ 마치면 λ‹€μŒμ„ ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

  • MCP μ„œλ²„ λ³΄μ•ˆμ˜ μ€‘μš”μ„±μ„ μ΄ν•΄ν•œλ‹€.
  • Microsoft Entra ID와 OAuth 2.0 인증의 κΈ°λ³Έ κ°œλ…μ„ μ„€λͺ…ν•œλ‹€.
  • 곡개 ν΄λΌμ΄μ–ΈνŠΈμ™€ κΈ°λ°€ ν΄λΌμ΄μ–ΈνŠΈμ˜ 차이λ₯Ό μΈμ‹ν•œλ‹€.
  • 둜컬(곡개 ν΄λΌμ΄μ–ΈνŠΈ) 및 원격(κΈ°λ°€ ν΄λΌμ΄μ–ΈνŠΈ) MCP μ„œλ²„ μ‹œλ‚˜λ¦¬μ˜€μ—μ„œ Entra ID 인증을 κ΅¬ν˜„ν•œλ‹€.
  • AI μ›Œν¬ν”Œλ‘œμš° 개발 μ‹œ λ³΄μ•ˆ λͺ¨λ²” 사둀λ₯Ό μ μš©ν•œλ‹€.
  • λ³΄μ•ˆκ³Ό MCP

    μ§‘μ˜ ν˜„κ΄€λ¬Έμ„ μž κ·Έμ§€ μ•Šκ³  두지 μ•ŠλŠ” κ²ƒμ²˜λŸΌ, MCP μ„œλ²„λ„ λˆ„κ΅¬λ‚˜ μ ‘κ·Όν•  수 μžˆλ„λ‘ 열어두면 μ•ˆ λ©λ‹ˆλ‹€. AI μ›Œν¬ν”Œλ‘œμš°λ₯Ό μ•ˆμ „ν•˜κ²Œ λ³΄ν˜Έν•˜λŠ” 것은 κ²¬κ³ ν•˜κ³  μ‹ λ’°ν•  수 있으며 μ•ˆμ „ν•œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ λ§Œλ“œλŠ” 데 ν•„μˆ˜μ μž…λ‹ˆλ‹€. 이 μž₯μ—μ„œλŠ” Microsoft Entra IDλ₯Ό μ‚¬μš©ν•΄ MCP μ„œλ²„λ₯Ό λ³΄ν˜Έν•˜λŠ” 방법을 μ†Œκ°œν•˜λ©°, κΆŒν•œμ΄ μžˆλŠ” μ‚¬μš©μžμ™€ μ• ν”Œλ¦¬μΌ€μ΄μ…˜λ§Œ 도ꡬ와 데이터에 μ ‘κ·Όν•  수 μžˆλ„λ‘ ν•©λ‹ˆλ‹€.

    MCP μ„œλ²„ λ³΄μ•ˆμ΄ μ€‘μš”ν•œ 이유

    MCP μ„œλ²„μ— 이메일을 λ³΄λ‚΄κ±°λ‚˜ 고객 λ°μ΄ν„°λ² μ΄μŠ€μ— μ ‘κ·Όν•  수 μžˆλŠ” 도ꡬ가 μžˆλ‹€κ³  κ°€μ •ν•΄ λ³΄μ„Έμš”. λ³΄μ•ˆμ΄ μ·¨μ•½ν•œ μ„œλ²„λΌλ©΄ λˆ„κ΅¬λ‚˜ κ·Έ 도ꡬλ₯Ό μ‚¬μš©ν•  수 μžˆμ–΄ 무단 데이터 μ ‘κ·Ό, 슀팸 λ°œμ†‘, 기타 μ•…μ˜μ  ν–‰μœ„κ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

    인증을 κ΅¬ν˜„ν•˜λ©΄ μ„œλ²„μ— λŒ€ν•œ λͺ¨λ“  μš”μ²­μ΄ κ²€μ¦λ˜μ–΄ μš”μ²­μ„ ν•˜λŠ” μ‚¬μš©μžλ‚˜ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 신원을 확인할 수 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” AI μ›Œν¬ν”Œλ‘œμš° λ³΄μ•ˆμ˜ 첫 번째이자 κ°€μž₯ μ€‘μš”ν•œ λ‹¨κ³„μž…λ‹ˆλ‹€.

    Microsoft Entra ID μ†Œκ°œ

    Entra IDλ₯Ό μ‚¬μš©ν•˜λ©΄ λ‹€μŒμ΄ κ°€λŠ₯ν•©λ‹ˆλ‹€:

  • μ‚¬μš©μžμ— λŒ€ν•œ μ•ˆμ „ν•œ 둜그인 지원
  • API 및 μ„œλΉ„μŠ€ 보호
  • μ€‘μ•™μ—μ„œ μ ‘κ·Ό μ •μ±… 관리
  • MCP μ„œλ²„μ˜ 경우, Entra IDλŠ” μ„œλ²„ κΈ°λŠ₯에 μ ‘κ·Όν•  수 μžˆλŠ” μ‚¬μš©μžλ₯Ό κ΄€λ¦¬ν•˜λŠ” κ°•λ ₯ν•˜κ³  μ‹ λ’°λ°›λŠ” μ†”λ£¨μ…˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€.

    ---

    핡심 μ΄ν•΄ν•˜κΈ°: Entra ID 인증 μž‘λ™ 원리

    Entra IDλŠ” OAuth 2.0 같은 μ˜€ν”ˆ ν‘œμ€€μ„ μ‚¬μš©ν•΄ 인증을 μ²˜λ¦¬ν•©λ‹ˆλ‹€. μ„ΈλΆ€ 사항은 λ³΅μž‘ν•  수 μžˆμ§€λ§Œ, 핡심 κ°œλ…μ€ λΉ„μœ λ₯Ό 톡해 μ‰½κ²Œ 이해할 수 μžˆμŠ΅λ‹ˆλ‹€.

    OAuth 2.0 간단 μ†Œκ°œ: λ°œλ › ν‚€

    OAuth 2.0을 μžλ™μ°¨ λ°œλ › μ„œλΉ„μŠ€μ— λΉ„μœ ν•΄ λ³΄μ„Έμš”. 식당에 λ„μ°©ν–ˆμ„ λ•Œ, λ§ˆμŠ€ν„° ν‚€λ₯Ό λ°œλ ›μ—κ²Œ μ£Όμ§€ μ•Šκ³  μ œν•œλœ κΆŒν•œλ§Œ κ°€μ§„ λ°œλ › ν‚€λ₯Ό μ€λ‹ˆλ‹€. 이 ν‚€λŠ” μ°¨λ₯Ό μ‹œλ™ κ±Έκ³  문을 μž κΈ€ 수 μžˆμ§€λ§Œ, νŠΈλ ν¬λ‚˜ κΈ€λŸ¬λΈŒ λ°•μŠ€λŠ” μ—΄ 수 μ—†μŠ΅λ‹ˆλ‹€.

    이 λΉ„μœ μ—μ„œ:

  • 당신은 μ‚¬μš©μžμž…λ‹ˆλ‹€.
  • λ‹Ήμ‹ μ˜ μ°¨λŠ” 도ꡬ와 데이터가 μžˆλŠ” MCP μ„œλ²„μž…λ‹ˆλ‹€.
  • λ°œλ ›μ€ Microsoft Entra IDμž…λ‹ˆλ‹€.
  • μ£Όμ°¨ λ‹΄λ‹ΉμžλŠ” μ„œλ²„μ— μ ‘κ·Όν•˜λ €λŠ” MCP ν΄λΌμ΄μ–ΈνŠΈ(μ• ν”Œλ¦¬μΌ€μ΄μ…˜)μž…λ‹ˆλ‹€.
  • λ°œλ › ν‚€λŠ” μ•‘μ„ΈμŠ€ ν† ν°μž…λ‹ˆλ‹€.
  • μ•‘μ„ΈμŠ€ 토큰은 μ‚¬μš©μžκ°€ λ‘œκ·ΈμΈν•œ ν›„ MCP ν΄λΌμ΄μ–ΈνŠΈκ°€ Entra IDλ‘œλΆ€ν„° λ°›λŠ” μ•ˆμ „ν•œ λ¬Έμžμ—΄μž…λ‹ˆλ‹€. ν΄λΌμ΄μ–ΈνŠΈλŠ” 이 토큰을 λ§€ μš”μ²­ μ‹œ MCP μ„œλ²„μ— μ œμ‹œν•˜λ©°, μ„œλ²„λŠ” 토큰을 검증해 μš”μ²­μ΄ 합법적이고 ν•„μš”ν•œ κΆŒν•œμ΄ μžˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€. 이 κ³Όμ •μ—μ„œ μ‹€μ œ μ‚¬μš©μž 자격 증λͺ…(예: λΉ„λ°€λ²ˆν˜Έ)을 λ‹€λ£° ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€.

    인증 흐름

    μ‹€μ œ 과정은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:

    
    sequenceDiagram
    
        actor User as πŸ‘€ User
    
        participant Client as πŸ–₯️ MCP Client
    
        participant Entra as πŸ” Microsoft Entra ID
    
        participant Server as πŸ”§ MCP Server
    
    
    
        Client->>+User: Please sign in to continue.
    
        User->>+Entra: Enters credentials (username/password).
    
        Entra-->>Client: Here is your access token.
    
        User-->>-Client: (Returns to the application)
    
    
    
        Client->>+Server: I need to use a tool. Here is my access token.
    
        Server->>+Entra: Is this access token valid?
    
        Entra-->>-Server: Yes, it is.
    
        Server-->>-Client: Token is valid. Here is the result of the tool.
    
    

    Microsoft 인증 라이브러리(MSAL) μ†Œκ°œ

    μ½”λ“œ 예제λ₯Ό μ‚΄νŽ΄λ³΄κΈ° 전에 μ€‘μš”ν•œ ꡬ성 μš”μ†ŒμΈ Microsoft 인증 라이브러리(MSAL)λ₯Ό μ†Œκ°œν•©λ‹ˆλ‹€.

    MSAL은 κ°œλ°œμžκ°€ 인증을 μ‰½κ²Œ μ²˜λ¦¬ν•  수 μžˆλ„λ‘ Microsoftμ—μ„œ λ§Œλ“  λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€. λ³΅μž‘ν•œ λ³΄μ•ˆ 토큰 관리, 둜그인 처리, μ„Έμ…˜ κ°±μ‹  μ½”λ“œλ₯Ό 직접 μž‘μ„±ν•  ν•„μš” 없이 MSAL이 이λ₯Ό λŒ€μ‹  μ²˜λ¦¬ν•©λ‹ˆλ‹€.

    MSAL μ‚¬μš©μ„ ꢌμž₯ν•˜λŠ” μ΄μœ λŠ”:

  • μ•ˆμ „μ„±: 업계 ν‘œμ€€ ν”„λ‘œν† μ½œκ³Ό λ³΄μ•ˆ λͺ¨λ²” 사둀λ₯Ό κ΅¬ν˜„ν•΄ μ½”λ“œ 취약점 μœ„ν—˜μ„ μ€„μž…λ‹ˆλ‹€.
  • 개발 κ°„μ†Œν™”: OAuth 2.0κ³Ό OpenID Connect의 λ³΅μž‘ν•¨μ„ 좔상화해 λͺ‡ μ€„μ˜ μ½”λ“œλ‘œ κ°•λ ₯ν•œ 인증 κΈ°λŠ₯을 μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • 지속적 μœ μ§€λ³΄μˆ˜: Microsoftκ°€ 적극적으둜 κ΄€λ¦¬ν•˜λ©° μƒˆλ‘œμš΄ λ³΄μ•ˆ μœ„ν˜‘κ³Ό ν”Œλž«νΌ 변화에 λŒ€μ‘ν•©λ‹ˆλ‹€.
  • MSAL은 .NET, JavaScript/TypeScript, Python, Java, Go, iOS, Android λ“± λ‹€μ–‘ν•œ 언어와 ν”„λ ˆμž„μ›Œν¬λ₯Ό 지원해 전체 기술 μŠ€νƒμ—μ„œ μΌκ΄€λœ 인증 νŒ¨ν„΄μ„ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

    MSAL에 λŒ€ν•΄ 더 μ•Œκ³  μ‹Άλ‹€λ©΄ 곡식 MSAL κ°œμš” λ¬Έμ„œλ₯Ό μ°Έκ³ ν•˜μ„Έμš”.

    ---

    Entra ID둜 MCP μ„œλ²„ λ³΄ν˜Έν•˜κΈ°: 단계별 κ°€μ΄λ“œ

    이제 Entra IDλ₯Ό μ‚¬μš©ν•΄ 둜컬 MCP μ„œλ²„(stdio 톡신)λ₯Ό λ³΄ν˜Έν•˜λŠ” 방법을 μ‚΄νŽ΄λ³΄κ² μŠ΅λ‹ˆλ‹€. 이 μ˜ˆμ œλŠ” μ‚¬μš©μžμ˜ μ»΄ν“¨ν„°μ—μ„œ μ‹€ν–‰λ˜λŠ” λ°μŠ€ν¬ν†± μ•±μ΄λ‚˜ 둜컬 개발 μ„œλ²„μ— μ ν•©ν•œ 곡개 ν΄λΌμ΄μ–ΈνŠΈλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

    μ‹œλ‚˜λ¦¬μ˜€ 1: 둜컬 MCP μ„œλ²„ 보호 (곡개 ν΄λΌμ΄μ–ΈνŠΈ)

    이 μ‹œλ‚˜λ¦¬μ˜€μ—μ„œλŠ” λ‘œμ»¬μ—μ„œ μ‹€ν–‰λ˜κ³  stdio둜 ν†΅μ‹ ν•˜λŠ” MCP μ„œλ²„κ°€ Entra ID둜 μ‚¬μš©μžλ₯Ό μΈμ¦ν•œ ν›„ 도ꡬ 접근을 ν—ˆμš©ν•˜λŠ” 과정을 λ‹€λ£Ήλ‹ˆλ‹€. μ„œλ²„μ—λŠ” Microsoft Graph APIμ—μ„œ μ‚¬μš©μž ν”„λ‘œν•„ 정보λ₯Ό κ°€μ Έμ˜€λŠ” 단일 도ꡬ가 μžˆμŠ΅λ‹ˆλ‹€.

    1. Entra IDμ—μ„œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ„€μ •ν•˜κΈ°

    μ½”λ“œλ₯Ό μž‘μ„±ν•˜κΈ° 전에 Microsoft Entra ID에 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ 등둝해야 ν•©λ‹ˆλ‹€. μ΄λŠ” Entra ID에 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 정보λ₯Ό μ•Œλ € 인증 μ„œλΉ„μŠ€λ₯Ό μ‚¬μš©ν•  κΆŒν•œμ„ λΆ€μ—¬ν•˜λŠ” κ³Όμ •μž…λ‹ˆλ‹€.

    1. Microsoft Entra 포털에 μ ‘μ†ν•©λ‹ˆλ‹€.

    2. μ•± 등둝(App registrations)으둜 이동해 μƒˆ 등둝(New registration)을 ν΄λ¦­ν•©λ‹ˆλ‹€.

    3. μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 이름(예: "My Local MCP Server")을 μž…λ ₯ν•©λ‹ˆλ‹€.

    4. μ§€μ›λ˜λŠ” 계정 μœ ν˜•(Supported account types)μ—μ„œ 이 쑰직 λ””λ ‰ν„°λ¦¬μ˜ κ³„μ •λ§Œ(Accounts in this organizational directory only)을 μ„ νƒν•©λ‹ˆλ‹€.

    5. 이 μ˜ˆμ œμ—μ„œλŠ” λ¦¬λ””λ ‰μ…˜ URI(Redirect URI)λ₯Ό λΉ„μ›Œλ‘‘λ‹ˆλ‹€.

    6. 등둝(Register)을 ν΄λ¦­ν•©λ‹ˆλ‹€.

    등둝 ν›„ μ• ν”Œλ¦¬μΌ€μ΄μ…˜(ν΄λΌμ΄μ–ΈνŠΈ) ID와 디렉터리(ν…Œλ„ŒνŠΈ) IDλ₯Ό 기둝해 λ‘μ„Έμš”. μ½”λ“œμ—μ„œ ν•„μš”ν•©λ‹ˆλ‹€.

    2. μ½”λ“œ μ£Όμš” λΆ€λΆ„ μ„€λͺ…

    인증을 μ²˜λ¦¬ν•˜λŠ” 핡심 μ½”λ“œλ₯Ό μ‚΄νŽ΄λ³΄κ² μŠ΅λ‹ˆλ‹€.

    전체 μ½”λ“œλŠ” mcp-auth-servers GitHub μ €μž₯μ†Œμ˜ Entra ID - Local - WAM ν΄λ”μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

    AuthenticationService.cs

    이 ν΄λž˜μŠ€λŠ” Entra IDμ™€μ˜ μƒν˜Έμž‘μš©μ„ λ‹΄λ‹Ήν•©λ‹ˆλ‹€.

  • CreateAsync: MSAL의 PublicClientApplication을 μ΄ˆκΈ°ν™”ν•©λ‹ˆλ‹€. μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ clientId와 tenantId둜 κ΅¬μ„±λ©λ‹ˆλ‹€.
  • WithBroker: Windows Web Account Manager 같은 브둜컀 μ‚¬μš©μ„ ν™œμ„±ν™”ν•΄ 더 μ•ˆμ „ν•˜κ³  μ›ν™œν•œ μ‹±κΈ€ μ‚¬μΈμ˜¨ κ²½ν—˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€.
  • AcquireTokenAsync: 핡심 λ©”μ„œλ“œλ‘œ, λ¨Όμ € 쑰용히 토큰을 μ–»μœΌλ € μ‹œλ„ν•©λ‹ˆλ‹€(이미 μœ νš¨ν•œ μ„Έμ…˜μ΄ 있으면 둜그인 κ³Όμ • 없이 토큰 νšλ“). μ‹€νŒ¨ν•˜λ©΄ μ‚¬μš©μžμ—κ²Œ 둜그인 창을 λ„μ›Œ 인증을 μ§„ν–‰ν•©λ‹ˆλ‹€.
  • 
    // Simplified for clarity
    
    public static async Task<AuthenticationService> CreateAsync(ILogger<AuthenticationService> logger)
    
    {
    
        var msalClient = PublicClientApplicationBuilder
    
            .Create(_clientId) // Your Application (client) ID
    
            .WithAuthority(AadAuthorityAudience.AzureAdMyOrg)
    
            .WithTenantId(_tenantId) // Your Directory (tenant) ID
    
            .WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows))
    
            .Build();
    
    
    
        // ... cache registration ...
    
    
    
        return new AuthenticationService(logger, msalClient);
    
    }
    
    
    
    public async Task<string> AcquireTokenAsync()
    
    {
    
        try
    
        {
    
            // Try silent authentication first
    
            var accounts = await _msalClient.GetAccountsAsync();
    
            var account = accounts.FirstOrDefault();
    
    
    
            AuthenticationResult? result = null;
    
    
    
            if (account != null)
    
            {
    
                result = await _msalClient.AcquireTokenSilent(_scopes, account).ExecuteAsync();
    
            }
    
            else
    
            {
    
                // If no account, or silent fails, go interactive
    
                result = await _msalClient.AcquireTokenInteractive(_scopes).ExecuteAsync();
    
            }
    
    
    
            return result.AccessToken;
    
        }
    
        catch (Exception ex)
    
        {
    
            _logger.LogError(ex, "An error occurred while acquiring the token.");
    
            throw; // Optionally rethrow the exception for higher-level handling
    
        }
    
    }
    
    

    Program.cs

    MCP μ„œλ²„λ₯Ό μ„€μ •ν•˜κ³  인증 μ„œλΉ„μŠ€λ₯Ό ν†΅ν•©ν•˜λŠ” λΆ€λΆ„μž…λ‹ˆλ‹€.

  • AddSingleton: AuthenticationServiceλ₯Ό μ˜μ‘΄μ„± μ£Όμž… μ»¨ν…Œμ΄λ„ˆμ— 등둝해 λ‹€λ₯Έ λΆ€λΆ„(예: 도ꡬ)μ—μ„œ μ‚¬μš©ν•  수 있게 ν•©λ‹ˆλ‹€.
  • GetUserDetailsFromGraph 도ꡬ: 이 λ„κ΅¬λŠ” AuthenticationService μΈμŠ€ν„΄μŠ€λ₯Ό ν•„μš”λ‘œ ν•©λ‹ˆλ‹€. μ‹€ν–‰ 전에 authService.AcquireTokenAsync()λ₯Ό ν˜ΈμΆœν•΄ μœ νš¨ν•œ μ•‘μ„ΈμŠ€ 토큰을 μ–»μŠ΅λ‹ˆλ‹€. 인증에 μ„±κ³΅ν•˜λ©΄ 토큰을 μ‚¬μš©ν•΄ Microsoft Graph APIλ₯Ό ν˜ΈμΆœν•΄ μ‚¬μš©μž 정보λ₯Ό κ°€μ Έμ˜΅λ‹ˆλ‹€.
  • 
    // Simplified for clarity
    
    [McpServerTool(Name = "GetUserDetailsFromGraph")]
    
    public static async Task<string> GetUserDetailsFromGraph(
    
        AuthenticationService authService)
    
    {
    
        try
    
        {
    
            // This will trigger the authentication flow
    
            var accessToken = await authService.AcquireTokenAsync();
    
    
    
            // Use the token to create a GraphServiceClient
    
            var graphClient = new GraphServiceClient(
    
                new BaseBearerTokenAuthenticationProvider(new TokenProvider(authService)));
    
    
    
            var user = await graphClient.Me.GetAsync();
    
    
    
            return System.Text.Json.JsonSerializer.Serialize(user);
    
        }
    
        catch (Exception ex)
    
        {
    
            return $"Error: {ex.Message}";
    
        }
    
    }
    
    
    3. 전체 λ™μž‘ κ³Όμ •

    1.

    MCP ν΄λΌμ΄μ–ΈνŠΈκ°€ GetUserDetailsFromGraph 도ꡬλ₯Ό μ‚¬μš©ν•˜λ € ν•  λ•Œ, λ„κ΅¬λŠ” λ¨Όμ € AcquireTokenAsyncλ₯Ό ν˜ΈμΆœν•©λ‹ˆλ‹€.

    2. AcquireTokenAsyncλŠ” MSAL 라이브러리λ₯Ό 톡해 μœ νš¨ν•œ 토큰이 μžˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.

    3. 토큰이 μ—†μœΌλ©΄ MSAL이 브둜컀λ₯Ό 톡해 μ‚¬μš©μžμ—κ²Œ Entra ID κ³„μ •μœΌλ‘œ λ‘œκ·ΈμΈν•˜λΌλŠ” 창을 λ„μ›λ‹ˆλ‹€.

    4. μ‚¬μš©μžκ°€ λ‘œκ·ΈμΈν•˜λ©΄ Entra IDκ°€ μ•‘μ„ΈμŠ€ 토큰을 λ°œκΈ‰ν•©λ‹ˆλ‹€.

    5. λ„κ΅¬λŠ” 토큰을 λ°›μ•„ Microsoft Graph API에 μ•ˆμ „ν•˜κ²Œ μš”μ²­μ„ λ³΄λƒ…λ‹ˆλ‹€.

    6. μ‚¬μš©μž 정보가 MCP ν΄λΌμ΄μ–ΈνŠΈμ— λ°˜ν™˜λ©λ‹ˆλ‹€.

    이 κ³Όμ •μœΌλ‘œ 인증된 μ‚¬μš©μžλ§Œ 도ꡬλ₯Ό μ‚¬μš©ν•  수 μžˆμ–΄ 둜컬 MCP μ„œλ²„κ°€ μ•ˆμ „ν•˜κ²Œ λ³΄ν˜Έλ©λ‹ˆλ‹€.

    μ‹œλ‚˜λ¦¬μ˜€ 2: 원격 MCP μ„œλ²„ 보호 (κΈ°λ°€ ν΄λΌμ΄μ–ΈνŠΈ)

    MCP μ„œλ²„κ°€ 원격 λ¨Έμ‹ (예: ν΄λΌμš°λ“œ μ„œλ²„)μ—μ„œ μ‹€ν–‰λ˜κ³  HTTP 슀트리밍 같은 ν”„λ‘œν† μ½œλ‘œ 톡신할 λ•ŒλŠ” λ³΄μ•ˆ μš”κ΅¬μ‚¬ν•­μ΄ λ‹€λ¦…λ‹ˆλ‹€. 이 경우 κΈ°λ°€ ν΄λΌμ΄μ–ΈνŠΈμ™€ Authorization Code Flowλ₯Ό μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€. 이 방법은 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 비밀이 λΈŒλΌμš°μ €μ— λ…ΈμΆœλ˜μ§€ μ•Šμ•„ 더 μ•ˆμ „ν•©λ‹ˆλ‹€.

    이 μ˜ˆμ œλŠ” Express.jsλ₯Ό μ‚¬μš©ν•΄ HTTP μš”μ²­μ„ μ²˜λ¦¬ν•˜λŠ” TypeScript 기반 MCP μ„œλ²„λ₯Ό λ‹€λ£Ήλ‹ˆλ‹€.

    1. Entra IDμ—μ„œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ„€μ •ν•˜κΈ°

    섀정은 곡개 ν΄λΌμ΄μ–ΈνŠΈμ™€ λΉ„μŠ·ν•˜μ§€λ§Œ, ν΄λΌμ΄μ–ΈνŠΈ λΉ„λ°€(client secret)을 생성해야 ν•œλ‹€λŠ” 점이 λ‹€λ¦…λ‹ˆλ‹€.

    1. Microsoft Entra 포털에 μ ‘μ†ν•©λ‹ˆλ‹€.

    2. μ•± λ“±λ‘μ—μ„œ μΈμ¦μ„œ 및 λΉ„λ°€(Certificates & secrets) νƒ­μœΌλ‘œ μ΄λ™ν•©λ‹ˆλ‹€.

    3. μƒˆ ν΄λΌμ΄μ–ΈνŠΈ λΉ„λ°€(New client secret)을 ν΄λ¦­ν•˜κ³  μ„€λͺ…을 μž…λ ₯ν•œ ν›„ μΆ”κ°€(Add)λ₯Ό ν΄λ¦­ν•©λ‹ˆλ‹€.

    4. μ€‘μš”: μƒμ„±λœ λΉ„λ°€ 값을 μ¦‰μ‹œ λ³΅μ‚¬ν•˜μ„Έμš”. λ‹€μ‹œ λ³Ό 수 μ—†μŠ΅λ‹ˆλ‹€.

    5. λ¦¬λ””λ ‰μ…˜ URI도 μ„€μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€. 인증(Authentication) νƒ­μ—μ„œ ν”Œλž«νΌ μΆ”κ°€(Add a platform)λ₯Ό ν΄λ¦­ν•˜κ³  μ›Ή(Web)을 μ„ νƒν•œ λ’€ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ λ¦¬λ””λ ‰μ…˜ URI(예: http://localhost:3001/auth/callback)λ₯Ό μž…λ ₯ν•©λ‹ˆλ‹€.

    > ⚠️ μ€‘μš”ν•œ λ³΄μ•ˆ μ°Έκ³ : 운영 ν™˜κ²½μ—μ„œλŠ” ν΄λΌμ΄μ–ΈνŠΈ λΉ„λ°€ λŒ€μ‹  Managed Identityλ‚˜ Workload Identity Federation 같은 λΉ„λ°€ μ—†λŠ” 인증 방식을 μ‚¬μš©ν•˜λŠ” 것을 Microsoftκ°€ κ°•λ ₯히 ꢌμž₯ν•©λ‹ˆλ‹€.

    ν΄λΌμ΄μ–ΈνŠΈ 비밀은 λ…ΈμΆœλ˜κ±°λ‚˜ νƒˆμ·¨λ  μœ„ν—˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.

    κ΄€λ¦¬ν˜• μ•„μ΄λ΄ν‹°ν‹°λŠ” μ½”λ“œλ‚˜ 섀정에 자격 증λͺ…을 μ €μž₯ν•  ν•„μš”κ°€ μ—†μ–΄ 더 μ•ˆμ „ν•©λ‹ˆλ‹€.

    >

    > κ΄€λ¦¬ν˜• 아이덴티티에 λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©κ³Ό κ΅¬ν˜„ 방법은 Azure λ¦¬μ†ŒμŠ€μš© κ΄€λ¦¬ν˜• 아이덴티티 κ°œμš”λ₯Ό μ°Έκ³ ν•˜μ„Έμš”.

    2. μ½”λ“œ μ£Όμš” λΆ€λΆ„ μ„€λͺ…

    이 μ˜ˆμ œλŠ” μ„Έμ…˜ 기반 방식을 μ‚¬μš©ν•©λ‹ˆλ‹€.

    μ‚¬μš©μžκ°€ μΈμ¦ν•˜λ©΄ μ„œλ²„κ°€ μ•‘μ„ΈμŠ€ 토큰과 κ°±μ‹  토큰을 μ„Έμ…˜μ— μ €μž₯ν•˜κ³ , μ‚¬μš©μžμ—κ²Œ μ„Έμ…˜ 토큰을 μ œκ³΅ν•©λ‹ˆλ‹€.

    이후 μš”μ²­μ— 이 μ„Έμ…˜ 토큰을 μ‚¬μš©ν•©λ‹ˆλ‹€.

    전체 μ½”λ“œλŠ” mcp-auth-servers GitHub μ €μž₯μ†Œμ˜ Entra ID - Confidential client ν΄λ”μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

    Server.ts

    Express μ„œλ²„μ™€ MCP 전솑 계측을 μ„€μ •ν•©λ‹ˆλ‹€.

  • requireBearerAuth: /sse와 /message μ—”λ“œν¬μΈνŠΈλ₯Ό λ³΄ν˜Έν•˜λŠ” λ―Έλ“€μ›¨μ–΄μž…λ‹ˆλ‹€. μš”μ²­μ˜ Authorization 헀더에 μœ νš¨ν•œ λ² μ–΄λŸ¬ 토큰이 μžˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.
  • EntraIdServerAuthProvider: McpServerAuthorizationProvider μΈν„°νŽ˜μ΄μŠ€λ₯Ό κ΅¬ν˜„ν•œ μ»€μŠ€ν…€ ν΄λž˜μŠ€μž…λ‹ˆλ‹€. OAuth 2.0 흐름을 μ²˜λ¦¬ν•©λ‹ˆλ‹€.
  • /auth/callback: μ‚¬μš©μžκ°€ 인증 ν›„ Entra IDμ—μ„œ λ¦¬λ””λ ‰μ…˜λ  λ•Œ ν˜ΈμΆœλ˜λŠ” μ—”λ“œν¬μΈνŠΈμž…λ‹ˆλ‹€. κΆŒν•œ μ½”λ“œλ₯Ό μ•‘μ„ΈμŠ€ 토큰과 κ°±μ‹  ν† ν°μœΌλ‘œ κ΅ν™˜ν•©λ‹ˆλ‹€.
  • 
    // Simplified for clarity
    
    const app = express();
    
    const { server } = createServer();
    
    const provider = new EntraIdServerAuthProvider();
    
    
    
    // Protect the SSE endpoint
    
    app.get("/sse", requireBearerAuth({
    
      provider,
    
      requiredScopes: ["User.Read"]
    
    }), async (req, res) => {
    
      // ... connect to the transport ...
    
    });
    
    
    
    // Protect the message endpoint
    
    app.post("/message", requireBearerAuth({
    
      provider,
    
      requiredScopes: ["User.Read"]
    
    }), async (req, res) => {
    
      // ... handle the message ...
    
    });
    
    
    
    // Handle the OAuth 2.0 callback
    
    app.get("/auth/callback", (req, res) => {
    
      provider.handleCallback(req.query.code, req.query.state)
    
        .then(result => {
    
          // ... handle success or failure ...
    
        });
    
    });
    
    

    Tools.ts

    MCP μ„œλ²„κ°€ μ œκ³΅ν•˜λŠ” 도ꡬ듀을 μ •μ˜ν•©λ‹ˆλ‹€. getUserDetails λ„κ΅¬λŠ” 이전 μ˜ˆμ œμ™€ λΉ„μŠ·ν•˜μ§€λ§Œ, μ•‘μ„ΈμŠ€ 토큰을 μ„Έμ…˜μ—μ„œ κ°€μ Έμ˜΅λ‹ˆλ‹€.

    
    // Simplified for clarity
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
    
      const { name } = request.params;
    
      const context = request.params?.context as { token?: string } | undefined;
    
      const sessionToken = context?.token;
    
    
    
      if (name === ToolName.GET_USER_DETAILS) {
    
        if (!sessionToken) {
    
          throw new AuthenticationError("Authentication token is missing or invalid. Ensure the token is provided in the request context.");
    
        }
    
    
    
        // Get the Entra ID token from the session store
    
        const tokenData = tokenStore.getToken(sessionToken);
    
        const entraIdToken = tokenData.accessToken;
    
    
    
        const graphClient = Client.init({
    
          authProvider: (done) => {
    
            done(null, entraIdToken);
    
          }
    
        });
    
    
    
        const user = await graphClient.api('/me').get();
    
    
    
        // ... return user details ...
    
      }
    
    });
    
    

    auth/EntraIdServerAuthProvider.ts

    이 ν΄λž˜μŠ€λŠ” λ‹€μŒ λ‘œμ§μ„ μ²˜λ¦¬ν•©λ‹ˆλ‹€:

  • μ‚¬μš©μžλ₯Ό Entra ID 둜그인 νŽ˜μ΄μ§€λ‘œ λ¦¬λ””λ ‰μ…˜
  • κΆŒν•œ μ½”λ“œλ₯Ό μ•‘μ„ΈμŠ€ ν† ν°μœΌλ‘œ κ΅ν™˜
  • 토큰을 tokenStore에 μ €μž₯
  • μ•‘μ„ΈμŠ€ 토큰 만료 μ‹œ κ°±μ‹ 
  • 3. 전체 λ™μž‘ κ³Όμ •

    1. μ‚¬μš©μžκ°€ 처음 MCP μ„œλ²„μ— μ—°κ²°ν•˜λ € ν•˜λ©΄, requireBearerAuth 미듀웨어가 μœ νš¨ν•œ μ„Έμ…˜μ΄ μ—†μŒμ„ κ°μ§€ν•˜κ³  Entra ID 둜그인 νŽ˜μ΄μ§€λ‘œ λ¦¬λ””λ ‰μ…˜ν•©λ‹ˆλ‹€.

    2. μ‚¬μš©μžκ°€ Entra ID κ³„μ •μœΌλ‘œ λ‘œκ·ΈμΈν•©λ‹ˆλ‹€.

    3. Entra IDκ°€ κΆŒν•œ μ½”λ“œλ₯Ό 포함해 μ‚¬μš©μžλ₯Ό /auth/callback μ—”λ“œν¬μΈνŠΈλ‘œ λ¦¬λ””λ ‰μ…˜ν•©λ‹ˆλ‹€.

    4. μ„œλ²„λŠ” μ½”λ“œλ₯Ό μ•‘μ„ΈμŠ€ 토큰과 λ¦¬ν”„λ ˆμ‹œ ν† ν°μœΌλ‘œ κ΅ν™˜ν•˜μ—¬ μ €μž₯ν•˜κ³ , μ„Έμ…˜ 토큰을 μƒμ„±ν•˜μ—¬ ν΄λΌμ΄μ–ΈνŠΈμ— μ „μ†‘ν•©λ‹ˆλ‹€.

    5. ν΄λΌμ΄μ–ΈνŠΈλŠ” 이제 이 μ„Έμ…˜ 토큰을 Authorization 헀더에 ν¬ν•¨μ‹œμΌœ MCP μ„œλ²„μ— λŒ€ν•œ λͺ¨λ“  ν–₯ν›„ μš”μ²­μ— μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

    6. getUserDetails 도ꡬ가 호좜되면 μ„Έμ…˜ 토큰을 μ‚¬μš©ν•΄ Entra ID μ•‘μ„ΈμŠ€ 토큰을 μ‘°νšŒν•˜κ³ , 이λ₯Ό μ΄μš©ν•΄ Microsoft Graph APIλ₯Ό ν˜ΈμΆœν•©λ‹ˆλ‹€.

    이 흐름은 곡개 ν΄λΌμ΄μ–ΈνŠΈ 흐름보닀 λ³΅μž‘ν•˜μ§€λ§Œ, 인터넷에 λ…ΈμΆœλœ μ—”λ“œν¬μΈνŠΈμ—λŠ” ν•„μˆ˜μ μž…λ‹ˆλ‹€. 원격 MCP μ„œλ²„λŠ” 곡용 인터넷을 톡해 μ ‘κ·Ό κ°€λŠ₯ν•˜λ―€λ‘œ, 무단 μ ‘κ·Όκ³Ό 잠재적 κ³΅κ²©μœΌλ‘œλΆ€ν„° λ³΄ν˜Έν•˜κΈ° μœ„ν•΄ 더 κ°•λ ₯ν•œ λ³΄μ•ˆ μ‘°μΉ˜κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

    λ³΄μ•ˆ λͺ¨λ²” 사둀

  • 항상 HTTPS μ‚¬μš©: ν΄λΌμ΄μ–ΈνŠΈμ™€ μ„œλ²„ κ°„ 톡신을 μ•”ν˜Έν™”ν•˜μ—¬ 토큰이 κ°€λ‘œμ±„μ΄μ§€ μ•Šλ„λ‘ λ³΄ν˜Έν•˜μ„Έμš”.
  • μ—­ν•  기반 μ ‘κ·Ό μ œμ–΄(RBAC) κ΅¬ν˜„: μ‚¬μš©μžκ°€ μΈμ¦λ˜μ—ˆλŠ”μ§€ μ—¬λΆ€λΏλ§Œ μ•„λ‹ˆλΌ, μ–΄λ–€ κΆŒν•œμ΄ μžˆλŠ”μ§€λ„ ν™•μΈν•˜μ„Έμš”. Entra IDμ—μ„œ 역할을 μ •μ˜ν•˜κ³  MCP μ„œλ²„μ—μ„œ 이λ₯Ό 검증할 수 μžˆμŠ΅λ‹ˆλ‹€.
  • λͺ¨λ‹ˆν„°λ§ 및 감사: λͺ¨λ“  인증 이벀트λ₯Ό κΈ°λ‘ν•˜μ—¬ μ˜μ‹¬μŠ€λŸ¬μš΄ ν™œλ™μ„ νƒμ§€ν•˜κ³  λŒ€μ‘ν•  수 μžˆλ„λ‘ ν•˜μ„Έμš”.
  • μš”μ²­ μ œν•œ 및 μŠ€λ‘œν‹€λ§ 처리: Microsoft Graph 및 기타 APIλŠ” λ‚¨μš©μ„ λ°©μ§€ν•˜κΈ° μœ„ν•΄ μš”μ²­ μ œν•œμ„ μ μš©ν•©λ‹ˆλ‹€. MCP μ„œλ²„μ—μ„œ μ§€μˆ˜ λ°±μ˜€ν”„ 및 μž¬μ‹œλ„ λ‘œμ§μ„ κ΅¬ν˜„ν•˜μ—¬ HTTP 429(μš”μ²­ κ³Όλ‹€) 응닡을 μš°μ•„ν•˜κ²Œ μ²˜λ¦¬ν•˜μ„Έμš”. 자주 μ‘°νšŒν•˜λŠ” 데이터λ₯Ό μΊμ‹±ν•˜μ—¬ API ν˜ΈμΆœμ„ μ€„μ΄λŠ” 것도 κ³ λ €ν•˜μ„Έμš”.
  • 토큰 μ•ˆμ „ μ €μž₯: μ•‘μ„ΈμŠ€ 토큰과 λ¦¬ν”„λ ˆμ‹œ 토큰을 μ•ˆμ „ν•˜κ²Œ μ €μž₯ν•˜μ„Έμš”. 둜컬 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 경우 μ‹œμŠ€ν…œμ˜ λ³΄μ•ˆ μ €μž₯μ†Œλ₯Ό μ‚¬μš©ν•˜κ³ , μ„œλ²„ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ€ μ•”ν˜Έν™” μ €μž₯μ†Œλ‚˜ Azure Key Vault 같은 λ³΄μ•ˆ ν‚€ 관리 μ„œλΉ„μŠ€λ₯Ό ν™œμš©ν•˜μ„Έμš”.
  • 토큰 만료 처리: μ•‘μ„ΈμŠ€ 토큰은 유효 기간이 μ œν•œλ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. λ¦¬ν”„λ ˆμ‹œ 토큰을 μ‚¬μš©ν•΄ μžλ™μœΌλ‘œ 토큰을 κ°±μ‹ ν•˜μ—¬ 재인증 없이 μ›ν™œν•œ μ‚¬μš©μž κ²½ν—˜μ„ μœ μ§€ν•˜μ„Έμš”.
  • Azure API Management μ‚¬μš© κ³ λ €: MCP μ„œλ²„μ— 직접 λ³΄μ•ˆμ„ κ΅¬ν˜„ν•˜λ©΄ μ„Έλ°€ν•œ μ œμ–΄κ°€ κ°€λŠ₯ν•˜μ§€λ§Œ, Azure API Management 같은 API κ²Œμ΄νŠΈμ›¨μ΄λŠ” 인증, κΆŒν•œ λΆ€μ—¬, μš”μ²­ μ œν•œ, λͺ¨λ‹ˆν„°λ§ λ“± λ§Žμ€ λ³΄μ•ˆ 문제λ₯Ό μžλ™μœΌλ‘œ μ²˜λ¦¬ν•΄ μ€λ‹ˆλ‹€. ν΄λΌμ΄μ–ΈνŠΈμ™€ MCP μ„œλ²„ 사이에 쀑앙 집쀑식 λ³΄μ•ˆ 계측을 μ œκ³΅ν•©λ‹ˆλ‹€. MCP와 API κ²Œμ΄νŠΈμ›¨μ΄ μ‚¬μš©μ— λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ Azure API Management Your Auth Gateway For MCP Serversλ₯Ό μ°Έκ³ ν•˜μ„Έμš”.
  • μ£Όμš” λ‚΄μš© 정리

  • MCP μ„œλ²„ λ³΄μ•ˆμ€ 데이터와 도ꡬλ₯Ό λ³΄ν˜Έν•˜λŠ” 데 맀우 μ€‘μš”ν•©λ‹ˆλ‹€.
  • Microsoft Entra IDλŠ” κ°•λ ₯ν•˜κ³  ν™•μž₯ κ°€λŠ₯ν•œ 인증 및 κΆŒν•œ λΆ€μ—¬ μ†”λ£¨μ…˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€.
  • 둜컬 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—λŠ” 곡개 ν΄λΌμ΄μ–ΈνŠΈ, 원격 μ„œλ²„μ—λŠ” λΉ„λ°€ ν΄λΌμ΄μ–ΈνŠΈλ₯Ό μ‚¬μš©ν•˜μ„Έμš”.
  • μ›Ή μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—λŠ” Authorization Code Flowκ°€ κ°€μž₯ μ•ˆμ „ν•œ μ˜΅μ…˜μž…λ‹ˆλ‹€.
  • μ—°μŠ΅ 문제

    1. μ—¬λŸ¬λΆ„μ΄ ꡬ좕할 MCP μ„œλ²„λŠ” 둜컬 μ„œλ²„μΈκ°€μš”, 원격 μ„œλ²„μΈκ°€μš”?

    2. 닡변에 따라 곡개 ν΄λΌμ΄μ–ΈνŠΈ λ˜λŠ” λΉ„λ°€ ν΄λΌμ΄μ–ΈνŠΈλ₯Ό μ‚¬μš©ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?

    3. Microsoft Graph에 λŒ€ν•΄ μž‘μ—…μ„ μˆ˜ν–‰ν•˜κΈ° μœ„ν•΄ MCP μ„œλ²„κ°€ μš”μ²­ν•  κΆŒν•œμ€ λ¬΄μ—‡μΈκ°€μš”?

    μ‹€μŠ΅ 과제

    μ—°μŠ΅ 1: Entra ID에 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ λ“±λ‘ν•˜κΈ°

    Microsoft Entra ν¬ν„Έλ‘œ μ΄λ™ν•˜μ„Έμš”.

    MCP μ„œλ²„μš© μƒˆ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ λ“±λ‘ν•˜μ„Έμš”.

    μ• ν”Œλ¦¬μΌ€μ΄μ…˜(ν΄λΌμ΄μ–ΈνŠΈ) ID와 디렉터리(ν…Œλ„ŒνŠΈ) IDλ₯Ό κΈ°λ‘ν•˜μ„Έμš”.

    μ—°μŠ΅ 2: 둜컬 MCP μ„œλ²„ λ³΄μ•ˆ μ„€μ • (곡개 ν΄λΌμ΄μ–ΈνŠΈ)

  • MSAL(Microsoft Authentication Library)을 ν†΅ν•©ν•˜μ—¬ μ‚¬μš©μž 인증을 κ΅¬ν˜„ν•˜λŠ” μ½”λ“œ 예제λ₯Ό λ”°λΌν•˜μ„Έμš”.
  • Microsoft Graphμ—μ„œ μ‚¬μš©μž μ„ΈλΆ€ 정보λ₯Ό κ°€μ Έμ˜€λŠ” MCP 도ꡬλ₯Ό ν˜ΈμΆœν•˜μ—¬ 인증 흐름을 ν…ŒμŠ€νŠΈν•˜μ„Έμš”.
  • μ—°μŠ΅ 3: 원격 MCP μ„œλ²„ λ³΄μ•ˆ μ„€μ • (λΉ„λ°€ ν΄λΌμ΄μ–ΈνŠΈ)

  • Entra ID에 λΉ„λ°€ ν΄λΌμ΄μ–ΈνŠΈλ₯Ό λ“±λ‘ν•˜κ³  ν΄λΌμ΄μ–ΈνŠΈ μ‹œν¬λ¦Ώμ„ μƒμ„±ν•˜μ„Έμš”.
  • Express.js MCP μ„œλ²„λ₯Ό Authorization Code Flowλ₯Ό μ‚¬μš©ν•˜λ„λ‘ κ΅¬μ„±ν•˜μ„Έμš”.
  • 보호된 μ—”λ“œν¬μΈνŠΈλ₯Ό ν…ŒμŠ€νŠΈν•˜κ³  토큰 기반 접근을 ν™•μΈν•˜μ„Έμš”.
  • μ—°μŠ΅ 4: λ³΄μ•ˆ λͺ¨λ²” 사둀 μ μš©ν•˜κΈ°

  • 둜컬 λ˜λŠ” 원격 μ„œλ²„μ— HTTPSλ₯Ό ν™œμ„±ν™”ν•˜μ„Έμš”.
  • μ„œλ²„ λ‘œμ§μ— μ—­ν•  기반 μ ‘κ·Ό μ œμ–΄(RBAC)λ₯Ό κ΅¬ν˜„ν•˜μ„Έμš”.
  • 토큰 만료 처리 및 μ•ˆμ „ν•œ 토큰 μ €μž₯을 μΆ”κ°€ν•˜μ„Έμš”.
  • μ°Έκ³  자료

    1. MSAL κ°œμš” λ¬Έμ„œ

    Microsoft Authentication Library(MSAL)κ°€ ν”Œλž«νΌ μ „λ°˜μ—μ„œ μ•ˆμ „ν•œ 토큰 νšλ“μ„ μ–΄λ–»κ²Œ μ§€μ›ν•˜λŠ”μ§€ μ•Œμ•„λ³΄μ„Έμš”:

    MSAL Overview on Microsoft Learn

    2. Azure-Samples/mcp-auth-servers GitHub μ €μž₯μ†Œ

    인증 흐름을 λ³΄μ—¬μ£ΌλŠ” MCP μ„œλ²„ μ°Έμ‘° κ΅¬ν˜„ 예제:

    Azure-Samples/mcp-auth-servers on GitHub

    3. Azure λ¦¬μ†ŒμŠ€μš© 관리 ID κ°œμš”

    μ‹œμŠ€ν…œ λ˜λŠ” μ‚¬μš©μž ν• λ‹Ή 관리 IDλ₯Ό μ‚¬μš©ν•΄ λΉ„λ°€ 정보λ₯Ό μ œκ±°ν•˜λŠ” 방법을 μ΄ν•΄ν•˜μ„Έμš”:

    Managed Identities Overview on Microsoft Learn

    4. Azure API Management: MCP μ„œλ²„μš© 인증 κ²Œμ΄νŠΈμ›¨μ΄

    MCP μ„œλ²„λ₯Ό μœ„ν•œ μ•ˆμ „ν•œ OAuth2 κ²Œμ΄νŠΈμ›¨μ΄λ‘œ APIM을 μ‚¬μš©ν•˜λŠ” 방법 심측 뢄석:

    Azure API Management Your Auth Gateway For MCP Servers

    5. Microsoft Graph κΆŒν•œ μ°Έμ‘°

    Microsoft Graph에 λŒ€ν•œ μœ„μž„ 및 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ κΆŒν•œμ˜ 포괄적 λͺ©λ‘:

    Microsoft Graph Permissions Reference

    ν•™μŠ΅ λͺ©ν‘œ

    이 μ„Ήμ…˜μ„ μ™„λ£Œν•˜λ©΄ λ‹€μŒμ„ ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

  • MCP μ„œλ²„μ™€ AI μ›Œν¬ν”Œλ‘œμš°μ—μ„œ 인증이 μ™œ μ€‘μš”ν•œμ§€ μ„€λͺ…ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • 둜컬 및 원격 MCP μ„œλ²„ μ‹œλ‚˜λ¦¬μ˜€μ— 맞게 Entra ID 인증을 μ„€μ •ν•˜κ³  ꡬ성할 수 μžˆμŠ΅λ‹ˆλ‹€.
  • μ„œλ²„ 배포 μœ ν˜•μ— 따라 μ μ ˆν•œ ν΄λΌμ΄μ–ΈνŠΈ μœ ν˜•(곡개 λ˜λŠ” λΉ„λ°€)을 선택할 수 μžˆμŠ΅λ‹ˆλ‹€.
  • 토큰 μ €μž₯ 및 μ—­ν•  기반 κΆŒν•œ λΆ€μ—¬λ₯Ό ν¬ν•¨ν•œ μ•ˆμ „ν•œ μ½”λ”© 관행을 κ΅¬ν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • MCP μ„œλ²„μ™€ 도ꡬλ₯Ό 무단 μ ‘κ·ΌμœΌλ‘œλΆ€ν„° μžμ‹  있게 λ³΄ν˜Έν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • λ‹€μŒ 단계

  • 5.13 Model Context Protocol (MCP) Integration with Azure AI Foundry
  • λ©΄μ±… μ‘°ν•­:

    이 λ¬Έμ„œλŠ” AI λ²ˆμ—­ μ„œλΉ„μŠ€ Co-op Translatorλ₯Ό μ‚¬μš©ν•˜μ—¬ λ²ˆμ—­λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

    정확성을 μœ„ν•΄ μ΅œμ„ μ„ λ‹€ν•˜κ³  μžˆμœΌλ‚˜, μžλ™ λ²ˆμ—­μ—λŠ” 였λ₯˜λ‚˜ λΆ€μ •ν™•ν•œ 뢀뢄이 μžˆμ„ 수 μžˆμŒμ„ μœ μ˜ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

    원문은 ν•΄λ‹Ή μ–Έμ–΄μ˜ 원본 λ¬Έμ„œκ°€ κΆŒμœ„ μžˆλŠ” 좜처둜 κ°„μ£Όλ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

    μ€‘μš”ν•œ μ •λ³΄μ˜ 경우 전문적인 인간 λ²ˆμ—­μ„ ꢌμž₯ν•©λ‹ˆλ‹€.

    λ³Έ λ²ˆμ—­ μ‚¬μš©μœΌλ‘œ 인해 λ°œμƒν•˜λŠ” μ˜€ν•΄λ‚˜ 잘λͺ»λœ 해석에 λŒ€ν•΄ λ‹Ήμ‚¬λŠ” μ±…μž„μ„ μ§€μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

    MCP Academy — microsoft/mcp-for-beginners