1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure Logic Apps で MCP Server を作ってみた

1
Last updated at Posted at 2026-04-15

本記事では、Azure Logic Apps (Standard) を使って MCP Server を構築し、GitHub Copilot Chat / Microsoft Foundry から実際に呼び出せるかを検証しました。2026年4月現在、Previewなので注意しましょう。
検証の目的は以下です。

  • Logic Apps で MCP Server が本当に構築できるのか
  • MCP Server に登録した Tool を Copilot から呼び出せるのか
  • Key ベース認証や実行ログの挙動を確認する

以下の情報を参考に実施。

公式ページ内の絵。
image.png

SharePointのListにアイテム作成する記事はこちら。

全体構成

今回の構成は非常にシンプルです。

  • Azure Logic Apps (Standard)
    • MCP Server 機能(Preview)
    • Office 365 Outlook コネクタ
  • GitHub Copilot Chat
    • Configure Tools から MCP Server を登録
    • Copilot 上で自然言語により実行
  • Microsoft Foundry
    • Microsoft Foundry Agent Service の Prompt Agent 作成
    • Agent に Tool として Custom MCP

ポイントは Logic Apps を「MCP Server」として登録する点です。
これにより、Logic Apps の Workflow が Copilot から直接呼び出せる Tool になります

前提

Aure Logic Apps

今回はMCPサーバ作成の前提となっているStandardで、手軽なWFサービスプランを使用。
image.png

Microsoft Foundry

特に前提ないですが、リソース作成し、Agent用のモデルデプロイ済

Steps

1. MCP Server登録

ワークフロー -> MCP servers から 「+ Create new workflows」を選択
image.png

Project detailsを入力し、ToolsのConnectorsで「+Add」クリック
image.png

Office 365 Outlookを選択
image.png

メールの送信(V2)のみを選択
image.png

その後に接続ユーザ Sing In して保存。
Toolが登録される。下の方にあるRegisterボタンをクリック
image.png

今回は、Keyベースの認証。Generate Keyボタンをクリック
image.png

24hだけ有効なKeyを発行。後で使うのでコピーしておきます。
image.png

こんなワークフローが登録されました。
image.png

Workflow Codeview
{
    "definition": {
        "$schema": "https://schema.management.azure.com/schemas/2016-06-01/workflowdefinition.json#",
        "contentVersion": "1.0.0",
        "actions": {
            "SendEmailV2": {
                "type": "ApiConnection",
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "office365"
                        }
                    },
                    "method": "post",
                    "body": {
                        "To": "@triggerBody()['To']",
                        "Subject": "@triggerBody()['Subject']",
                        "Body": "@triggerBody()['Body']",
                        "Sensitivity": "@triggerBody()?['Sensitivity']"
                    },
                    "path": "/v2/Mail"
                },
                "runAfter": {}
            },
            "Response": {
                "type": "Response",
                "inputs": {
                    "statusCode": 200,
                    "body": "@body('SendEmailV2')"
                },
                "runAfter": {
                    "SendEmailV2": [
                        "Succeeded",
                        "Failed",
                        "TimedOut"
                    ]
                }
            }
        },
        "triggers": {
            "Request": {
                "type": "Request",
                "description": "この操作では、メール メッセージを送信します。",
                "kind": "Http",
                "inputs": {
                    "schema": {
                        "type": "object",
                        "required": [
                            "To",
                            "Subject",
                            "Body"
                        ],
                        "properties": {
                            "To": {
                                "format": "email",
                                "description": "someone@contoso.com のようなメール アドレスをセミコロンで区切って指定します",
                                "type": "string",
                                "title": "宛先"
                            },
                            "Subject": {
                                "description": "メールの件名を指定します",
                                "type": "string",
                                "title": "件名"
                            },
                            "Body": {
                                "format": "html",
                                "description": "メールの本文を指定します",
                                "type": "string",
                                "title": "本文"
                            },
                            "Sensitivity": {
                                "description": "機密度",
                                "type": "string",
                                "title": "機密度"
                            }
                        }
                    }
                }
            }
        }
    },
    "kind": "Stateful"
}

2. GitHub Copilot Chatから呼出

2.1. MCP Setup

Logic Appsの画面「Copy URL」をクリックしてでURLをコピー。
image.png

