import bpy
mat = bpy.data.materials["GroundMat"]
nt = mat.node_tree
sep = None
for n in nt.nodes:
    if n.type == 'SEPARATE_COLOR':
        sep = n; break
modes = [e.identifier for e in sep.bl_rna.properties['mode'].enum_items]
print("modes:", modes)
if 'RGBA' in modes:
    sep.mode = 'RGBA'
out = nt.nodes['Material Output']
bsdf = nt.nodes['Principled BSDF']
# relink alpha channel -> m4 fac
m4 = None
for n in nt.nodes:
    if n.type == 'MIX_RGB' and abs(n.inputs['Color2'].default_value[0]-0.075)<0.01 and not n.inputs['Color2'].is_linked:
        m4 = n; break
for l in list(nt.links):
    if l.to_node == m4 and l.to_socket.name == 'Fac':
        nt.links.remove(l)
nt.links.new(sep.outputs['Alpha'], m4.inputs['Fac'])
result = {"ok": True, "sep_mode": sep.mode}


Traceback (most recent call last):
  File "<repo>\.runner\blender-mcp-v1.0.0\addon\mcp_to_blender_server.py", line 230, in _execute_code
    exec(code, namespace)
    ~~~~^^^^^^^^^^^^^^^^^
  File "<string>", line 22, in <module>
KeyError: 'bpy_prop_collection[key]: key "Alpha" not found'