One of the key advantages of our solution is the use of multi-agent architecture based on cagent. This allows creating specialized agents with clearly defined roles and instructions, significantly improving system reliability and predictability.
Docker cagent
Docker cagent is a runtime for orchestrating AI agents from Docker that allows creating and running teams of specialized virtual experts working together to solve complex problems.
Key Capabilities
In our solution, we used multi-agent architecture to separate responsibilities between specialized agents:
- the coordinator processes user requests and delegates tasks
- the discovery agent searches for resources by partial names
- the action agent executes operations.
This separation made the system's behavior more predictable and reliable.
Critically important for integration with IIS MCP Server and Manager was support for the MCP protocol, which allows agents to connect to multiple MCP servers simultaneously. The discovery agent gets access to both the Manager for finding sites and all IIS MCP servers for getting detailed information, while the action agent can directly execute operations on the needed servers.
Agent configuration is described in a YAML file, simplifying setup and maintenance. Built-in "think" and "todo" tools help the coordinator plan complex multi-step operations, such as searching for a resource across multiple servers followed by performing an action.
For working with IIS, we use OpenAI models, but the ability to switch between providers allows adapting the system to various performance and cost requirements. Isolating each agent ensures that failures in one agent don't affect others.
One of the main advantages of cagent is its simplicity. In most cases, you don't need to write a single line of code — just describe the agent in a YAML file:
```yaml
#!/usr/bin/env cagent run
models:
default:
provider: openai
model: gpt-5-nano
agents:
root:
model: default
description: IIS Management Coordinator
instruction: |
...
instructions
...
sub_agents:
- discovery
- action
toolsets:
- type: todo
- type: think
- type: mcp
remote:
url: https://iis-mcp-manager.domain.tld/mcp
transport_type: streamable-http
discovery:
model: default
description: Resource Discovery Specialist
instruction: |
...
instructions
...
toolsets:
- type: mcp
remote:
url: https://iis-mcp-manager.domain.tld/mcp
transport_type: streamable-http
- type: mcp
remote:
url: https://iismcp1.domain.tld/mcp
transport_type: streamable-http
- type: mcp
remote:
url: https://iismcp2.domain.tld/mcp
transport_type: streamable-http
- type: memory
path: ./discovery_memory.db
action:
model: default
description: IIS Action Executor
instruction: |
...
instructions
...
toolsets:
- type: mcp
remote:
url: https://iis-mcp-manager.domain.tld/mcp
transport_type: streamable-http
- type: mcp
remote:
url: https://iismcp1.domain.tld/mcp
transport_type: streamable-http
- type: mcp
remote:
url: https://iismcp2.domain.tld/mcp
transport_type: streamable-http
```
MCP Integration
cagent natively supports the MCP protocol, allowing agents to use tools from any MCP servers. This is important for our solution, as IIS MCP Server and IIS MCP Manager provide their capabilities precisely through MCP.
Agents can connect to multiple MCP servers simultaneously, allowing the discovery agent to have access to both the Manager and all IIS MCP servers for resource discovery, while the action agent can directly execute operations on the needed servers.
Multi-Agent Architecture
Instead of a single universal agent, we use a system of three specialized agents:
1. Root Agent (Coordinator)
The main agent that coordinates the entire system's work. Its tasks:
-
Understanding user requests
-
Determining the operation type (status query or action)
-
Forming tasks for sub-agents
-
Delegating tasks to specialized agents
-
Aggregating results and presenting them to the user
The root agent has access only to the Manager via MCP, allowing it to find resources but not execute operations directly. This ensures clear separation of responsibilities.
2. Discovery Agent (Discovery Specialist)
An agent specializing in finding resources by partial names or keywords. Its features:
-
Instant reaction: When receiving a task from the coordinator, immediately calls the appropriate tool without thinking
-
Smart search: Distinguishes exact names (e.g., "acme.domain.tld") and partial matches
-
Multiple result handling: If multiple matches are found, returns all options for user clarification
-
Access to multiple servers: Has access to the Manager and all IIS MCP servers for resource discovery
The discovery agent's instructions clearly define its behavior:
```yaml
discovery:
instruction: |
When coordinator delegates a task to you or asks you to find
a resource, you must immediately call the appropriate tool.
Do not wait, do not ask questions, do not think about it -
just call the tool.
```
3. Action Agent (Action Executor)
An agent that executes operations on found resources. Its characteristics:
-
Receives ready information: The coordinator passes it exact resource names and server addresses
-
Result verification: After executing an action, verifies its success through a status query
-
Specialization: Doesn't handle discovery — only executes operations
-
Security: Follows strict instructions and doesn't execute operations without complete information
Agent Instructions: The Key to Reliability
Detailed instructions for each agent are not just descriptions, but actually behavioral programs. They define:
-
Action sequence: Clear algorithm for each request type
-
Error handling: How to respond to failures, timeouts, server unavailability
-
Tool routing: Which tools to use for which tasks
-
Interaction rules: How agents communicate with each other
For example, instructions for the root agent define two main workflows:
Workflow for status queries:
-
If the site name is partial — delegate to discovery agent
-
Get exact names and server information
-
For each site, query its status and its application pool status
-
Present results to the user
Workflow for actions:
-
Determine action type (direct action on app pool, site, or action on site's app pool)
-
Delegate to discovery agent to find resources
-
If multiple options found — ask the user
-
Delegate to action agent with complete information
-
Get result and present to user
Such detailed instructions allow the AI to clearly follow a predefined algorithm, minimizing errors and unpredictable behavior.
Advantages of Multi-Agent Architecture
-
Separation of responsibilities: Each agent does what it does best
-
Parallelism: Discovery and action agents can work in parallel for different resources
-
Scalability: Can add more discovery or action agents as load increases
-
Fault tolerance: If one agent is unavailable, others can continue working
-
Testability: Each agent can be tested independently