Extending MCP
Relevant source files
The following files were used as context for generating this wiki page:
Extending the Model Context Protocol (MCP) within the Nexus Orchestrator allows for the creation of a standardized communication layer between AI agents and underlying infrastructure. This extension functions as the "Connectivity Layer," enabling agents to interact with environments, manage SSH connectivity, and access persistent state through a local-first, background orchestration daemon.
The primary goal is to bridge the "infrastructure gap" by synthesizing MCP with other orchestration and governance tools like LangGraph and Open Policy Agent (OPA). This ensures that agent-to-infrastructure communication is not only functional but also governed by Zero Trust security principles.
Sources: README.md:1-12
Core Connectivity Architecture
The MCP implementation serves as one of the four core pillars of Nexus. It provides the protocol foundation that allows agents to request infrastructure changes or query environment states.
Connectivity Layer Workflow
The following diagram illustrates how MCP sits between the AI Agents and the physical/virtual infrastructure managed by Nexus.
The Connectivity Layer uses MCP to normalize requests from AI agents before they are processed by the orchestration and governance layers.
Sources: README.md:14-15
Agent Context and Tracking
Extending MCP involves maintaining a persistent state of which agents are currently interacting with the orchestrator. This is managed through the Context Layer, specifically utilizing the AGENTS.md file to track agent identities and their associated trust levels.
| Field | Description | Purpose |
|---|---|---|
| Agent ID | Unique identifier for the AI agent | Used for session tracking and identification |
| Description | Human-readable details about the agent | Provides context for the agent's role |
| Trust Level | Security tier assigned to the agent | Dictates the scope of infrastructure access via MCP |
Sources: context/AGENTS.md:1-10, README.md:17
Integration with Orchestration and Governance
MCP is not a standalone component in Nexus; it is integrated with LangGraph for workflow management and OPA for security. When an MCP command is received, it triggers a sequence of events across these layers.
Sequence of an MCP Request
This flow ensures that every MCP-based interaction is governed by the Zero Trust security model designated for non-human identities.
Sources: README.md:5-9, README.md:18
Key Implementation Components
The extension of MCP involves several technical components described in the system pillars:
- Autonomous Infrastructure Daemon: The background process that listens for MCP commands and manages environmental state.
- Zero Trust Governance: Integration of Open Policy Agent (OPA) to ensure that MCP-exposed tools and resources are accessed only by authorized agents.
- Context Layer Management: Persistent management of state files and agent registries to maintain continuity across sessions.
Sources: README.md:9-18
Summary
Extending MCP in Nexus Orchestrator transforms a standard communication protocol into a robust connectivity layer for autonomous infrastructure management. By anchoring MCP interactions in a governance framework (OPA) and a workflow engine (LangGraph), Nexus ensures that AI agents can safely and effectively bridge the gap between their logic and the operating environments they inhabit.