set_node_config
Sets a Jenkins node's configuration by applying an XML definition. Update node settings directly without manual UI steps.
Instructions
Set specific node config in Jenkins
Args: name: The name of the node config_xml: The config XML of the node
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| config_xml | Yes |
Implementation Reference
- src/mcp_jenkins/server/node.py:45-53 (handler)The MCP tool handler for 'set_node_config'. It is decorated with @mcp.tool(tags=['write']), accepts a context, node name, and config XML string, and delegates to the REST client.
@mcp.tool(tags=['write']) async def set_node_config(ctx: Context, name: str, config_xml: str) -> None: """Set specific node config in Jenkins Args: name: The name of the node config_xml: The config XML of the node """ jenkins(ctx).set_node_config(name=name, config_xml=config_xml) - The Jenkins REST client method that sends a POST request to the node config endpoint with the XML data.
def set_node_config(self, *, name: str, config_xml: str) -> None: """Set the configuration for a node. Args: name: The name of the node. config_xml: The node configuration as an XML string. """ self.request( 'POST', rest_endpoint.NODE_CONFIG(name=name), headers=self.DEFAULT_HEADERS, data=config_xml, ) - The REST endpoint definition for node config operations (GET/POST to computer/{name}/config.xml).
NODE_CONFIG = RestEndpoint('computer/{name}/config.xml') - src/mcp_jenkins/server/node.py:45-53 (registration)The @mcp.tool() decorator registers this function as an MCP tool named 'set_node_config' with a 'write' tag.
@mcp.tool(tags=['write']) async def set_node_config(ctx: Context, name: str, config_xml: str) -> None: """Set specific node config in Jenkins Args: name: The name of the node config_xml: The config XML of the node """ jenkins(ctx).set_node_config(name=name, config_xml=config_xml)