Token导航 LogoToken导航TokenDH.com
Foundry Agents MCP Server logo
AI代理stdio官方级别未说明来源级核验

Foundry Agents MCP Server

MCP Server

一个基于MCP协议的服务器,提供Azure AI Foundry代理、工作流和AI Search向量数据库功能,支持本地和HTTP部署。

工具数

10

提示词数

0

GitHub Stars

2

资源数

0
AI代理工作流自动化PythonClaude向量搜索Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

denniszielke

提供方

denniszielke

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx --from git+https://github.com/denniszielke/foundry-agents-mcp-server@main foundry-agents-mcp-server

详细介绍

Foundry代理MCP服务器

MCP(模型上下文协议) 服务器 公开Azure AI Foundry代理、工作流和AI搜索向量数据库 作为MCP工具的功能。

支持两种传输方式:

  • 标准 –供本地使用 uvx 或VS代码副本
  • 超文本传输协议 –用于部署到 Azure容器应用 通过 azd up

存储库布局

src/
  foundry_agents_mcp/     ← MCP server (10 tools across 4 namespaces)
  foundry_agents/         ← Standalone agent & workflow implementations
    definitions/          ← Declarative YAML agent & workflow definitions
    case_study_agent.py   ← deploy-case-study-agent CLI command
    architecture_agent.py ← deploy-architecture-agent CLI command
    project_log_workflow.py ← run-project-log-workflow CLI command
infra/
  main.bicep              ← Container Apps + managed identity + role assignments
  app/server.bicep        ← Container App definition with health probes
  core/security/role.bicep
azure.yaml                ← azd service definition
Dockerfile                ← Multi-stage Alpine build
entrypoint.sh             ← Selects stdio or HTTP transport at startup
.env.sample               ← Template for local environment configuration

MCP工具命名空间

命名空间工具
agents_*列出代理·调用代理·检查状态·获取结果
search_*语义向量搜索·将文档添加到向量数据库
index_*创建项目日志索引·摄取项目日志条目
workflows_*列出示例工作流·运行项目日志管道

______________________________________________________________________

先决条件

  • Python 3.10+
  • 紫外线 安装
  • Azure AI Foundry 项目(用于代理工具)
  • Azure人工智能搜索 具有矢量层的资源(用于搜索/索引工具)
  • Azure OpenAI 部署了文本嵌入模型的资源

______________________________________________________________________

快速开始使用uvx

# Install and run directly from GitHub (no PyPI package required)
uvx --from git+https://github.com/denniszielke/foundry-agents-mcp-server@main foundry-agents-mcp-server

或者使用显式环境文件:

uvx --from git+https://github.com/denniszielke/foundry-agents-mcp-server@main --env-file .env foundry-agents-mcp-server

______________________________________________________________________

配置

所有配置都由环境变量驱动。复制 .env.sample.env 并填写你的价值观。

变量必填描述
AZURE_AI_PROJECT_ENDPOINT对于代理工具AI Foundry项目端点- `https://.services.ai.azure.com/api/projects/
`
AZURE_OPENAI_ENDPOINTOpenAI兼容端点(回退到 AZURE_AI_PROJECT_ENDPOINT)
AZURE_OPENAI_COMPLETION_MODEL_NAME对于工作流工具Foundry帐户中的完成模型部署名称
AZURE_OPENAI_EMBEDDING_MODEL对于搜索/索引工具嵌入模型部署名称(默认值: text-embedding-3-small)
AZURE_OPENAI_EMBEDDING_DIMENSIONS嵌入向量大小(默认值: 1536)
AZURE_AI_SEARCH_ENDPOINT搜索/索引工具Azure AI搜索服务端点URL
AZURE_AI_SEARCH_INDEX_NAME搜索索引名称(默认值: project-log-index)
APPLICATIONINSIGHTS_CONNECTION_STRING遥测的Application Insights连接字符串
备注 –通过部署时 azd up,所有这些值都将写入 .env 自动通过 infra/write_env.sh.用于当地开发运行 az login 和 使用 DefaultAzureCredential;不需要API密钥。

______________________________________________________________________

Claude桌面配置

将以下内容添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "foundry-agents": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/denniszielke/foundry-agents-mcp-server@main", "foundry-agents-mcp-server"],
      "env": {
        "AZURE_AI_PROJECT_ENDPOINT": "https://...",
        "AZURE_AI_SEARCH_ENDPOINT": "https://...",
        "AZURE_OPENAI_ENDPOINT": "https://..."
      }
    }
  }
}

______________________________________________________________________

工具参考和示例提示

代理命名空间

agents_list_agents

列出Foundry项目中可用的所有代理和工作流,包括其 ID、模型、描述和工具功能。

示例提示

  • *“项目中有哪些代理?”*
  • *“列出我可以调用的所有AI工作流”*
  • *“向我展示这个Foundry项目中的代理及其能力”*

______________________________________________________________________

agents_invoke_agent

异步调用代理或工作流。返回一个 调用ID 到 跟踪进度。

