satodayo/azure-functions-mcp-server-sample
3.2
If you are the rightful owner of azure-functions-mcp-server-sample and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project demonstrates the implementation of a Model Context Protocol (MCP) server using Azure Functions (.NET 8).
Tools
1
Resources
0
Prompts
0
Azure Functions MCP Server (.NET)
Azure Functions (.NET 8) を使った Model Context Protocol (MCP) サーバーの実装例です。
概要
このプロジェクトは、Azure Functions の MCP 拡張機能を使用して、Tour de Azure のタイトル情報を取得する MCP ツールを提供します。
必要な環境
- .NET 8.0 SDK
- Azure Functions Core Tools
- Docker & Docker Compose (Dev Container使用時)
セットアップ
Dev Container を使用する場合
- このリポジトリをクローン
- VS Code で開く
- "Reopen in Container" を選択
Dev Container が起動すると、自動的に以下が実行されます:
- 必要な拡張機能のインストール
- NuGet パッケージの復元 (
dotnet restore)
ローカル環境で実行する場合
local.settings.jsonファイルを作成します:
cd mcp-server
local.settings.json を以下の内容で作成:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}
- プロジェクトをビルドして実行:
dotnet restore
dotnet build
func start
プロジェクト構成
azure-functions-dotnet/
├── .devcontainer/ # Dev Container設定
├── .vscode/ # VS Code設定(tasks, launch)
├── mcp-server/ # Azure Functions プロジェクト
│ ├── Program.cs # アプリケーションエントリポイント
│ ├── TourDeAzureTrigger.cs # MCP ツール実装
│ ├── mcp-server.csproj # プロジェクトファイル
│ ├── host.json # Functions ホスト設定
│ └── local.settings.json # ローカル開発設定(要作成)
└── README.md
使用しているパッケージ
Microsoft.Azure.Functions.Worker(v2.1.0)Microsoft.Azure.Functions.Worker.Extensions.Mcp(v1.0.0)Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore(v2.1.0)Microsoft.ApplicationInsights.WorkerService(v2.23.0)
MCP ツール
get_tour_de_azure_title
Tour de Azure の各回のタイトルを取得します。
パラメータ:
edition(int, required): 回数(1, 2, 3...)
使用例:
{
"edition": 1
}
レスポンス:
AI Document Intelligenceに入門しよう!
開発
ビルド
cd mcp-server
dotnet build
ローカル実行
cd mcp-server
func start
注意: 初回実行時は local.settings.json ファイルが必要です。上記のセットアップセクションを参照してください。
ローカルストレージエミュレータ(Azurite)が自動的に起動します:
- Blob: http://localhost:10000
- Queue: http://localhost:10001
- Table: http://localhost:10002
デバッグ
VS Code のデバッグ機能を使用:
- F5 キーを押す
- または、デバッグビューから "Attach to .NET Functions" を選択
ライセンス
このプロジェクトはサンプルコードです。