Work with branches

Apply changes

Describe an infrastructure change as a small, typed mutation of your branch.

The change contract

Every mutation identifies the branch, operation, resource type, and resource ID. fields contains the properties to add or modify. Omit it for a delete.

ParameterTypeMeaning
branch_idstringID of an open branch
opadd | modify | deleteOperation in the model
resource_typestringSupported resource type
resource_idstringResource identifier
fieldsobject · optionalSchema fields for the mutation

Supported resources

The current mutation engine supports these five resource types. Collection coverage is broader than mutation coverage; a collected resource is not automatically editable.

Resource typeIdentity
ec2_instanceInstance ID
security_groupSecurity group ID
rds_instanceDatabase ID
s3_bucketBucket name
lambda_functionFunction name

Modify a resource

For example, disable the public-access flag on an existing database in the model. Use field names from Emfirge’s resource schema, not arbitrary AWS or Terraform property names.

MCP tool call
emfirge_apply_change({
  branch_id: "<branch_id>",
  op: "modify",
  resource_type: "rds_instance",
  resource_id: "<database_id>",
  fields: { publicly_accessible: false }
})

Add or delete a resource

An add needs the fields required by the resource schema. A delete identifies an existing resource and removes it from the branch model. Review the resulting edges and findings before drawing conclusions.

A removed model relationship does not fully describe application-level dependencies. Dependency breakage beyond the graph needs separate validation.

MCP tool call
emfirge_apply_change({
  branch_id: "<branch_id>",
  op: "delete",
  resource_type: "ec2_instance",
  resource_id: "<instance_id>"
})
Based on the Emfirge MCP and engine source.View source
Documentation