Skip to main content
Glama
README.md
# Infrahub MCP Server

Infrahub MCP Server connects AI assistants and IDE agents to [Infrahub](https://github.com/opsmill/infrahub) using the open [Model Context Protocol](https://modelcontextprotocol.io) 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.

## Installation

```bash
pip install infrahub-mcp
# or
uv pip install infrahub-mcp
```

Docker:

```bash
docker pull registry.opsmill.io/opsmill/infrahub-mcp:latest
# or use Docker Compose:
docker compose up -d
```

## Quickstart

Point the server at your Infrahub instance via environment variables, then run it over the transport your client expects.

**stdio** (default — for Claude Desktop, VS Code, Cursor):

```bash
export INFRAHUB_ADDRESS=http://localhost:8000
export INFRAHUB_API_TOKEN=<your-token>
infrahub-mcp
```

**Streamable HTTP** (for remote clients, sidecar deployments):

```bash
infrahub-mcp --transport streamable-http --host 0.0.0.0 --port 8001
```

## What you can do with it

- **Query your infrastructure data from natural language** — find devices, interfaces, IP addresses, or any kind in your schema, with attribute filtering and partial-match search.
- **Explore your schema without leaving the conversation** — the server exposes your catalog, per-kind attribute/filter maps, and the GraphQL SDL as MCP resources.
- **Make changes on isolated branches** — writes land on an auto-created session branch (`mcp/session-YYYYMMDD-<hex>`); the default branch is never touched directly.
- **Submit changes for human review** — call `propose_changes` to open a Proposed Change for approval before merging.
- **Run arbitrary GraphQL** — execute any query or mutation against the Infrahub API when you need full control.

## Documentation

Full documentation, including client configuration for Cursor, VS Code, Claude Desktop, and Claude Code, is available at the [Infrahub MCP Server docs site](https://docs.infrahub.app/mcp).

- [Installation and client setup](https://docs.infrahub.app/mcp/getting-started/installation)
- [Docker / sidecar deployment](https://docs.infrahub.app/mcp/guides/docker-compose)
- [Authentication modes](https://docs.infrahub.app/mcp/references/authentication)
- [Configuration reference](https://docs.infrahub.app/mcp/references/configuration)
- [Methods reference — tools, resources, prompts](https://docs.infrahub.app/mcp/references/methods)

## About Infrahub

[Infrahub](https://github.com/opsmill/infrahub) is an open source infrastructure data management and automation platform (AGPLv3), developed by [OpsMill](https://opsmill.com). It gives infrastructure and network teams a unified, schema-driven source of truth — 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.

## License

Apache 2.0 — see [LICENSE](./LICENSE.txt).

TDQS

A4.3/5.0

Scored across 12 tools

Disambiguation5/5

Each tool targets a clearly distinct action or resource: reads (get_nodes, search_nodes, query_graphql), graph analysis (find_paths, find_reachable), writes (node_upsert, node_delete, mutate_graphql), schema discovery (get_schema), and session/branch workflow (get_session_info, reset_session_branch, propose_changes). Descriptions explicitly clarify boundaries, such as when to prefer get_nodes/search_nodes over query_graphql and when to use node_upsert versus mutate_graphql.

Naming Consistency4/5

Most tools follow a snake_case verb_noun pattern (query_graphql, get_nodes, search_nodes, find_paths, propose_changes, reset_session_branch). A few deviate with noun_verb ordering (node_upsert, node_delete) and a slightly shortened form (find_reachable), but the overall naming remains predictable and readable.

Tool Count5/5

The 12 tools are well-scoped for a graph data platform that requires reads, writes, traversal, schema discovery, and branch/session management. Each tool has a clear role, and the set avoids both thinness and bloat.

Completeness4/5

Core lifecycle operations are covered: schema discovery, typed and GraphQL reads, graph traversal, node upsert/delete, complex mutations, session branch switching, and proposing changes. Minor gaps exist around the proposed-change lifecycle after creation, such as listing, inspecting, merging, or closing proposed changes.

Maintenance

ActivityActive
ResponsivenessUnresponsive