Get the FREE Ultimate OpenClaw Setup Guide →

infrahub

MCP server for Infrahub

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio opsmill-infrahub-mcp node server.js \
  --env INFRAHUB_API_KEY="your-api-key-here" \
  --env INFRAHUB_API_BASE="https://api.infrahub.example"

How to use

Infrahub MCP Server exposes Infrahub functionality to AI assistants through the MCP interface. It enables reading and optionally altering your infrastructure state by connecting to Infrahub’s data model, templates, and playbooks. Agents can query the current infrastructure state, fetch templates and playbooks, create or update resources, and trigger automation flows via consistent MCP commands, all while benefiting from Infrahub’s schema, version control, and unified storage.

To use the server, deploy the MCP service and run the provided server entry point. Clients can interact with the MCP endpoints to fetch objects, subscribe to changes, or submit update requests. The server will translate MCP requests into appropriate Infrahub API calls or graph-database operations, surface auditing information, and apply changes in a controlled, human-approved manner when required by your workflow.

How to install

Prerequisites

  • Node.js (14+ or as required by the server codebase)
  • npm or yarn
  • Access/credentials for Infrahub (API key or OAuth method as applicable)

Installation steps

  1. Clone the MCP repository or download the Infrahub MCP package.
  2. Install dependencies:
npm install
  1. Configure environment variables (example):
export INFRAHUB_API_BASE=https://api.infrahub.example
export INFRAHUB_API_KEY=your-api-key-here
  1. Start the MCP server:
node server.js
  1. Verify the server is running by making a simple MCP health check request or hitting the provided endpoint in your environment.

Optional: If you use a process manager (recommended for production), configure your startup script to run the same node command and handle restarts and logging.

Additional notes

Tips and common issues:

  • Ensure your Infrahub API base URL and credentials are correct; misconfiguration will result in authentication or connection errors.
  • If you rely on versioned data, take advantage of Infrahub’s built-in diffing/branching to test changes before applying them via MCP.
  • Monitor MCP server logs for authorization failures, network issues, or schema validation errors when mutating data.
  • If the server uses a gateway or proxy, set appropriate environment variables (e.g., HTTP(S)_PROXY).
  • For production deployments, consider configuring TLS termination and secure secret management for API keys.

Related MCP Servers

Sponsor this space

Reach thousands of developers