К основному содержанию
субагент CX Codex

connect-hosted — субагент для Claude Code

Субагент connect-hosted подключает Claude Code к уже развёрнутому агенту Azure AI Foundry. Читает конфигурацию удалённо, проверяет права доступа и связывает toolbox через endpoint или имя.

MIT ★ 3 232 обновлён 2026-10-23

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add microsoft/skills
/plugin install foundry-iq-skills@skills
Открыть на GitHub

Что делает connect-hosted

Субагент инспектирует удалённого агента через azd ai agent show, читает его principal, подключения и toolbox. Перед изменениями проверяет права runtime principal — Search Index Data Reader на ресурс поиска и Foundry User на проект. Создаёт недостающие ресурсы только после одобрения: remote-tool подключение к MCP-эндпойнту базы знаний с auth-type agentic-identity и audience https://search.azure.com/, toolbox из YAML-файла с описанием и именем подключения.

Выбирает режим привязки toolbox — endpoint (переменная TOOLBOX_ENDPOINT с адресом <project-endpoint>/toolboxes/<toolbox-name>/mcp?api-version=v1) или name (переменная TOOLBOX_NAME). Разворачивает изменения через azd deploy только если удалённая конфигурация отличается. Проверяет работу двумя вызовами azd ai agent invoke с --protocol responses и фиксированной версией: первый создаёт сессию, второй использует её ID с новой беседой, чтобы убедиться в изоляции.

Какие задачи решает

  • подключить Claude Code к развёрнутому Azure AI агенту без пересоздания
  • проверить права runtime principal агента на Search Index и Foundry
  • связать toolbox с агентом через endpoint или имя переменной
  • развернуть изменения конфигурации агента через azd
  • проверить изоляцию сессий и бесед агента через Responses API

Примеры запросов агенту

  • Прочитай конфигурацию агента research-bot и проверь его права на Search Index Data Reader
  • Создай toolbox kb-tools и свяжи его с агентом через переменную endpoint
  • Разверни изменения агента analytics-agent и проверь новую версию двумя вызовами с разными беседами

Как установить connect-hosted

1Через маркетплейс плагинов

/plugin marketplace add microsoft/skills
/plugin install foundry-iq-skills@skills

2Вручную: положить файлы

.claude/agents/connect-hosted.md

Для всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию

По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст

Вопросы о connect-hosted

Как установить connect-hosted в Claude Code?

Выполни /plugin marketplace add microsoft/skills, затем /plugin install foundry-iq-skills@skills, после чего открой .claude/agents/connect-hosted.md.

Что делает connect-hosted?

Субагент подключает Claude Code к уже развёрнутому агенту Azure AI Foundry: инспектирует удалённую конфигурацию, проверяет права доступа runtime principal, создаёт недостающие подключения и toolbox, разворачивает изменения и проверяет изоляцию сессий.

Какие права нужны runtime principal агента?

Search Index Data Reader на ресурс Azure Search и Foundry User на проект для доступа к toolbox. Субагент проверяет наличие этих прав перед созданием ресурсов и не выдаёт их автоматически.

Исходный текст

connect-hosted.md · MIT
# Existing Hosted Agent connection

Branch of [Connect](connect.md), not a creation workflow.
Inspect remotely first; no source path for inspection or exact reuse.
Missing `azure.yaml` in cwd is not a discovery blocker.
Do not reinstall, reinitialize or inspect policy upfront.
Retain resources; Hosted cleanup is unsupported.

## Inspect

Use known project endpoint, exact agent name/version, KB MCP identity, runtime
principal and actual connection/toolbox/binding readbacks through authenticated,
observed read operations. Missing read tooling is a tooling blocker, not a source
request. Run these azd reads only with already available project/environment:

```text
azd ai agent show <service-name> --output json --no-prompt
azd ai connection show <connection-name> --output json --no-prompt
azd ai toolbox show <toolbox-name> --output json --no-prompt
```

Never use `azd ai project set` as a read; context changes require approval.
Inspect compatible connections/toolboxes before choosing a new name. Never
overwrite a Prompt connection using `ProjectManagedIdentity` to make it Hosted.