VS Code でコマンドパレットから

  1. MCP: Add Server を選択し、
  2. HTTP(HTTP or Server-Sent Events)選択
  3. コピーしておいたMCP ServerのURLを入力
  4. Workspace を選択(今回限りにしたいので)

以下のような感じになります(headers以下はKeyを手で追加)。

mcp.json
{
    "servers": {
        "my-mcp-server2-key-auth": {
            "url": "https://<resource>.northcentralus-01.azurewebsites.net/api/mcpservers/<mcp server name>/mcp",
            "type": "http",
            "headers": {
                "X-API-KEY": "<Generated Key>"
            }
        }
    },
    "inputs": []
}

「Start」部分をクリック
image.png

OUTPUTに以下のようなログが出ます。

OUTPUT
2026-04-15 16:37:25.414 [info] Starting server my-mcp-server2-key-auth
2026-04-15 16:37:25.415 [info] Connection state: Starting
2026-04-15 16:37:25.415 [info] Starting server from Remote extension host
2026-04-15 16:37:25.424 [info] Connection state: Running
2026-04-15 16:37:26.490 [info] Discovered 1 tools

2.2. GitHub Copilot Chat で実行

GitHub Copilot Chatの Configure Tools で見えることを確認
image.png

GitHub Copilot Chatで以下のプロンプト(xxxは異なる)
image.png

結果
image.png

メールが届いています。
image.png

ログも正常に残っています。
image.png

3. Microsoft Foundry

Agent から ツールを追加(詳細省略)
image.png

ツール情報入力
image.png

Playgroundで成功。
image.png

OAuth認証

Keyベースではなく、OAuthの認証設定に関するメモも加えておきます。

アプリ登録

「アプリの登録を作成する」のステップを実行して、アプリ登録

Easy Auth 設定

「MCP サーバーに対して Easy Auth を設定する」のステップを実行。とにかく緩い条件にしています。
未検証ですが、クライアントアプリケーションの要件に「特定のクライアント アプリケーションからの要求を許可する」にして、対象絞って、そのアプリケーションをEntraで登録することで、よりSecureにできるかと考えています。
image.png

MCP Server 認証設定

「認証を選択して MCP サーバーを確認する」のステップでOAuthを選択

VS Code

VS Code でコマンドパレットから

  1. MCP: Add Server を選択し、
  2. HTTP(HTTP or Server-Sent Events)選択
  3. コピーしておいたMCP ServerのURLを入力
  4. Workspace を選択(今回限りにしたいので)
mcp.json
{
	"servers": {
		"my-mcp-server-0b73e929": {
			"url": "https://<resource>.canadacentral-01.azurewebsites.net/api/mcpservers/<mcp server name>/mcp",
			"type": "http"
		}
	},
	"inputs": []
}

あとはStartするとポップアップで認証画面が起動し、認証実施。以下のようにエラー(複数の well-known URL パターンを順番に試した結果、最初の候補が外れただけっぽい)は出ていますが、最終的にToolの検知に成功。あとは、Key認証時と同じ。

OUTPUT
2026-04-16 22:35:48.126 [info] Starting server my-mcp-server-0b73e929
2026-04-16 22:35:48.127 [info] Connection state: Starting
2026-04-16 22:35:48.127 [info] Starting server from Remote extension host
2026-04-16 22:35:48.138 [info] Connection state: Running
2026-04-16 22:35:49.789 [info] Discovered resource metadata at https://.azurewebsites.net/api/mcpservers/list/.well-known/oauth-protected-resource
2026-04-16 22:35:49.789 [info] Using auth server metadata url: https://login.microsoftonline.com/***mask***/v2.0
2026-04-16 22:35:50.197 [warning] Error fetching authorization server metadata: Error: Failed to fetch authorization server metadata from https://login.microsoftonline.com/.well-known/oauth-authorization-server/***mask***/v2.0: 404 
2026-04-16 22:35:50.198 [warning] Error fetching authorization server metadata: Error: Failed to fetch authorization server metadata from https://login.microsoftonline.com/.well-known/openid-configuration/***mask***/v2.0: 404 
2026-04-16 22:35:50.198 [info] Discovered authorization server metadata at https://login.microsoftonline.com/***mask***/v2.0/.well-known/openid-configuration
2026-04-16 22:35:51.464 [info] Discovered 1 tools
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?