Principled BSDF via Python API
Add and link the vertex colour node.

Adds a new material using mat = bpy.data.materials.new()  

Recommend: almost never use bpy.ops.materials.new() The material bpy.data.materials[mat] in script in question is confusing and varies dependant on pre existing materials "Material" and "MyMaterial".

Notice I used the index of the io when making links. Could use vcol.outputs["Color"] for vcol.outputs[0], however if the user is using a different language, then "Color" will be in that language.

The principled bsdf base color is input 0. A simple test in python console to save counting by eye.

&gt;&gt;&gt; for i, o in enumerate(bsdf.inputs):
...     i, o.name
...     
(0, 'Base Color')
(1, 'Subsurface')
(2, 'Subsurface Radius')
(3, 'Subsurface Color')
(4, 'Metallic')
(5, 'Specular')
(6, 'Specular Tint')
(7, 'Roughness')
(8, 'Anisotropic')
(9, 'Anisotropic Rotation')
(10, 'Sheen')
(11, 'Sheen Tint')
(12, 'Clearcoat')
(13, 'Clearcoat Roughness')
(14, 'IOR')
(15, 'Transmission')
(16, 'Transmission Roughness')
(17, 'Emission')
(18, 'Alpha')
(19, 'Normal')
(20, 'Clearcoat Normal')
(21, 'Tangent')


Script to add material, add vertex colour node, link it to base color of bsdf.

import bpy

newmat = bpy.data.materials.new("VertCol")
newmat.use_nodes = True
node_tree = newmat.node_tree
nodes = node_tree.nodes

bsdf = nodes.get("Principled BSDF") 
'''
# alternatively

output, bsdf = nodes
'''


assert(bsdf) # make sure it exists to continue

vcol = nodes.new(type="ShaderNodeVertexColor")
vcol.layer_name = "VColor" # the vertex color layer name

# make links

node_tree.links.new(vcol.outputs[0], bsdf.inputs[0])