# nutanix/ntnx-api-mcp-server architecture

> Architecture diagram of the GitHub repository nutanix/ntnx-api-mcp-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nutanix/ntnx-api-mcp-server
- Repository: https://github.com/nutanix/ntnx-api-mcp-server

## Overview

This is an MCP stdio server that turns Nutanix V4 OpenAPI YAML artifacts into discoverable tools and namespace-specific API executors. The main workflow is: initialize or refresh artifacts, load and parse them at startup, generate operation schemas and discovery tools, then dispatch an assistant's selected operation to Prism Central. Configuration and startup readiness support that flow. The graph follows the documented CLI capabilities and sampled source; unsampled module behavior is represented only where the README or source index supports it.

Main entry points: [`src/cli.py`](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/cli.py) (CLI commands), [`src/server.py`](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/server.py) (Startup artifact loader), [`src/pull_from_developers_api.py`](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/pull_from_developers_api.py) (Artifact fetch and refresh), [`src/generators/tool_generator.py`](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/tool_generator.py) (Tool and schema generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and readiness"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
  node_readiness["Startup readiness<br/>[readiness.py]"]
end

subgraph group_metadata["API metadata"]
  node_artifact_fetch["Artifact fetch and refresh"]
  node_artifact_store[("YAML artifacts")]
  node_yaml_parser["OpenAPI YAML parser<br/>[yaml_parser.py]"]
  node_tool_generator["Tool and schema generator<br/>[tool_generator.py]"]
  node_schema_resolver["Schema resolver<br/>[schema_resolver.py]"]
  node_models["Operation models<br/>[models.py]"]
end

subgraph group_runtime["MCP runtime"]
  node_startup_loader["Startup artifact loader<br/>[server.py]"]
  node_stdio_server["MCP stdio server"]
  node_dispatcher["Runtime tool dispatcher"]
  node_api_handler["Prism API handler<br/>[api_handler.py]"]
end

subgraph group_integration["External systems"]
  node_prism{{"Prism Central"}}
  node_developer_portal{{"Nutanix developer portal"}}
end

node_assistant(("AI assistant"))

node_assistant -->|"uses stdio"| node_stdio_server
node_cli -->|"loads configuration"| node_settings
node_cli -->|"checks readiness"| node_readiness
node_cli -->|"initializes refreshes"| node_artifact_fetch
node_cli -->|"starts server"| node_stdio_server
node_cli -->|"runs startup"| node_startup_loader
node_artifact_fetch -->|"fetches specs"| node_developer_portal
node_artifact_fetch -.->|"discovers namespaces"| node_prism
node_artifact_fetch -->|"writes artifacts"| node_artifact_store
node_startup_loader -->|"loads YAML"| node_artifact_store
node_startup_loader -->|"parses specifications"| node_yaml_parser
node_startup_loader -->|"builds tools and index"| node_tool_generator
node_tool_generator -->|"resolves schemas"| node_schema_resolver
node_tool_generator -->|"uses operation models"| node_models
node_stdio_server -->|"loads operations"| node_startup_loader
node_stdio_server -->|"routes tool calls"| node_dispatcher
node_dispatcher -->|"queries operation index"| node_tool_generator
node_dispatcher -->|"executes API request"| node_api_handler
node_api_handler -->|"sends authenticated requests"| node_prism
node_readiness -->|"probes connectivity"| node_prism

click node_cli "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/cli.py"
click node_settings "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/config/settings.py"
click node_readiness "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/auth/readiness.py"
click node_artifact_fetch "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/pull_from_developers_api.py"
click node_artifact_store "https://github.com/nutanix/ntnx-api-mcp-server/tree/main/src/artifacts"
click node_yaml_parser "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/parsers/yaml_parser.py"
click node_tool_generator "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/tool_generator.py"
click node_schema_resolver "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/schema_resolver.py"
click node_models "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/models.py"
click node_startup_loader "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/server.py"
click node_stdio_server "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/mcp_stdio_server.py"
click node_dispatcher "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/tools/runtime_dispatcher.py"
click node_api_handler "https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/handlers/api_handler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_settings,node_readiness toneBlue
class node_artifact_fetch,node_artifact_store,node_yaml_parser,node_tool_generator,node_schema_resolver,node_models toneAmber
class node_startup_loader,node_stdio_server,node_dispatcher,node_api_handler toneMint
class node_prism,node_developer_portal toneRose
class node_assistant toneIndigo
```

## Components

### Setup and readiness

- [CLI commands](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/cli.py): `src/cli.py`
- [Runtime settings](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/config/settings.py): `src/config/settings.py`
- [Startup readiness](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/auth/readiness.py): `src/auth/readiness.py`

### API metadata

- [Artifact fetch and refresh](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/pull_from_developers_api.py): `src/pull_from_developers_api.py`
- [YAML artifacts](https://github.com/nutanix/ntnx-api-mcp-server/tree/main/src/artifacts): `src/artifacts`
- [OpenAPI YAML parser](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/parsers/yaml_parser.py): `src/parsers/yaml_parser.py`
- [Tool and schema generator](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/tool_generator.py): `src/generators/tool_generator.py`
- [Schema resolver](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/schema_resolver.py): `src/generators/schema_resolver.py`
- [Operation models](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/generators/models.py): `src/generators/models.py`

### MCP runtime

- [Startup artifact loader](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/server.py): `src/server.py`
- [MCP stdio server](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/mcp_stdio_server.py): `src/mcp_stdio_server.py`
- [Runtime tool dispatcher](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/tools/runtime_dispatcher.py): `src/tools/runtime_dispatcher.py`
- [Prism API handler](https://github.com/nutanix/ntnx-api-mcp-server/blob/main/src/handlers/api_handler.py): `src/handlers/api_handler.py`

### External systems

- **Prism Central**
- **Nutanix developer portal**

### Other components

- **AI assistant**

## Connections

- AI assistant → MCP stdio server: uses stdio (evidence: `README.md`)
- CLI commands → Runtime settings: loads configuration (evidence: `src/cli.py`)
- CLI commands → Startup readiness: checks readiness (evidence: `src/cli.py`)
- CLI commands → Artifact fetch and refresh: initializes refreshes (evidence: `README.md`)
- CLI commands → MCP stdio server: starts server (evidence: `src/cli.py`)
- CLI commands → Startup artifact loader: runs startup (evidence: `src/cli.py`)
- Artifact fetch and refresh → Nutanix developer portal: fetches specs (evidence: `src/pull_from_developers_api.py`)
- Artifact fetch and refresh → Prism Central: discovers namespaces
- Artifact fetch and refresh → YAML artifacts: writes artifacts (evidence: `README.md`)
- Startup artifact loader → YAML artifacts: loads YAML (evidence: `src/server.py`)
- Startup artifact loader → OpenAPI YAML parser: parses specifications (evidence: `src/server.py`)
- Startup artifact loader → Tool and schema generator: builds tools and index (evidence: `src/server.py`)
- Tool and schema generator → Schema resolver: resolves schemas (evidence: `src/generators/tool_generator.py`)
- Tool and schema generator → Operation models: uses operation models (evidence: `src/generators/tool_generator.py`)
- MCP stdio server → Startup artifact loader: loads operations (evidence: `src/mcp_stdio_server.py`)
- MCP stdio server → Runtime tool dispatcher: routes tool calls (evidence: `src/mcp_stdio_server.py`)
- Runtime tool dispatcher → Tool and schema generator: queries operation index (evidence: `src/tools/runtime_dispatcher.py`)
- Runtime tool dispatcher → Prism API handler: executes API request (evidence: `src/tools/runtime_dispatcher.py`)
- Prism API handler → Prism Central: sends authenticated requests (evidence: `src/handlers/api_handler.py`)
- Startup readiness → Prism Central: probes connectivity (evidence: `src/auth/readiness.py`)
