Azure MCP 伺服器讓您能管理 Microsoft Foundry 擴充資源,包括建立聊天與文字補全、產生嵌入、列出模型,以及使用自然語言提示的知識索引。
Microsoft Foundry 是一個用於部署和管理自訂 AI 模型的平台,Azure。 它提供工具和服務,用於在生產環境中定型、微調、部署和監視 AI 模型。
知識索引命令需要您的 Microsoft Foundry 專案端點。 OpenAI 指令需要資源名稱和資源群組。 資源 get 指令可以在不提供資源名稱的情況下列出資源。
Note
Tool 參數:Azure MCP 伺服器工具為完成任務所需的資料定義參數。 這些參數中有些是針對每種工具而定,並在此處有詳細說明。 其他參數是全局參數,並由所有工具共用。 如需詳細資訊,請參閱 工具參數。
知識:列出知識索引
從 Foundry 獲取知識索引清單:
- 尋找在 Foundry 專案中建立的知識索引。
- 將這些索引與 AI 代理程式搭配使用,以進行知識擷取和 RAG 應用程式。
- 清單會在您建立新索引或更新現有索引時更新。
範例 CLI 指令
azmcp foundryextensions knowledge index list \
--endpoint <endpoint>
| Parameter |
類型 |
Required |
Description |
endpoint |
字串 |
Yes |
Microsoft Foundry 專案或服務的端點網址。 端點遵循以下模式: https://<foundry-resource-name>.services.ai.azure.com/api/projects/<project-name>。 |
範例提示包括:
-
查看所有索引:「在端
https://my-example-resource.services.ai.azure.com/api/projects/my-project點顯示所有知識索引」
-
依專案篩選:「在端
https://my-example-resource.services.ai.azure.com/api/projects/support-bot點列出知識索引」
-
依名稱搜尋:「尋找端點
https://my-example-resource.services.ai.azure.com/api/projects/my-project所命名product-faqs的知識索引」
-
以標籤篩選:「列出端點
security 中帶有 https://my-example-resource.services.ai.azure.com/api/projects/my-project 標籤的知識索引」
-
顯示索引細節:「在端
https://my-example-resource.services.ai.azure.com/api/projects/my-project點顯示知識索引的詳細資訊customer-service」
| Parameter |
必要或選用 |
Description |
|
端點 |
Required |
Microsoft Foundry 專案或服務的端點網址。 端點遵循以下模式: https://<foundry-resource-name>.services.ai.azure.com/api/projects/<project-name>。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
✅ |
❌ |
✅ |
❌ |
❌ |
知識:取得索引結構描述
從 Foundry 取得特定知識索引的詳細架構配置。
此作業會顯示有關知識索引結構和設定的完整資訊,包括欄位定義、資料類型、可搜尋屬性和其他結構描述屬性。 使用此結構描述資訊來瞭解索引如何建構和索引您的資料以進行搜尋。
範例 CLI 指令
azmcp foundryextensions knowledge index schema \
--index <index> \
--endpoint <endpoint>
| Parameter |
類型 |
Required |
Description |
index |
字串 |
Yes |
知識索引的名稱。 |
endpoint |
字串 |
Yes |
Microsoft Foundry 專案或服務的端點網址。 端點遵循以下模式: https://<foundry-resource-name>.services.ai.azure.com/api/projects/<project-name>。 |
範例提示包括:
-
檢視索引架構:「在端
https://my-example-resource.services.ai.azure.com/api/projects/my-project點顯示知識索引product-facts的架構」
| Parameter |
必要或選用 |
Description |
|
指數 |
Required |
知識索引的名稱。 |
|
端點 |
Required |
Microsoft Foundry 專案或服務的端點網址。 端點遵循以下模式: https://<foundry-resource-name>.services.ai.azure.com/api/projects/<project-name>。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
✅ |
❌ |
✅ |
❌ |
❌ |
OpenAI:生成聊天結果
在 Foundry 中使用 Azure OpenAI 建立聊天補全。 將訊息發送到 Foundry 資源中部署的 Azure OpenAI 聊天模型,並接收 AI 生成的對話回應。 支持具有消息歷史記錄、系統指令和響應自定義的多輪對話。
範例 CLI 指令
azmcp foundryextensions openai chat-completions-create \
--resource-name <resource-name> \
--deployment <deployment> \
--message-array <message-array> \
--resource-group <resource-group> \
[--max-tokens <max-tokens>] \
[--temperature <temperature>] \
[--top-p <top-p>] \
[--frequency-penalty <frequency-penalty>] \
[--presence-penalty <presence-penalty>] \
[--stop <stop>] \
[--stream <TRUE|FALSE>] \
[--seed <seed>] \
[--user <user>]
| Parameter |
類型 |
Required |
Description |
resource-name |
字串 |
Yes |
Microsoft Foundry 資源的名稱。 |
deployment |
字串 |
Yes |
部署的名稱。 |
message-array |
字串 |
Yes |
對話中訊息的 JSON 陣列。 每則訊息都應該具有 role 和 content 屬性。 |
resource-group |
字串 |
Yes |
Azure 資源群組名稱。 |
max-tokens |
整數 |
No |
完成時生成標記的最大數量。 |
temperature |
number |
No |
控制輸出中的隨機性。 較低的值使其更具確定性。 |
top-p |
number |
No |
通過細胞核採樣(0.0 至 1.0)控制多樣性。 預設是 1.0。 |
frequency-penalty |
number |
No |
根據其頻率(-2.0 至 2.0)懲罰新代幣。 預設值為 0。 |
presence-penalty |
number |
No |
基於出現頻率(-2.0 到 2.0)對新標記進行懲罰。 預設值為 0。 |
stop |
字串 |
No |
最多 4 個序列,API 將在每個序列中停止產生更多的令牌。 |
stream |
boolean |
No |
是否要串流回部分進度。 預設值為 false。 若開關未包含值,則預設為 true。 |
seed |
整數 |
No |
若有指定,系統會盡力以確定性方式取樣。 |
user |
字串 |
No |
用於追蹤與濫用監控的使用者識別碼。 |
範例提示包括:
-
簡單問候:「使用訊息陣列
gpt-35-turbo,並在資源 [{"role":"user","content":"Hello, how are you today?"}] 上使用部署 openai-prod 建立聊天完成」
-
使用系統訊息:「在資源
Explain quantum computing上使用部署You are a helpful assistant,建立包含系統訊息openai-west和使用者訊息gpt-35-turbo的聊天完成項目」
-
控制創意:「在使用
gpt-4部署時產生一個對話完成Write a creative story,條件是溫度 0.8,資源上最多 150 個代幣ai-central」
-
確定性回應:「在資源
ai-services-prod 上,使用部署 List 5 facts about Mars 和訊息 gpt-35-turbo 建立聊天完成項目,溫度設為 0.1,seed 為 12345」
-
與歷史對話:「繼續聊天完成訊息:系統
You are a coding assistant、使用者How do I create a function in Python?、助理Here's how...、使用者Can you show an example?在資源dev-openai部署gpt-4中」
-
含重複懲罰:「在資源
ai-services-main 上,使用部署 Describe the benefits of cloud computing 為 gpt-35-turbo 建立完成內容,頻率懲罰為 0.5,存在懲罰為 0.3」
-
串流回應:「在資源
Explain machine learning step by step上使用部署gpt-4並將 stream=true,為openai-research產生串流聊天完成回應」
-
使用停止序列:「使用部署
gpt-35-turbo 在資源 ai-test 上為 Count from 1 to 10 建立完成,並使用停止序列 ['5', 'STOP']」
-
使用者追蹤:「在資源
prod-openai上使用使用者識別碼user-123的部署gpt-4產生完成What is Azure AI?」
-
精細調整控制:「為
Summarize this article 建立聊天完成,使用部署 gpt-35-turbo,temperature 為 0.2、top_p 為 0.9、最大權杖數為 200,並在資源 secure-ai 上使用 AAD 驗證」
| Parameter |
必要或選用 |
Description |
|
資源名稱 |
Required |
Microsoft Foundry 資源的名稱。 |
|
Deployment |
Required |
Foundry 模型部署的名稱。 |
|
訊息陣列 |
Required |
對話中訊息的 JSON 陣列。 每則訊息都應該具有 role 和 content 屬性。 |
|
資源群組 |
Required |
Azure 資源群組名稱。 |
|
最大代幣 |
Optional |
完成時生成標記的最大數量。 |
|
溫度 |
Optional |
控制輸出中的隨機性。 較低的值使其更具確定性。 |
|
頂部p |
Optional |
通過細胞核採樣(0.0 至 1.0)控制多樣性。 預設值為 1.0。 |
|
頻率懲罰 |
Optional |
根據其頻率(-2.0 至 2.0)懲罰新代幣。 預設值為 0。 |
|
存在懲罰 |
Optional |
基於出現頻率(-2.0 到 2.0)對新標記進行懲罰。 預設值為 0。 |
|
停止 |
Optional |
API 會停止產生更多權杖的這種序列,最多 4 個。 |
|
Stream |
Optional |
是否要串流回部分進度。 預設值為 false。 |
|
種子 |
Optional |
如果指定,系統會盡最大努力以決定性方式取樣。 |
|
使用者 |
Optional |
用於追蹤與濫用監控的使用者識別碼。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
❌ |
❌ |
✅ |
❌ |
❌ |
OpenAI:建立內嵌
使用 Azure OpenAI 在 Foundry 中建立嵌入。 在 Foundry 資源中使用 Azure OpenAI 部署,從文字產生向量嵌入,用於語意搜尋、相似性比較、分群或機器學習。
範例 CLI 指令
azmcp foundryextensions openai embeddings-create \
--resource-name <resource-name> \
--deployment <deployment> \
--input-text <input-text> \
--resource-group <resource-group> \
[--user <user>] \
[--encoding-format <encoding-format>] \
[--dimensions <dimensions>]
| Parameter |
類型 |
Required |
Description |
resource-name |
字串 |
Yes |
Microsoft Foundry 資源的名稱。 |
deployment |
字串 |
Yes |
部署的名稱。 |
input-text |
字串 |
Yes |
要生成嵌入的輸入文本。 |
resource-group |
字串 |
Yes |
Azure 資源群組名稱。 |
user |
字串 |
No |
用於追蹤與濫用監控的使用者識別碼。 |
encoding-format |
字串 |
No |
回傳嵌入的格式(float 或 base64)。 |
dimensions |
整數 |
No |
內嵌輸出的維度數目。 僅在某些型號中支援。 |
範例提示包括:
-
基本文字嵌入:「使用我在資源群組
Azure OpenAI 服務 中的 my-resource-group 部署,為文字 text-embedding-ada-002 產生嵌入。」
-
建立向量嵌入:「使用 Azure OpenAI 並部署
text-embedding-3-large資源組中的my-resource-group資源ai-services-prod,為我的文本建立向量嵌入。」
-
文件嵌入:「使用資源群組
Machine learning revolutionizes data analysis 中資源 embedding-service 上的部署 ada-002,為 my-resource-group 產生嵌入。」
-
多個句子:「使用我在資源群組
Cloud computing provides scalable infrastructure. It enables global accessibility.中的嵌入部署,為文字my-resource-group建立嵌入。」
-
使用者追蹤:「在資源群組
Natural language processing applications 中,使用部署 my-resource-group 與使用者識別碼 analytics-team,為 text-embedding-3-small 產生嵌入向量。」
-
具體維度:「在資源群組
Artificial intelligence transforms business operations 的資源 text-embedding-3-large 中,使用 1536 維度的部署 ai-central 為 my-resource-group 建立嵌入。」
-
Base64 格式:「使用資源群組
Deep learning neural networks 中資源 ada-002 上的部署 ml-services,以 Base64 編碼格式為 my-resource-group 產生嵌入。」
-
研究文字:「使用我在資源群組
Quantum computing demonstrates computational advantages in specific algorithms 中的文字嵌入部署,為 my-resource-group 建立向量嵌入。」
-
產品描述:「使用資源群組
High-performance laptop with advanced graphics processing unit 中資源 product-ai 上的部署 text-embedding-3-small,為 my-resource-group 產生嵌入。」
-
技術文件:「在資源群組
API authentication requires valid credentials and proper authorization headers 的資源 ada-002 上,使用採用浮點編碼的部署 docs-embedding,為 my-resource-group 建立嵌入。」
| Parameter |
必要或選用 |
Description |
|
資源名稱 |
Required |
Microsoft Foundry 資源的名稱。 |
|
Deployment |
Required |
Foundry 模型部署的名稱。 |
|
輸入文字 |
Required |
要生成嵌入的輸入文本。 |
|
資源群組 |
Required |
Azure 資源群組名稱。 |
|
使用者 |
Optional |
用於追蹤與濫用監控的使用者識別碼。 |
|
編碼格式 |
Optional |
嵌入格式的返回形式為 float 或 base64。 |
|
維度 |
Optional |
內嵌輸出的維度數目。 僅在某些型號中支援。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
❌ |
❌ |
✅ |
❌ |
❌ |
OpenAI:建立完成
在 Foundry 中使用 Azure OpenAI 來建立文字補全。 將提示或問題寄送給部署在 Foundry 資源中的 Azure OpenAI 模型,並獲得生成的文字回答。 當你需要建立完成內容、取得 AI 生成內容、生成問題答案,或根據任何輸入提示從 Azure OpenAI 生成文字補全時,請使用此功能。 支持使用溫度和最大令牌進行自定義。
範例 CLI 指令
azmcp foundryextensions openai create-completion \
--deployment <deployment> \
--prompt-text <prompt-text> \
--resource-name <resource-name> \
--resource-group <resource-group> \
[--max-tokens <max-tokens>] \
[--temperature <temperature>]
| Parameter |
類型 |
Required |
Description |
deployment |
字串 |
Yes |
部署的名稱。 |
prompt-text |
字串 |
Yes |
要傳送至完成模型的提示文字。 |
resource-name |
字串 |
Yes |
Microsoft Foundry 資源的名稱。 |
resource-group |
字串 |
Yes |
Azure 資源群組名稱。 |
max-tokens |
整數 |
No |
完成時生成標記的最大數量。 |
temperature |
number |
No |
控制輸出中的隨機性。 較低的值使其更具確定性。 |
範例提示包括:
-
基本補全:「使用我在資源群組
What is Azure? 中的 my-resource-group 部署,根據提示 gpt-35-turbo 建立補全」
-
使用溫度控制功能:「在資源群組
text-davinci-003 中,使用部署 my-resource-group 以 0.3 的溫度為 Explain machine learning 產生文字補全」
-
有限代幣:「用我的
gpt-4部署創建一個有提示Write a summary的完成,資源組my-resource-group最多有 100 個代幣」
-
創意寫作:「使用部署
gpt-35-turbo,將溫度設為 0.8、最大權杖數設為 200,並在資源群組 Tell me a story about AI 中為 my-resource-group 產生完成內容」
-
技術說明:「使用 OpenAI 資源
ai-services-east並gpt-4部署於資源群組my-resource-group中,建立帶有提示的How does cloud computing work?完成」
| Parameter |
必要或選用 |
Description |
|
Deployment |
Required |
部署的名稱。 |
|
提示文字 |
Required |
要傳送至完成模型的提示文字。 |
|
資源名稱 |
Required |
Microsoft Foundry 資源的名稱。 |
|
資源群組 |
Required |
Azure 資源群組名稱。 |
|
最大代幣 |
Optional |
完成時生成標記的最大數量。 |
|
溫度 |
Optional |
控制輸出中的隨機性。 較低的值使其更具確定性。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
❌ |
❌ |
✅ |
❌ |
❌ |
OpenAI:列出模型和部署
列出 Microsoft Foundry 資源中的 Azure OpenAI 模型部署。 此工具會擷取已部署模型的相關資訊,包括模型名稱、版本、功能和部署狀態。
範例 CLI 指令
azmcp foundryextensions openai models-list \
--resource-name <resource-name> \
--resource-group <resource-group>
| Parameter |
類型 |
Required |
Description |
resource-name |
字串 |
Yes |
Microsoft Foundry 資源的名稱。 |
resource-group |
字串 |
Yes |
Azure 資源群組名稱。 |
範例提示包括:
-
查看所有模型:「在資源
ai-services-prod 群組 my-resource-group中列出所有已部署的 OpenAI 模型。」
-
檢查部署:「顯示資源群組
openai-east 中資源 my-resource-group 的所有已部署模型及其狀態。」
-
生產庫存:「在我的
production-openai 資源群組 my-resource-group中部署了哪些模型?」
-
開發檢查:「列出位於資源群組
my-resource-group 中我的 dev-ai-services 資源內的所有模型部署。」
-
模型能力:「顯示所有已部署的 OpenAI 模型及其資源群中
ai-centralmy-resource-group的能力。」
-
部署狀態:「資源
openai-west 群組 my-resource-group中我資源中所有部署的目前狀態如何?」
-
區域模型:「在資源群組中列出所有已部署於我的
europe-openai 資源中的 my-resource-group模型。」
-
服務概述:「請給我資源群組
my-resource-group中資源部署customer-ai的完整模型概覽。」
-
模型版本:「在資源群組
my-resource-group中顯示我資源中所有已部署的模型版本ai-services-main。」
-
資源稽核:「我需要稽核資源群組
my-resource-group裡所有 OpenAI 模型的部署enterprise-ai。」
| Parameter |
必要或選用 |
Description |
|
資源名稱 |
Required |
Microsoft Foundry 資源的名稱。 |
|
資源群組 |
Required |
Azure 資源群組名稱。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
✅ |
❌ |
✅ |
❌ |
❌ |
資源:取得 Foundry 資源
列出或取得 Microsoft Foundry 資源,並回傳資源層級細節,如端點 URL、位置、SKU、種類及配置狀態。 如果你提供資源名稱,工具會回傳那個單一資源。 否則,它會回傳資源庫存的範圍。 在 Foundry 資源中部署模型庫存時,請使用 OpenAI 模型清單工具。
範例 CLI 指令
azmcp foundryextensions resource get \
[--resource-name <resource-name>]
| Parameter |
類型 |
Required |
Description |
resource-name |
字串 |
No |
Microsoft Foundry 資源的名稱。 |
範例提示包括:
-
取得特定資源:「顯示 Foundry 資源的詳細資訊
ai-foundry-prod 」
-
列出所有資源:「我的訂閱裡有哪些 Foundry 資源?」
-
含有設定的資源:「取得我的
customer-ai-foundry Foundry 資源的端點 URL、位置及 SKU 資訊」
| Parameter |
必要或選用 |
Description |
|
資源名稱 |
Optional |
Microsoft Foundry 資源的名稱。 |
工具註解提示:
| 破壞性 |
冪等 |
開放世界 |
唯讀 |
Secret |
本地必修 |
| ❌ |
✅ |
❌ |
✅ |
❌ |
❌ |
相關內容