参数类型说明
agent_idstring来自的代理ID agents_list_agents
taskstring任务描述或问题
file_contextstring(可选)作为上下文的其他文本或文件内容

示例提示

  • *“问代理人 `` 总结最新的Azure AI公告”*
  • *“用任务调用研究工作流程:分析人工智能服务的竞争格局”*
  • *“将此文档发送给分析代理,并将文件文本作为上下文包含在内: ``"*

______________________________________________________________________

agents_get_invocation_status

检查代理调用是否仍在运行或已完成。

参数类型说明
invocation_idstring调用ID来自 agents_invoke_agent

可能的状态: queued, in_progress, requires_action, cancelling, cancelled, failed, completed, expired

示例提示

  • *“检查调用状态 ``"*
  • *“我的代理任务完成了吗?ID: ``"*
  • *“工作流是否仍在运行以供调用 ``?"*

______________________________________________________________________

agents_get_invocation_result

从已完成的调用中检索文本(和文件引用)输出。

参数类型说明
invocation_idstring调用ID来自 agents_invoke_agent

示例提示

  • *“从调用中获取结果 ``"*
  • *“代理人拿什么身份证回来了 ``?"*
  • *“显示已完成工作流的输出: ``"*

______________________________________________________________________

搜索命名空间

search_vector_db

对项目日志索引执行语义(向量)搜索。

参数类型说明
querystring自然语言搜索查询
top_kinteger(可选)结果数(默认值:5)

示例提示

  • *“查找与Azure Kubernetes服务相关的项目日志”*
  • *“搜索关于机器学习的研讨会摘要”*
  • *“哪些会议讨论了安全架构?”*
  • *“查找有关微服务的博客文章,返回前10名结果”*

______________________________________________________________________

search_add_to_vector_db

将文档添加到项目日志向量索引中。内容自动 嵌入并存储在元数据旁边。

参数类型说明
titlestring文档标题
contentstring要嵌入和索引的主文本
entry_typestring(可选)workshop, meeting, blog,或 repo (默认值: meeting)
customer_namestring(可选)客户或组织名称
short_summarystring(可选)简要概述
project_namestring(可选)关联的项目名称
tagsstring(可选)逗号分隔的标签(例如。 "azure,kubernetes")
reference_urlstring(可选)源URL
architecturestring(可选)JSON或XML格式的架构图

示例提示

  • *“将此会议摘要添加到矢量数据库:title='Azure Workshop',content='…'”*
  • *“存储有关我们Kubernetes迁移讨论的新项目日志条目”*
  • *“用标签索引这篇博客文章:azure、容器、devops”*

______________________________________________________________________

索引命名空间

index_create_project_log_index

使用正确的架构和HNSW创建项目日志Azure AI搜索索引 矢量配置。索引已存在时可以安全调用。

架构字段

字段类型注释
id字符串(键)自动生成的UUID
title字符串可搜索、可过滤、可排序
type字符串可过滤、可分面(workshop, meeting, blog, repo)
customer_name字符串可过滤、可分面
short_summary字符串可搜索
context字符串可搜索(全文)
context_vector集合(单个)HNSW矢量搜索字段
project_name字符串可过滤、可分面
tags集合(字符串)可筛选、可分面
reference_url字符串可搜索
architecture字符串可搜索
creation_dateDateTimeOffset可过滤、可排序
modified_dateDateTimeOffset可过滤、可排序

示例提示

  • *“设置项目日志搜索索引”*
  • *“创建Azure AI搜索索引以存储项目摘要”*
  • *“初始化项目日志的矢量数据库架构”*

______________________________________________________________________

index_ingest_project_log

将单个项目日志条目引入索引。索引已创建 如果它不存在,则自动执行。

参数类型说明
titlestring日志条目标题
entry_type字符串workshop, meeting, blog,或 repo
customer_namestring客户或组织名称
short_summarystring简要总结(1-2句话)
contextstring完整上下文文本(将嵌入)
project_namestring(可选)项目名称
tagsstring(可选)逗号分隔的标签
reference_urlstring(可选)源URL
architecturestring(可选)JSON或XML格式的架构图

示例提示

  • *“添加研讨会日志:title='Azure AI Day',entry_type='workshop',customer_name='Contoso',context='…'”*
  • *“索引有关云迁移项目的新会议摘要”*
  • *使用标签存储此仓库文档:python、mcp、azure*

______________________________________________________________________

示例代理和工作流程

foundry_agents 该包提供了两个示例代理和一个管道工作流 其独立于MCP服务器工作。

将代理部署到Azure AI Foundry

在您的Foundry项目中注册示例代理(然后它们会出现在 agents_list_agents 并且可以通过以下方式调用 agents_invoke_agent):

deploy-case-study-agent      # registers CaseStudyAgent
deploy-architecture-agent    # registers ArchitectureAgent

运行项目日志工作流

获取Microsoft客户故事,提取元数据,生成架构 图表,并将所有内容存储在向量索引中——所有这些都在一个命令中:

