Skip to main content

Infrahub MCP methods

Schema​

get_schema_mapping​

Capabilities​

  • read-only
  • idempotent
  • no destroy

List all schema nodes and generics available in Infrahub.

Parameters​

  • branch (string): branch to read from; default is the server’s default branch

get_schema​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve the full schema for a specific kind (attributes, relationships, and types).

Parameters​

  • kind (string, required): schema Kind to retrieve
  • branch (string): branch to read from; default is the server’s default branch

get_schemas​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve all schemas, optionally excluding Profiles and Templates.

Parameters​

  • branch (string): branch to read from; default is the server’s default branch
  • exclude_profiles (boolean, default: true): omit Profile schemas
  • exclude_templates (boolean, default: true): omit Template schemas

Nodes​

get_nodes​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Get all objects of a specific kind from Infrahub. Use get_schema_mapping to discover kinds and get_node_filters to discover filter keys.

Parameters​

  • kind (string, required): kind of the objects to retrieve
  • branch (string): branch name (default: server’s default branch)
  • filters (object): dictionary of filters to apply
  • partial_match (boolean, default: false): enable substring matches for string filters

get_node_filters​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve all available filters for a specific schema node kind.

Parameters​

  • kind (string, required): node kind (example: "Router")
  • branch (string): branch name
info
  • Attribute filters: attribute__value
  • Relationship filters: relationship__attribute__value
  • Filters starting with parent__ refer to a related generic node
  • Use get_schema to inspect peer kinds and attributes used in relationship filters

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve related nodes by relation name for a given kind.

Parameters​

  • kind (string, required): source node kind (example: "Device")
  • relation (string, required): relationship name to follow (example: "interfaces")
  • filters (object): filters applied to the source nodes before following the relation
  • branch (string): branch name

Branches​

branch_create​

Capabilities​

  • write
  • idempotent
  • no destroy

Create a new branch in Infrahub.

Parameters​

  • name (string, required): name of the branch to create
  • sync_with_git (boolean, default: false): whether to sync the branch with Git

get_branches​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve all branches from Infrahub.

GraphQL​

get_graphql_schema​

Capabilities​

  • read-only
  • idempotent
  • no destroy

Retrieve the GraphQL schema from Infrahub as a string.

query_graphql​

Capabilities​

  • may write (depends on operation)
  • idempotent for queries; non-idempotent for mutations
  • destructive potential depends on mutation

Execute a GraphQL operation against Infrahub.

Parameters​

  • query (string, required): GraphQL document (use query { ... } for reads, mutation { ... } for writes)