infrahub
MCP server for Infrahub
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
- Clone the MCP repository or download the Infrahub MCP package.
- Install dependencies:
npm install
- Configure environment variables (example):
export INFRAHUB_API_BASE=https://api.infrahub.example
export INFRAHUB_API_KEY=your-api-key-here
- Start the MCP server:
node server.js
- 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
MCP-PostgreSQL-Ops
🔍Professional MCP server for PostgreSQL operations & monitoring: 30+ extension-independent tools for performance analysis, table bloat detection, autovacuum monitoring, schema introspection, and database management. Supports PostgreSQL 12-17.
mcp_server_gdb
MCP Server to expose the GDB debugging capabilities
MegaMemory
Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.
mcp-tasks
A comprehensive and efficient MCP server for task management with multi-format support (Markdown, JSON, YAML)
local-skills
Universal MCP server enabling any LLM or AI agent to utilize expert skills from your local filesystem. Reduces context consumption through lazy loading. Works with Claude, Cline, and any MCP-compatible client.
agentman
Agentman: A tool for building and managing AI agents