Overview
Expert guidance for interactive data analysis
against a live Infrahub instance. This skill uses
the Infrahub MCP server to query, correlate,
and reason over infrastructure data on demand —
answering operational questions that span multiple
node types and relationships.
Use this skill for any question of the form
"what does Infrahub currently know about X,
and how does it relate to Y?"
Typical question patterns:
- Compliance — "Are all devices following
the naming convention?"
- Service impact — "Which services are hosted
on devices in this rack?"
- Maintenance windows — "Which devices are
currently in a maintenance window, and what
depends on them?"
- Drift detection — "Which realized devices
differ from their topology design?"
- Capacity — "Which racks are over 80% full?"
- Change impact — "What BGP sessions, services,
and IPs depend on this prefix?"
- Inventory gaps — "Which devices have no
platform or OS version recorded?"
For automated, pipeline-enforced checks that
block proposed changes, see
../infrahub-managing-checks/SKILL.md.
For repeatable scheduled reports exported as
artifacts, see ../infrahub-managing-transforms/SKILL.md.
Project Context
If invoked with arguments (e.g., /infrahub:analyzing-data Which devices have no platform assigned?),
treat the arguments as the question to answer.
When to Use
- Answering operational questions interactively
via natural language
- Cross-referencing two or more node types to find
relationships or gaps
- Investigating the blast radius of a change before
executing it
- Auditing data quality across the inventory
- Producing one-time or on-demand reports for
stakeholders
- Exploring schema structure and data before writing
a generator or check
How It Works
The Infrahub MCP server exposes tools that let
Claude query Infrahub data directly.
The typical workflow:
- Query — use MCP tools to fetch current state
from Infrahub
- Correlate — join, diff, or filter the data
against a policy or second dataset
- Reason — identify gaps, anomalies, or
relationships
- Report — surface findings with context and
remediation hints
Rule Categories
| Priority |
Category |
Prefix |
Description |
| CRITICAL |
MCP Tools |
mcp- |
Available Infrahub MCP tools, invocation patterns, response structure |
| CRITICAL |
Query Patterns |
query- |
GraphQL structures for fetching, filtering, and traversing relationships |
| HIGH |
Correlation |
correlation- |
Joining, diffing, and reasoning over data from multiple queries |
| HIGH |
Reporting Output |
reporting- |
Presenting findings: summaries, tables, per-object detail, remediation hints |
| MEDIUM |
Approach Selection |
approach- |
When to use MCP analysis vs InfrahubCheck vs Transform |
MCP Server Basics
When the Infrahub MCP server is connected, Claude
can call tools such as:
mcp__infrahub__infrahub_query — Execute a
GraphQL query (primary tool)
mcp__infrahub__infrahub_list_schema — List
available node kinds
mcp__infrahub__infrahub_get — Retrieve a
specific object by ID or filters
mcp__infrahub__infrahub_create — Create an
object (remediation, on a branch)
mcp__infrahub__infrahub_update — Update an
object (remediation, on a branch)
# Example: find all devices in an active
# maintenance window
query MaintenanceDevices {
MaintenanceWindow(status__value: "active") {
edges {
node {
name { value }
start_time { value }
end_time { value }
devices {
edges {
node {
name { value }
role { value }
site {
node { name { value } }
}
}
}
}
}
}
}
}
Typical Analysis Workflow
1. Understand the question
→ "Which services depend on devices currently
in a maintenance window?"
2. Identify the node types involved
→ MaintenanceWindow, DcimDevice, Service
(or equivalent in your schema)
3. Query current state
→ mcp__infrahub__infrahub_query — one query
per node type, or combined
4. Correlate the data
→ Join across node types, filter, count, diff
5. Report findings
→ Summarize with counts, list affected objects,
suggest next steps
Supporting References
1---2name: infrahub-analyzing-data3description: Analyzes and correlates live Infrahub data via the MCP server — answers operational questions, detects drift, and investigates impact. TRIGGER when: querying infrastructure data, checking compliance, investigating change impact, producing ad-hoc reports. DO NOT TRIGGER when: writing automated checks, building transforms, designing schemas, populating data files.4---56## Overview78Expert guidance for interactive data analysis9against a live Infrahub instance. This skill uses10the **Infrahub MCP server** to query, correlate,11and reason over infrastructure data on demand —12answering operational questions that span multiple13node types and relationships.1415Use this skill for any question of the form16*"what does Infrahub currently know about X,17and how does it relate to Y?"*1819Typical question patterns:2021- **Compliance** — "Are all devices following22 the naming convention?"23- **Service impact** — "Which services are hosted24 on devices in this rack?"25- **Maintenance windows** — "Which devices are26 currently in a maintenance window, and what27 depends on them?"28- **Drift detection** — "Which realized devices29 differ from their topology design?"30- **Capacity** — "Which racks are over 80% full?"31- **Change impact** — "What BGP sessions, services,32 and IPs depend on this prefix?"33- **Inventory gaps** — "Which devices have no34 platform or OS version recorded?"3536For **automated, pipeline-enforced** checks that37block proposed changes, see38`../infrahub-managing-checks/SKILL.md`.39For **repeatable scheduled reports** exported as40artifacts, see `../infrahub-managing-transforms/SKILL.md`.4142## Project Context4344If invoked with arguments (e.g., `/infrahub:analyzing-data Which devices have no platform assigned?`),45treat the arguments as the question to answer.4647## When to Use4849- Answering operational questions interactively50 via natural language51- Cross-referencing two or more node types to find52 relationships or gaps53- Investigating the blast radius of a change before54 executing it55- Auditing data quality across the inventory56- Producing one-time or on-demand reports for57 stakeholders58- Exploring schema structure and data before writing59 a generator or check6061## How It Works6263The Infrahub MCP server exposes tools that let64Claude query Infrahub data directly.65The typical workflow:66671. **Query** — use MCP tools to fetch current state68 from Infrahub692. **Correlate** — join, diff, or filter the data70 against a policy or second dataset713. **Reason** — identify gaps, anomalies, or72 relationships734. **Report** — surface findings with context and74 remediation hints7576## Rule Categories7778| Priority | Category | Prefix | Description |79| -------- | -------- | ------ | ----------- |80| CRITICAL | MCP Tools | `mcp-` | Available Infrahub MCP tools, invocation patterns, response structure |81| CRITICAL | Query Patterns | `query-` | GraphQL structures for fetching, filtering, and traversing relationships |82| HIGH | Correlation | `correlation-` | Joining, diffing, and reasoning over data from multiple queries |83| HIGH | Reporting Output | `reporting-` | Presenting findings: summaries, tables, per-object detail, remediation hints |84| MEDIUM | Approach Selection | `approach-` | When to use MCP analysis vs InfrahubCheck vs Transform |8586## MCP Server Basics8788When the Infrahub MCP server is connected, Claude89can call tools such as:9091- **`mcp__infrahub__infrahub_query`** — Execute a92 GraphQL query (primary tool)93- **`mcp__infrahub__infrahub_list_schema`** — List94 available node kinds95- **`mcp__infrahub__infrahub_get`** — Retrieve a96 specific object by ID or filters97- **`mcp__infrahub__infrahub_create`** — Create an98 object (remediation, on a branch)99- **`mcp__infrahub__infrahub_update`** — Update an100 object (remediation, on a branch)101102```graphql103# Example: find all devices in an active104# maintenance window105query MaintenanceDevices {106 MaintenanceWindow(status__value: "active") {107 edges {108 node {109 name { value }110 start_time { value }111 end_time { value }112 devices {113 edges {114 node {115 name { value }116 role { value }117 site {118 node { name { value } }119 }120 }121 }122 }123 }124 }125 }126}127```128129## Typical Analysis Workflow130131```text1321. Understand the question133 → "Which services depend on devices currently134 in a maintenance window?"1351362. Identify the node types involved137 → MaintenanceWindow, DcimDevice, Service138 (or equivalent in your schema)1391403. Query current state141 → mcp__infrahub__infrahub_query — one query142 per node type, or combined1431444. Correlate the data145 → Join across node types, filter, count, diff1461475. Report findings148 → Summarize with counts, list affected objects,149 suggest next steps150```151152## Supporting References153154- **[examples.md](./examples.md)** — Analysis155 patterns (naming, VLAN, BGP, maintenance,156 service impact)157- **[../infrahub-common/graphql-queries.md](../infrahub-common/graphql-queries.md)**158 — GraphQL query writing reference159- **[../infrahub-common/infrahub-yml-reference.md](../infrahub-common/infrahub-yml-reference.md)**160 — .infrahub.yml project configuration161- **[../infrahub-managing-checks/SKILL.md](../infrahub-managing-checks/SKILL.md)**162 — Automated pipeline checks (for enforcement)163- **[../infrahub-managing-transforms/SKILL.md](../infrahub-managing-transforms/SKILL.md)**164 — Transforms for scheduled report artifacts165- **[rules/](./rules/)** — Individual rules organized166 by category prefix