Compare agent identity/version, model, telemetry, ACR,
network, environment, connection target/auth/audience and toolbox/default tools.
For omitted audience or `UnknownConnectionPropertiesV2`, use the exact
[nonsecret connection readback](../references/platform-interfaces.md#hosted-connection-readback).
Projection gaps are warnings only after authoritative equality is proven;
denial, conflicting properties or still-missing required evidence blocks.

Resolve the actual published agent principal, not its blueprint or project MI.
Check effective runtime access and plan only missing grants:

| Permission | Grant scope |
|---|---|
| Search Index Data Reader | `<search-service-resource-id>` |
| Foundry User or documented equivalent for toolbox access | `<project-resource-id>` |

Reuse compatible effective grants. Disclose that Search service scope covers
its indexes, while Foundry User grants broader project data operations, not just
toolbox reads. No automatic grant, scope widening or caller-role change. A newly
observed principal or access requirement needs a separate approved access plan.

## Select binding before approval

Unchanged consumer: [toolbox-only branch](connect-hosted-toolbox.md); no deploy.

Source-free changes require observed runtime support and an authoritative surface.
Otherwise explain the exact code/config/deploy delta and handoff/request source
only then. Hosted code orchestrates tools: existing agents may need source too;
no arbitrary Hosted tool changes through Prompt APIs.

For the source-backed recipe, inspect its supported mode and emitted environment,
not just local variables. For `FoundryToolbox`, an explicitly
empty `TOOLBOX_ENDPOINT` raises instead of falling back to `TOOLBOX_NAME`.

| Mode | `TOOLBOX_ENDPOINT` | `TOOLBOX_NAME` |
|---|---|---|
| Endpoint | `<consumer-endpoint>` | `""` or absent |
| Name | absent | `<toolbox-name>` |

The consumer endpoint is
`<project-endpoint>/toolboxes/<toolbox-name>/mcp?api-version=v1`.
Do not substitute the version-specific developer endpoint returned by some
toolbox readers. Preserve an already compatible exact binding without
standardizing its mode. For new/repair bindings, select one supported mode:
if the manifest injects an empty endpoint, prefer endpoint mode when supported.
Unsetting a local variable does not remove a manifest's runtime environment key.
If no valid binding is possible without source edits, stop for separate review.

If installed, validate resolution offline with the SDK; do not install it for
this check. No token/model call or standalone
agentic toolbox `tools/list`: runtime identity requires published-agent context.

## Approved changes only

This source-backed recipe requires the approved existing `azd ai agent` source project;
unsupported/image-only source blocks this recipe, not remote inspection.
Retain source/config hashes for source/config changes or source-backed redeployment.
Plan grants/resource/binding deltas, source digest, costs and verification.
Exact state skips every mutation below.
After approved access changes, create only absent exact resources:

```text
azd ai connection create <connection-name> --kind remote-tool --target <exact-kb-mcp-endpoint> --auth-type agentic-identity --audience https://search.azure.com/ --output json --no-prompt
azd ai toolbox create <toolbox-name> --from-file <approved-toolbox-yaml> --output json --no-prompt
```

Verify stored `AgenticIdentityToken`, audience, target and project before
toolbox creation. YAML contains only description and the exact connection name;
no credentials or extra tools. Creation auto-publishes the first toolbox version
and writes `TOOLBOX_<NORMALIZED_NAME>_MCP_ENDPOINT` locally; disclose that write.

Apply only the selected approved binding delta. Endpoint mode:

```text
azd env set TOOLBOX_ENDPOINT <consumer-endpoint> --no-prompt
```

If the source exposes an unused name variable, clear it only as an approved delta:

```text
azd env set TOOLBOX_NAME "" --no-prompt
```

Name mode, only with the endpoint absent from the emitted runtime environment:

```text
azd env set TOOLBOX_NAME <toolbox-name> --no-prompt
```

Deploy only when remote configuration differs, under the same agent name:

```text
azd deploy <service-name> --no-prompt
```

Independently read back the returned version, actual principal, binding and
protected state. `active` metadata is not runtime-health proof. Unknown/changed
identity, source drift or failure stops; no blind retry, `--force`, handcrafted
mutation API, replacement agent or automatic cleanup.

## Verify and reconcile

Pin the observed version at session creation. A new session does not guarantee a new Responses
conversation. Start both fresh:

```text
azd ai agent invoke <service-name> "<supported-question>" --protocol responses --version <verified-version> --new-session --new-conversation --no-prompt
```

Capture the first response's session ID as `<first-response-session-id>` and its
conversation ID. Verify both are distinct from prior trial IDs. Missing or reused
first-response IDs block the second call. Do not rely on automatic session selection;
explicitly pin the captured session while starting a fresh conversation:

```text
azd ai agent invoke <service-name> "<unsupported-question>" --protocol responses --session-id <first-response-session-id> --new-conversation --no-prompt
```

Sessions bind their version at creation; `--version` and `--session-id` are mutually exclusive.
If the installed CLI lacks `--session-id`, block verification rather than falling
back to a saved session. Require the second response's session ID to equal the
captured ID and its conversation ID to differ from the first and all prior trials.
Missing or mismatched IDs make isolation unverified: stop before monitoring or
further invocations. Do not silently add invocations to repair a bounded test.

Correlate actual `knowledge_base_retrieve` success with each request and response,
using returned events or supported logs:

```text
azd ai agent monitor <service-name> --session-id <first-response-session-id> --tail 300 --no-prompt
```

Require supported answers with original citations and unsupported answers exactly
`I don't know.` without citations. Errors are not abstention. Tool success proves
execution, not the contents of an unavailable payload: record missing arguments,
results or usage and leave payload-level faithfulness unverified. Never infer
empty retrieval or change source/telemetry to manufacture proof.

Compare identities, versions, tools, roles, protected source and binding.
Repeat reconciliation through reads only: no setters, create, publish
or deploy calls on exact state. Zero configuration writes excludes authorized
invocation/conversation/session activity and local test metadata; report both.
Retain resources. Cleanup remains separately approved and
`hosted-cleanup-unsupported` in this skill.

© Microsoft · MIT · microsoft/skills

Похожие субагенты

Все субагенты по теме «Настройка агента: память, контекст, субагенты» →
azure-developer-cli официальный github Ведёт работу с проектами Azure Developer CLI: от структуры azure.yaml до хуков и CI/CD. Подключается при создании, миграции и ревью azd-проектов, когда нужны текущие рекомендации Microsoft. CX Codex +1 32установок azure-ml-foundry-workspace JosiahSiegel Скилл azure-ml-foundry-workspace для Claude Code настраивает Azure Machine Learning и Azure AI Foundry: рабочие пространства, сети, вычисления и развёртывание моделей. Разбирает конфигурацию и журналы. CX Codex +1 105установок azure-cost-health-check Shayne Boyer Плагин azure-cost-health-check для GitHub Copilot показывает расходы Azure, прогнозы, бюджеты и рекомендации Advisor в одном канвасе. Включается в FinOps-мониторинг, чтобы проверить, куда уходят деньги. ★ 11звёзд репо azure-functions-hosted-skills paulyuk azure-functions-hosted-skills — плагин GitHub Copilot для сборки и запуска локальных Azure Functions Hosted Skills или вызова поддерживаемых функций в существующем Function App. Работа начинается в canvas Copilot. ★ 11звёзд репо azure-deployment-preflight официальный github Скилл azure-deployment-preflight проверяет Bicep-развёртывание в Azure до запуска: синтаксис, права и будущие изменения. Нужен перед azd provision или командами az deployment. CX Codex +1 9 591установок hosted-mcp-tools moonbox3 Субагент hosted-mcp-tools помогает собрать агента Microsoft Foundry, который вызывает инструменты удалённого MCP-сервера, на C# или Python. CX Codex ★ 521звёзд репо

Из того же набора250

Весь набор →
declarative-agent-developer Скилл declarative-agent-developer для создания, настройки, локализации и деплоя декларативных агентов Microsoft 365 Copilot и Teams прямо из сессии агента. CX Codex +1 ★ 3 232звёзд репо create-missing-agent Субагент create-missing-agent помогает создать отсутствующего агента для подключения к базе знаний в Microsoft Foundry. Сверяет существующие агенты и требует отдельного подтверждения плана перед записью. CX Codex +1 ★ 3 232звёзд репо connect Субагент connect, который связывает один Prompt- или Hosted-агент с базой знаний в Microsoft Foundry, а при отсутствии агента может его создать. CX Codex +1 ★ 3 232звёзд репо connect-prompt-sdk-fallback Субагент connect-prompt-sdk-fallback подключает агентов Azure AI к базам знаний через Python SDK, когда Foundry MCP недоступен. Он формирует план привязки и требует явного подтверждения перед созданием ресурсов. CX Codex +1 ★ 3 232звёзд репо connect-hosted-toolbox Субагент connect-hosted-toolbox для переключения Azure AI Foundry toolbox на новую базу знаний без пересборки агента. Читает текущую конфигурацию, проверяет права доступа и готовит план изменений. CX Codex +1 ★ 3 232звёзд репо foundry-iq Скилл foundry-iq для Claude Code помогает разбирать Azure AI Search и Foundry IQ, включая поиск по документам и графы знаний. Он подключается к запросам о поиске, индексах, сбоях доступа и качестве выдачи. CX Codex +1 ★ 3 232звёзд репо research Команда research проводит многошаговое исследование темы по кодовой базе: читает реальные пути выполнения и требует источник для каждого утверждения. CX Codex +1 ★ 3 232звёзд репо page Команда page создаёт одну вики-страницу по кодовой базе с диаграммами Mermaid для тёмной темы, таблицами и ссылками на строки в репозитории. CX Codex +1 ★ 3 232звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой