Infrahub MCP Server
Infrahub MCP Server connects AI assistants and IDE agents to Infrahub using the open Model Context Protocol standard — so agents can query, create, update, and propose changes to your infrastructure data through a consistent, audited interface. It works with any MCP-compatible client (Claude Desktop, VS Code, Cursor, CLI agents, and more) with no custom glue code required.
All writes are branch-isolated and require human approval before merging — agents never modify your default branch directly.
What you can do with it
- Query your infrastructure data from natural language — ask an AI assistant to find devices, interfaces, IP addresses, or any node kind defined in your Infrahub schema, with attribute filtering and partial-match search
- Explore your schema without leaving the conversation — the server exposes your full schema catalog, per-kind attribute and filter maps, and the GraphQL SDL as MCP resources that agents read automatically
- Make changes on isolated branches — all writes happen on an auto-created session branch (
mcp/session-YYYYMMDD-<hex>), so the default branch is never modified directly - Submit changes for human review — when edits are ready, call
propose_changesto open a Proposed Change (the Infrahub equivalent of a pull request) for approval before merging - Run arbitrary GraphQL queries — for advanced use cases, execute any GraphQL query or mutation directly against the Infrahub API
Who this is for
An infrastructure or network team already using Infrahub that wants their AI coding assistants to understand and interact with their source of truth. You get schema-aware querying, safe branch-isolated writes, and a human-in-the-loop review path — all from your IDE or chat assistant.
A developer building AI-powered infrastructure automation who needs a standardized interface between agents and Infrahub. The MCP server handles authentication, schema discovery, and branch management so you can focus on the agent logic.
What's included
- Tools (read) —
get_nodesretrieves objects by kind with filters,search_nodesfinds nodes by partial name match,query_graphqlexecutes arbitrary GraphQL queries - Tools (write) —
node_upsertcreates or updates nodes,node_deleteremoves nodes,propose_changesopens a Proposed Change for human review — all on an auto-created session branch - Resources —
infrahub://schemalists all available kinds,infrahub://schema/{kind}returns full attribute/filter details,infrahub://graphql-schemaexposes the GraphQL SDL,infrahub://brancheslists all branches - Prompts — a built-in
infrahub_agentsystem prompt that teaches agents the branch-per-session workflow and available tools - Infrastructure — Dockerfile for container deployment, Docker Compose sidecar configuration, Streamable HTTP transport support
See the Methods reference for full details on every tool, resource, and prompt.
Guides
- Install and run Infrahub MCP — prerequisites, setup, and client configuration for Cursor, VS Code, Claude Desktop, and Claude Code
- Run with Docker / deploy alongside Infrahub — standalone container or sidecar deployment
About Infrahub
Infrahub is an open source infrastructure data management and automation platform (AGPLv3), developed by OpsMill. It gives infrastructure and network teams a unified, schema-driven source of truth for all infrastructure data — devices, topology, IP space, configuration — with built-in version control, a generator framework for automation, and native integrations with Git, Ansible, Terraform, and CI/CD pipelines.