run-project-log-workflow \
  --url "https://www.microsoft.com/en/customers/story/25676-commerzbank-ag-azure-ai-foundry-agent-service" \
  --project "Commerzbank AI Platform"

或者从MCP服务器触发相同的管道:

Run the project log workflow for https://www.microsoft.com/en/customers/story/...

工作流程 自动使用已部署的Foundry代理 如果可用,以及 否则,将退回到直接的Azure OpenAI推理。

______________________________________________________________________

部署到Azure容器应用程序

服务器可以部署到 Azure容器应用 只需一个命令 使用 Azure开发者命令行界面(azd).

配置什么

资源目的
虚拟网络容器应用程序环境(始终)运行Direct3D集成
容器应用程序环境托管MCP服务器;集 USE_PRIVATE_INGRESS=true 仅供内部访问
Azure容器注册表存储Docker映像
日志分析+应用洞察遥测和分布式跟踪
Azure AI Foundry(AIServices+项目)代理API+模型部署(完成+嵌入)
Azure AI搜索项目日志的矢量搜索索引
用户分配的托管身份无密码身份验证-分配的Azure AI开发人员、认知服务OpenAI用户、搜索索引数据贡献者和AcrPull角色

Infra文件夹结构

infra/
  abbreviations.json          ← Azure resource name prefixes
  main.bicep                  ← Subscription-scoped orchestrator
  main.parameters.json        ← azd parameter file
  ai/
    foundry.bicep             ← AIServices account + Foundry project + model deployments
    search.bicep              ← Azure AI Search
  app/
    server.bicep              ← MCP server Container App + identity
  core/
    host/
      vnet.bicep              ← VNet with aca-apps subnet (always deployed)
      container-apps.bicep    ← Environment + registry orchestration
      container-apps-environment.bicep  ← Managed environment (usePrivateIngress flag)
      container-app.bicep     ← Container App with health probes + role assignments
      container-app-upsert.bicep
      container-registry.bicep
    monitor/
      monitoring.bicep        ← Log Analytics + Application Insights
      loganalytics.bicep
      applicationinsights.bicep
    security/
      foundry-access.bicep    ← Azure AI Developer + Cognitive Services OpenAI User
      registry-access.bicep   ← AcrPull
      search-access.bicep     ← Search Index Data Contributor

快速部署

# 1. Login
azd auth login

# 2. Create an azd environment
azd env new foundry-mcp
azd env set AZURE_LOCATION swedencentral   # or eastus2, westus3, northcentralus

# 3. (Optional) private ingress – accessible only from within the VNet
azd env set USE_PRIVATE_INGRESS true

# 4. Provision infrastructure (no local Docker required)
azd up

azd up 将:

  1. 提供所有资源(ExpressRoute、容器应用程序、Foundry、搜索、监控)
  2. infra/write_env.sh 填充 .env 所有端点值

构建和部署容器

容器映像是使用Azure容器注册表(ACR)远程构建的 不需要本地Docker安装.之后 azd up 已配置 基础设施,运行:

# Build in ACR and deploy the Container App
./azd-hooks/deploy.sh foundry-mcp   # pass your azd environment name

脚本将:

  1. 通过ACR远程构建Docker镜像 az acr build
  2. 通过二头肌部署部署容器应用程序(infra/app/server.bicep)
  3. 打印MCP服务器URL

私人入口

USE_PRIVATE_INGRESS=true 容器应用程序环境配置为 internal: true 并且容器应用程序入口设置为 external: falseThe 然后,MCP服务器只能从ExpressRoute内访问(例如通过跳转主机, VPN或同一环境中的另一个容器应用程序)。

将VS代码副本连接到部署的服务器

# Find the URL
cat .env | grep MCP_SERVER_URL
  1. 在VS代码中打开命令面板→ MCP:添加服务器超文本传输协议.
  2. 输入URL .env (例如。 https:///mcp).
  3. 所有10个Foundry Agent工具现在都可以在Copilot Chat中使用。

使用HTTP传输在本地运行

# Start the HTTP server (same code, same image)
uvicorn foundry_agents_mcp.server:http_app --host 0.0.0.0 --port 8000

# Test the health probe
curl http://localhost:8000/health
# → {"status":"healthy","service":"foundry-agents-mcp-server"}

监控

当以下情况发生时,OpenTetry跟踪会自动启用 APPLICATIONINSIGHTS_CONNECTION_STRING 已设置。每个MCP工具调用和HTTP 通过以下方式跟踪请求 azure-monitor-opentelemetry.

azd monitor   # open the Application Insights dashboard in the portal

拆除

azd down

______________________________________________________________________

发展

# Clone and install in editable mode
git clone https://github.com/denniszielke/foundry-agents-mcp-server
cd foundry-agents-mcp-server
pip install -e ".[dev]"

# Run locally (stdio)
python -m foundry_agents_mcp

许可证

麻省理工学院

目录标签

目录标签

AI代理工作流自动化PythonClaude向量搜索本地部署AzureAIMCP协议

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP